javax.media.j3d
Class AppearanceRetained

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.AppearanceRetained
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ShaderAppearanceRetained

 class AppearanceRetained
extends NodeComponentRetained

The Appearance object defines all rendering state that can be set as a component object of a Shape3D node.


Field Summary
(package private) static int ALL_SOLE_USERS
           
(package private) static int COLOR
           
(package private)  ColoringAttributesRetained coloringAttributes
           
(package private) static int LINE
           
(package private)  LineAttributesRetained lineAttributes
           
(package private)  java.lang.Object liveStateLock
           
(package private)  CompileState map
           
(package private)  AppearanceRetained mapAppearance
           
(package private)  MaterialRetained material
           
(package private) static int MATERIAL
           
(package private) static int POINT
           
(package private)  PointAttributesRetained pointAttributes
           
(package private) static int POLYGON
           
(package private)  PolygonAttributesRetained polygonAttributes
           
(package private) static int RENDERING
           
(package private)  RenderingAttributesRetained renderingAttributes
           
(package private)  AppearanceRetained sgApp
           
(package private) static int TEXCOORD_GEN
           
(package private)  TexCoordGenerationRetained texCoordGeneration
           
(package private)  TextureRetained texture
           
(package private) static int TEXTURE
           
(package private) static int TEXTURE_ATTR
           
(package private) static int TEXTURE_UNIT_STATE
           
(package private)  TextureAttributesRetained textureAttributes
           
(package private)  TextureUnitStateRetained[] texUnitState
           
(package private) static int TRANSPARENCY
           
(package private)  TransparencyAttributesRetained transparencyAttributes
           
 
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
AppearanceRetained()
           
 
Method Summary
(package private)  void addAMirrorUser(Shape3DRetained shape)
           
(package private)  void clearLive(int refCount)
          This method calls the clearLive method of all appearance bundle objects.
(package private)  void compile(CompileState compState)
          This is the default compile() method, which just marks the sgo as compiled.
(package private)  void createMirrorObject()
           
(package private)  void doSetLive(boolean backgroundGroup, int refCount)
          This method calls the setLive method of all appearance bundle objects.
(package private)  boolean equals(AppearanceRetained app)
           
 boolean equals(java.lang.Object obj)
           
(package private)  ColoringAttributes getColoringAttributes()
          Retrieves the current coloringAttributes object.
(package private)  LineAttributes getLineAttributes()
          Retrieves the current lineAttributes object.
(package private)  Material getMaterial()
          Retrieve the current material object.
(package private)  PointAttributes getPointAttributes()
          Retrieves the current pointAttributes object.
(package private)  PolygonAttributes getPolygonAttributes()
          Retrieves the current polygonAttributes object.
(package private)  RenderingAttributes getRenderingAttributes()
          Retrieves the current renderingAttributes object.
(package private)  TexCoordGeneration getTexCoordGeneration()
          Retrieves the current texCoordGeneration object.
(package private)  Texture getTexture()
          Retrieves the current texture object.
(package private)  TextureAttributes getTextureAttributes()
          Retrieves the current textureAttributes object.
(package private)  int getTextureUnitCount()
          Retrieves the length of the texture unit state array from this appearance object.
(package private)  TextureUnitState[] getTextureUnitState()
          Retrieves the array of texture unit state objects from this Appearance object.
(package private)  TextureUnitState getTextureUnitState(int index)
          Retrieves the texture unit state object at the specified index within the texture unit state array.
(package private)  TransparencyAttributes getTransparencyAttributes()
          Retrieves the current transparencyAttributes object.
(package private)  void handleFrequencyChange(int bit)
           
 int hashCode()
          Returns the hashcode for this object.
(package private)  void initMirrorObject()
          This routine updates the mirror appearance for this appearance.
(package private)  boolean isOpaque(int geoType)
           
(package private)  boolean isStatic()
          true if component can't be read or written after compile or setlive()
(package private)  void removeAMirrorUser(Shape3DRetained shape)
           
(package private)  void sendMessage(int attrMask, java.lang.Object attr, boolean visible)
           
(package private)  void sendRenderingAttributesChangedMessage(boolean visible)
           
(package private)  void setColoringAttributes(ColoringAttributes coloringAttributes)
          Sets the coloringAttrbutes object to the specified object.
(package private)  void setLineAttributes(LineAttributes lineAttributes)
          Sets the lineAttrbutes object to the specified object.
(package private)  void setLive(boolean backgroundGroup, int refCount)
           
(package private)  void setMaterial(Material material)
          Set the material object to the specified object.
(package private)  void setPointAttributes(PointAttributes pointAttributes)
          Sets the pointAttrbutes object to the specified object.
