javax.media.j3d
Class TransparencyAttributes

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.NodeComponent
              |
              +--javax.media.j3d.TransparencyAttributes

public class TransparencyAttributes
extends NodeComponent

The TransparencyAttributes object defines all attributes affecting transparency of the object.


Field Summary
static int ALLOW_MODE_READ
          Specifies that this TransparencyAttributes object allows reading its transparency mode component information.
static int ALLOW_MODE_WRITE
          Specifies that this TransparencyAttributes object allows writing its transparency mode component information.
static int ALLOW_VALUE_READ
          Specifies that this TransparencyAttributes object allows reading its transparency value.
static int ALLOW_VALUE_WRITE
          Specifies that this TransparencyAttributes object allows writing its transparency value.
static int BLENDED
          Use alpha blended transparency.
static int FASTEST
          Use the fastest available method for transparency.
static int NICEST
          Use the nicest available method for transparency.
static int NONE
          No transparency, opaque object.
static int SCREEN_DOOR
          Use screen-door transparency.
 
Constructor Summary
TransparencyAttributes()
          Constructs a TransparencyAttributes object with default parameters.
TransparencyAttributes(int tMode, float tVal)
          Construct TransparencyAttributes object with specified values.
 
Method Summary
 NodeComponent cloneNodeComponent()
          Creates a new TransparencyAttributes object.
 void duplicateNodeComponent(NodeComponent originalNodeComponent)
          Copies the information found in originalNodeComponent to the current node.
 float getTransparency()
          Retrieves this appearance's transparency.
 int getTransparencyMode()
          Gets the transparency mode for this appearance component object.
 void setTransparency(float transparency)
          Sets this appearance's transparency.
 void setTransparencyMode(int transparencyMode)
          Sets the transparency mode for this appearance component object.
 
Methods inherited from class javax.media.j3d.NodeComponent
getDuplicateOnCloneTree, setDuplicateOnCloneTree
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_MODE_READ

public static final int ALLOW_MODE_READ
Specifies that this TransparencyAttributes object allows reading its transparency mode component information.

ALLOW_MODE_WRITE

public static final int ALLOW_MODE_WRITE
Specifies that this TransparencyAttributes object allows writing its transparency mode component information.

ALLOW_VALUE_READ

public static final int ALLOW_VALUE_READ
Specifies that this TransparencyAttributes object allows reading its transparency value.

ALLOW_VALUE_WRITE

public static final int ALLOW_VALUE_WRITE
Specifies that this TransparencyAttributes object allows writing its transparency value.

FASTEST

public static final int FASTEST
Use the fastest available method for transparency.

NICEST

public static final int NICEST
Use the nicest available method for transparency.

BLENDED

public static final int BLENDED
Use alpha blended transparency. A blend equation of: alpha*src + (1-alpha)*dst is used where alpha is 1-transparency.

SCREEN_DOOR

public static final int SCREEN_DOOR
Use screen-door transparency. This is done using an on/off stipple pattern where the percentage of pixels that are transparent is approximately equal to the value specified by the transparency parameter.

NONE

public static final int NONE
No transparency, opaque object.
Constructor Detail

TransparencyAttributes

public TransparencyAttributes()
Constructs a TransparencyAttributes object with default parameters. The default values are as follows:

TransparencyAttributes

public TransparencyAttributes(int tMode,
                              float tVal)
Construct TransparencyAttributes object with specified values.
Parameters:
tMode - the transparency mode.
tVal - the transparency value.
Method Detail

setTransparencyMode

public final void setTransparencyMode(int transparencyMode)
Sets the transparency mode for this appearance component object.
Parameters:
transparencyMode - the transparency mode to be used, one of NONE, FASTEST, NICEST, SCREEN_DOOR, or BLENDED
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getTransparencyMode

public final int getTransparencyMode()
Gets the transparency mode for this appearance component object.
Returns:
transparencyMode the transparency mode
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setTransparency

public final void setTransparency(float transparency)
Sets this appearance's transparency.
Parameters:
transparency - the appearance's transparency in the range [0.0, 1.0] with 0.0 being fully opaque and 1.0 being fully transparent
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getTransparency

public final float getTransparency()
Retrieves this appearance's transparency.
Returns:
the appearance's transparency
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

cloneNodeComponent

public NodeComponent cloneNodeComponent()
Creates a new TransparencyAttributes object. Called from a Leaf node's duplicateNode method.
Overrides:
cloneNodeComponent in class NodeComponent
Returns:
a duplicate of the TransparencyAttributes object.
See Also:
Node.duplicateNode(javax.media.j3d.Node, boolean), Node.cloneTree(), NodeComponent.setDuplicateOnCloneTree(boolean)

duplicateNodeComponent

public void duplicateNodeComponent(NodeComponent originalNodeComponent)
Copies the information found in originalNodeComponent to the current node. This routine is called as part of the cloneTree operation.
Overrides:
duplicateNodeComponent in class NodeComponent
Parameters:
originalNodeComponent - the node to duplicate.
See Also:
Node.cloneTree(), Node.duplicateNode(javax.media.j3d.Node, boolean), NodeComponent.setDuplicateOnCloneTree(boolean)