javax.media.j3d
Class ShaderAttributeObjectRetained

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.SceneGraphObjectRetained
          extended by javax.media.j3d.NodeComponentRetained
              extended by javax.media.j3d.ShaderAttributeRetained
                  extended by javax.media.j3d.ShaderAttributeObjectRetained
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ShaderAttributeArrayRetained, ShaderAttributeValueRetained

abstract class ShaderAttributeObjectRetained
extends ShaderAttributeRetained

The ShaderAttributeObjectRetained class is an abstract class that encapsulates a uniform shader attribute whose value is specified explicitly.


Nested Class Summary
(package private) static class ShaderAttributeObjectRetained.AttrWrapper
          Base wrapper class for subclasses that are used to store a copy of the user-specified shader attribute value.
 
Field Summary
(package private)  ShaderAttributeObjectRetained.AttrWrapper attrWrapper
           
private  java.lang.Class baseClass
           
(package private) static java.lang.Class[] classTable
           
(package private) static java.lang.Class[] classTableArr
           
private  int classType
           
(package private) static int TYPE_FLOAT
           
(package private) static int TYPE_INTEGER
           
(package private) static int TYPE_MATRIX3F
           
(package private) static int TYPE_MATRIX4F
           
(package private) static int TYPE_TUPLE2F
           
(package private) static int TYPE_TUPLE2I
           
(package private) static int TYPE_TUPLE3F
           
(package private) static int TYPE_TUPLE3I
           
(package private) static int TYPE_TUPLE4F
           
(package private) static int TYPE_TUPLE4I
           
 
Fields inherited from class javax.media.j3d.ShaderAttributeRetained
attrName
 
Fields inherited from class javax.media.j3d.NodeComponentRetained
changedFrequent, compChanged, duplicateOnCloneTree, mirror, refCnt, refCount, users
 
Fields inherited from class javax.media.j3d.SceneGraphObjectRetained
DONT_MERGE, inBackgroundGroup, inSetLive, MERGE, MERGE_DONE, mergeFlag, onUpdateList, source
 
Fields inherited from class javax.media.j3d.IndexedObject
listIdx
 
Constructor Summary
ShaderAttributeObjectRetained()
          Package scope constructor
 
Method Summary
(package private) abstract  int computeClassType(java.lang.Object value)
          Computes the base class from the specified object.
(package private) abstract  ShaderAttributeObjectRetained.AttrWrapper createAttrWrapper(java.lang.Object value, int classType)
          Creates an attribute wrapper object of the specified class type, and stores the specified object.
(package private)  void createObjectData(java.lang.Object value)
           
(package private) abstract  java.lang.Class getBaseClass(int classType)
          Returns the base class represented by the specified class type.
(package private)  int getClassType()
           
(package private)  java.lang.Object getValue()
          Retrieves the value of this shader attribute.
(package private)  java.lang.Class getValueClass()
          Retrieves the base class of the value of this shader attribute.
(package private)  void handleFrequencyChange(int bit)
           
(package private)  void initMirrorObject()
          Initializes a mirror object.
(package private)  void initValue(java.lang.Object value)
           
(package private)  void sendMessage(int attrMask, java.lang.Object attr)
           
(package private)  void setClassType(int classType)
           
(package private)  void setFrequencyChangeMask(int bit, int mask)
           
(package private)  void setValue(java.lang.Object value)
          Sets the value of this shader attribute to the specified value.
(package private)  void updateMirrorObject(int component, java.lang.Object value)
          Update the "component" field of the mirror object with the given "value"
 
Methods inherited from class javax.media.j3d.ShaderAttributeRetained
getAttributeName, initializeAttrName
 
Methods inherited from class javax.media.j3d.NodeComponentRetained
addAMirrorUser, addUser, clearLive, clone, copyMirrorUsers, createMirrorObject, decRefCnt, doSetLive, getDuplicateOnCloneTree, getInImmCtx, incRefCnt, notifyUsers, removeAMirrorUser, removeMirrorUsers, removeUser, set, setDuplicateOnCloneTree, setInImmCtx, setLive
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, compile, doSetLive, doSetLive, getSource, getVirtualUniverse, isInSetLive, isStatic, markAsLive, merge, mergeTransform, setCompiled, setLive, setLive, setSource, traverse
 
