javax.media.j3d
Class ShaderAttributeSetRetained

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.ShaderAttributeSetRetained
All Implemented Interfaces:
java.lang.Cloneable

 class ShaderAttributeSetRetained
extends NodeComponentRetained

The ShaderAttributeSet object provides uniform attributes to shader programs.


Field Summary
private  java.util.Map attrs
           
(package private)  java.lang.Object liveStateLock
           
 
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
ShaderAttributeSetRetained()
          Constructs an empty ShaderAttributeSetretained object.
 
Method Summary
(package private)  void addAMirrorUser(Shape3DRetained shape)
           
(package private)  void clear()
          Removes all shader attributes from the attributes set.
(package private)  void clearLive(int refCount)
           
(package private)  void copyMirrorUsers(NodeComponentRetained node)
           
(package private)  void createMirrorObject()
           
(package private)  ShaderAttribute get(java.lang.String attrName)
          Retrieves the shader attribute with the specified attrName from the attributes set.
(package private)  ShaderAttribute[] getAll()
          Returns a shallow copy of the attributes set.
(package private)  java.util.Map getAttrs()
           
(package private)  void handleFrequencyChange(int bit)
           
(package private)  void initMirrorObject()
           
(package private)  void put(ShaderAttribute attr)
          Adds the specified shader attribute to the attributes set.
(package private)  void remove(ShaderAttribute attr)
          Removes the specified shader attribute from the attributes set.
(package private)  void remove(java.lang.String attrName)
          Removes the shader attribute with the specified attrName from the attributes set.
(package private)  void removeAMirrorUser(Shape3DRetained shape)
           
(package private)  void removeMirrorUsers(NodeComponentRetained node)
           
(package private)  void sendMessage(int attrMask, java.lang.Object attr)
           
(package private)  void setFrequencyChangeMask(int bit, int mask)
           
(package private)  void setLive(boolean backgroundGroup, int refCount)
           
(package private)  int size()
          Returns the number of elements in the attributes set.
(package private)  void updateMirrorObject(int component, java.lang.Object value)
          Update the "component" field of the mirror object with the given "value"
(package private)  void updateNative(Canvas3D cv, ShaderProgramRetained shaderProgram)
           
 
Methods inherited from class javax.media.j3d.NodeComponentRetained
addUser, clone, decRefCnt, doSetLive, getDuplicateOnCloneTree, getInImmCtx, incRefCnt, notifyUsers, removeUser, set, setDuplicateOnCloneTree, setInImmCtx
 
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

attrs

private java.util.Map attrs

liveStateLock

java.lang.Object liveStateLock
Constructor Detail

ShaderAttributeSetRetained

ShaderAttributeSetRetained()
Constructs an empty ShaderAttributeSetretained object. The attributes set is initially empty.

Method Detail

put

void put(ShaderAttribute attr)
Adds the specified shader attribute to the attributes set. The newly specified attribute replaces an attribute with the same name, if one already exists in the attributes set.

Parameters:
attr - the shader attribute to be added to the set

get

ShaderAttribute get(java.lang.String attrName)
Retrieves the shader attribute with the specified attrName from the attributes set. If attrName does not exist in the attributes set, null is returned.

Parameters:
attrName - the name of the shader attribute to be retrieved
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

remove

void remove(java.lang.String attrName)
Removes the shader attribute with the specified attrName from the attributes set. If attrName does not exist in the attributes set then nothing happens.

Parameters:
attrName - the name of the shader attribute to be removed

remove

void remove(ShaderAttribute attr)
Removes the specified shader attribute from the attributes set. If the attribute does not exist in the attributes set then nothing happens. Note that this method will not remove a shader object other than the one specified, even if it has the same name as the specified attribute. Applications that wish to remove an attribute by name should use removeAttribute(String).

Parameters:
attr - the shader attribute to be removed

clear

void clear()
Removes all shader attributes from the attributes set. The attributes set will be empty following this call.


getAll

ShaderAttribute[] getAll()
Returns a shallow copy of the attributes set.

Returns:
a shallow copy of the attributes set

size

int size()
Returns the number of elements in the attributes set.

Returns:
the number of elements in the attributes set

updateNative

void updateNative(Canvas3D cv,
                  ShaderProgramRetained shaderProgram)

getAttrs

java.util.Map getAttrs()

setLive

void setLive(boolean backgroundGroup,
             int refCount)
Overrides:
setLive in class NodeComponentRetained

addAMirrorUser

void addAMirrorUser(Shape3DRetained shape)
Overrides:
addAMirrorUser in class NodeComponentRetained

removeAMirrorUser

void removeAMirrorUser(Shape3DRetained shape)
Overrides:
removeAMirrorUser in class NodeComponentRetained

removeMirrorUsers

void removeMirrorUsers(NodeComponentRetained node)
Overrides:
removeMirrorUsers in class NodeComponentRetained

copyMirrorUsers

void copyMirrorUsers(NodeComponentRetained node)
Overrides:
copyMirrorUsers in class NodeComponentRetained

clearLive

void clearLive(int refCount)
Overrides:
clearLive in class NodeComponentRetained

createMirrorObject

void createMirrorObject()
Overrides:
createMirrorObject in class NodeComponentRetained

initMirrorObject

void initMirrorObject()
Overrides:
initMirrorObject in class NodeComponentRetained

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)

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.