(package private)  void setPolygonAttributes(PolygonAttributes polygonAttributes)
          Sets the polygonAttrbutes object to the specified object.
(package private)  void setRenderingAttributes(RenderingAttributes renderingAttributes)
          Sets the renderingAttrbutes object to the specified object.
(package private)  void setTexCoordGeneration(TexCoordGeneration texGen)
          Sets the texCoordGeneration object to the specified object.
(package private)  void setTexture(Texture texture)
          Sets the texture object to the specified object.
(package private)  void setTextureAttributes(TextureAttributes textureAttributes)
          Sets the textureAttrbutes object to the specified object.
(package private)  void setTextureUnitState(int index, TextureUnitState state)
           
(package private)  void setTextureUnitState(TextureUnitState[] stateArray)
          Sets the texture unit state array to the specified array.
(package private)  void setTransparencyAttributes(TransparencyAttributes transparencyAttributes)
          Sets the transparencyAttrbutes object to the specified object.
(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.NodeComponentRetained
addUser, clone, copyMirrorUsers, decRefCnt, getDuplicateOnCloneTree, getInImmCtx, incRefCnt, notifyUsers, removeMirrorUsers, removeUser, set, setDuplicateOnCloneTree, setFrequencyChangeMask, setInImmCtx
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, doSetLive, doSetLive, getSource, getVirtualUniverse, isInSetLive, 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
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

material

MaterialRetained material

texture

TextureRetained texture

texCoordGeneration

TexCoordGenerationRetained texCoordGeneration

textureAttributes

TextureAttributesRetained textureAttributes

texUnitState

TextureUnitStateRetained[] texUnitState

coloringAttributes

ColoringAttributesRetained coloringAttributes

transparencyAttributes

TransparencyAttributesRetained transparencyAttributes

renderingAttributes

RenderingAttributesRetained renderingAttributes

polygonAttributes

PolygonAttributesRetained polygonAttributes

lineAttributes

LineAttributesRetained lineAttributes

pointAttributes

PointAttributesRetained pointAttributes

liveStateLock

java.lang.Object liveStateLock

map

CompileState map

mapAppearance

AppearanceRetained mapAppearance

MATERIAL

static final int MATERIAL
See Also:
Constant Field Values

TEXTURE

static final int TEXTURE
See Also:
Constant Field Values

TEXCOORD_GEN

static final int TEXCOORD_GEN
See Also:
Constant Field Values

TEXTURE_ATTR

static final int TEXTURE_ATTR
See Also:
Constant Field Values

COLOR

static final int COLOR
See Also:
Constant Field Values

TRANSPARENCY

static final int TRANSPARENCY
See Also:
Constant Field Values

RENDERING

static final int RENDERING
See Also:
Constant Field Values

POLYGON

static final int POLYGON
See Also:
Constant Field Values

LINE

static final int LINE
See Also:
Constant Field Values

POINT

static final int POINT
See Also:
Constant Field Values

TEXTURE_UNIT_STATE

static final int TEXTURE_UNIT_STATE
See Also:
Constant Field Values

ALL_SOLE_USERS

static final int ALL_SOLE_USERS
See Also:
Constant Field Values

sgApp

AppearanceRetained sgApp
Constructor Detail

AppearanceRetained

AppearanceRetained()
Method Detail

setMaterial

void setMaterial(Material material)
Set the material object to the specified object.

Parameters:
material - object that specifies the desired material
Throws:
IllegalSharingException - properties

getMaterial

Material getMaterial()
Retrieve the current material object.

Returns:
the material object

setTexture

void setTexture(Texture texture)
Sets the texture object to the specified object.

Parameters:
texture - object that specifies the desired texture map and texture parameters

getTexture

Texture getTexture()
Retrieves the current texture object.

Returns:
the texture object

setTextureAttributes

void setTextureAttributes(TextureAttributes textureAttributes)
Sets the textureAttrbutes object to the specified object.

Parameters:
textureAttributes - object that specifies the desired texture attributes

getTextureAttributes

TextureAttributes getTextureAttributes()
Retrieves the current textureAttributes object.

Returns:
the textureAttributes object

setColoringAttributes

void setColoringAttributes(ColoringAttributes coloringAttributes)
Sets the coloringAttrbutes object to the specified object.

Parameters:
coloringAttributes - object that specifies the desired texture attributes

getColoringAttributes

ColoringAttributes getColoringAttributes()
Retrieves the current coloringAttributes object.

Returns:
the coloringAttributes object

setTransparencyAttributes

void setTransparencyAttributes(TransparencyAttributes transparencyAttributes)
Sets the transparencyAttrbutes object to the specified object.

Parameters:
transparencyAttributes - object that specifies the desired texture attributes

getTransparencyAttributes

TransparencyAttributes getTransparencyAttributes()
Retrieves the current transparencyAttributes object.

Returns:
the transparencyAttributes object

setRenderingAttributes

void setRenderingAttributes(RenderingAttributes renderingAttributes)
Sets the renderingAttrbutes object to the specified object.

Parameters:
renderingAttributes - object that specifies the desired texture attributes

getRenderingAttributes

RenderingAttributes getRenderingAttributes()
Retrieves the current renderingAttributes object.

Returns:
the renderingAttributes object

setPolygonAttributes

void setPolygonAttributes(PolygonAttributes polygonAttributes)
Sets the polygonAttrbutes object to the specified object.

Parameters:
polygonAttributes - object that specifies the desired texture attributes

getPolygonAttributes

PolygonAttributes getPolygonAttributes()
Retrieves the current polygonAttributes object.

Returns:
the polygonAttributes object

setLineAttributes

void setLineAttributes(LineAttributes lineAttributes)
Sets the lineAttrbutes object to the specified object.

Parameters:
lineAttributes - object that specifies the desired texture attributes

getLineAttributes

LineAttributes getLineAttributes()
Retrieves the current lineAttributes object.

Returns:
the lineAttributes object

setPointAttributes

void setPointAttributes(PointAttributes pointAttributes)
Sets the pointAttrbutes object to the specified object.

Parameters:
pointAttributes - object that specifies the desired texture attributes

getPointAttributes

PointAttributes getPointAttributes()
Retrieves the current pointAttributes object.

Returns:
the pointAttributes object

setTexCoordGeneration

void setTexCoordGeneration(TexCoordGeneration texGen)
Sets the texCoordGeneration object to the specified object.

Parameters:
texCoordGeneration - object that specifies the texture coordinate generation parameters

getTexCoordGeneration

TexCoordGeneration getTexCoordGeneration()
Retrieves the current texCoordGeneration object.

Returns:
the texCoordGeneration object

setTextureUnitState

void setTextureUnitState(TextureUnitState[] stateArray)
Sets the texture unit state array to the specified array.

Parameters:
textureUnitState - array that specifies the texture unit state

setTextureUnitState

void setTextureUnitState(int index,
                         TextureUnitState state)

getTextureUnitState

TextureUnitState[] getTextureUnitState()
Retrieves the array of texture unit state objects from this Appearance object. A shallow copy of the array of references to the TextureUnitState objects is returned.


getTextureUnitState

TextureUnitState getTextureUnitState(int index)
Retrieves the texture unit state object at the specified index within the texture unit state array.


getTextureUnitCount

int getTextureUnitCount()
Retrieves the length of the texture unit state array from this appearance object. The length of this array specifies the maximum number of texture units that will be used by this appearance object. If the array is null, a count of 0 is returned.


createMirrorObject

void createMirrorObject()
Overrides:
createMirrorObject in class NodeComponentRetained

initMirrorObject

void initMirrorObject()
This routine updates the mirror appearance for this appearance. It also calls the update method for each node component if it is not null.

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

setLive

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

doSetLive

void doSetLive(boolean backgroundGroup,
               int refCount)
This method calls the setLive method of all appearance bundle objects.

Overrides:
doSetLive in class NodeComponentRetained

clearLive

void clearLive(int refCount)
This method calls the clearLive method of all appearance bundle objects.

Overrides:
clearLive in class NodeComponentRetained

isStatic

boolean isStatic()
Description copied from class: SceneGraphObjectRetained
true if component can't be read or written after compile or setlive()

Overrides:
isStatic in class SceneGraphObjectRetained

compile

void compile(CompileState compState)
Description copied from class: SceneGraphObjectRetained
This is the default compile() method, which just marks the sgo as compiled.

Overrides:
compile in class SceneGraphObjectRetained

hashCode

public int hashCode()
Returns the hashcode for this object. hashcode should be constant for object but same for two objects if .equals() is true. For an appearance (where .equals() is going to use the values in the appearance), the only way to have a constant value is for all appearances to have the same hashcode, so we use the hashcode of the class obj. Since hashCode is only used by AppearanceMap (at present) we may be able to improve efficency by calcing a hashCode from the values.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

equals

boolean equals(AppearanceRetained app)

addAMirrorUser

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

removeAMirrorUser

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

sendMessage

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

sendRenderingAttributesChangedMessage

final void sendRenderingAttributesChangedMessage(boolean visible)

isOpaque

boolean isOpaque(int geoType)

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.