Methods inherited from class javax.media.j3d.IndexedObject
getIdxUsed, incIdxUsed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classType

private int classType

baseClass

private java.lang.Class baseClass

attrWrapper

ShaderAttributeObjectRetained.AttrWrapper attrWrapper

TYPE_INTEGER

static final int TYPE_INTEGER
See Also:
Constant Field Values

TYPE_FLOAT

static final int TYPE_FLOAT
See Also:
Constant Field Values

TYPE_TUPLE2I

static final int TYPE_TUPLE2I
See Also:
Constant Field Values

TYPE_TUPLE2F

static final int TYPE_TUPLE2F
See Also:
Constant Field Values

TYPE_TUPLE3I

static final int TYPE_TUPLE3I
See Also:
Constant Field Values

TYPE_TUPLE3F

static final int TYPE_TUPLE3F
See Also:
Constant Field Values

TYPE_TUPLE4I

static final int TYPE_TUPLE4I
See Also:
Constant Field Values

TYPE_TUPLE4F

static final int TYPE_TUPLE4F
See Also:
Constant Field Values

TYPE_MATRIX3F

static final int TYPE_MATRIX3F
See Also:
Constant Field Values

TYPE_MATRIX4F

static final int TYPE_MATRIX4F
See Also:
Constant Field Values

classTable

static final java.lang.Class[] classTable

classTableArr

static final java.lang.Class[] classTableArr
Constructor Detail

ShaderAttributeObjectRetained

ShaderAttributeObjectRetained()
Package scope constructor

Method Detail

createObjectData

void createObjectData(java.lang.Object value)

initValue

void initValue(java.lang.Object value)

getValue

java.lang.Object getValue()
Retrieves the value of this shader attribute. A copy of the object is returned.


setValue

void setValue(java.lang.Object value)
Sets the value of this shader attribute to the specified value. A copy of the object is stored.

Parameters:
value - the new value of the shader attribute
Throws:
java.lang.NullPointerException - if value is null
java.lang.ClassCastException - if value is not an instance of the same base class as the object used to construct this shader attribute object.

getValueClass

java.lang.Class getValueClass()
Retrieves the base class of the value of this shader attribute. This class will always be one of the allowable classes, even if a subclass was used to construct this shader attribute object. For example, if this shader attribute object was constructed with an instance of javax.vecmath.Point3f, the returned class would be javax.vecmath.Tuple3f.

Returns:
the base class of the value of this shader attribute

initMirrorObject

void initMirrorObject()
Initializes a mirror object.

Overrides:
initMirrorObject in class ShaderAttributeRetained

updateMirrorObject

void updateMirrorObject(int component,
                        java.lang.Object value)
Update the "component" field of the mirror object with the given "value"

Overrides:
updateMirrorObject in class NodeComponentRetained

sendMessage

final void sendMessage(int attrMask,
                       java.lang.Object attr)

computeClassType

abstract int computeClassType(java.lang.Object value)
Computes the base class from the specified object. A ClassCastException is thrown if the object is not an instance or array of one of the allowed classes.


getBaseClass

abstract java.lang.Class getBaseClass(int classType)
Returns the base class represented by the specified class type.


createAttrWrapper

abstract ShaderAttributeObjectRetained.AttrWrapper createAttrWrapper(java.lang.Object value,
                                                                     int classType)
Creates an attribute wrapper object of the specified class type, and stores the specified object.


getClassType

int getClassType()

setClassType

void setClassType(int classType)

setFrequencyChangeMask

void setFrequencyChangeMask(int bit,
                            int mask)
Overrides:
setFrequencyChangeMask in class NodeComponentRetained

handleFrequencyChange

void handleFrequencyChange(int bit)
Overrides:
handleFrequencyChange in class SceneGraphObjectRetained


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.