public class StateSet extends java.lang.Object implements State
Node.drawBegin(DrawContext)
, before
the method Node.draw(DrawContext)
is called.
If two states of the same class with the same attributes are added to a state set, then the order in which those states are applied is undefined. Generally, Nothing prevents two states of the same class from being added to the same state set. Howev
Constructor and Description |
---|
StateSet() |
Modifier and Type | Method and Description |
---|---|
void |
add(State state)
Adds the specified state to this set.
|
void |
apply()
Applies all states in this set.
|
boolean |
contains(java.lang.Class<?> stateClass)
Determines whether this set contains a state of the specified class.
|
State |
find(java.lang.Class<?> stateClass)
Finds a state in this set of the specified class.
|
static StateSet |
forTwoSidedShinySurface(java.awt.Color color)
Returns a new state set with color, light model, and material states.
|
int |
getAttributeBits()
Gets the combined attribute bits for all states in this set.
|
BlendState |
getBlendState()
Gets the blend state in this set, if present.
|
ColorState |
getColorState()
Gets the color state in this set, if present.
|
LightModelState |
getLightModelState()
Gets the light model state in this set, if present.
|
LineState |
getLineState()
Gets the line state in this set, if present.
|
MaterialState |
getMaterialState()
Gets the material state in this set, if present.
|
PointState |
getPointState()
Gets the point state in this set, if present.
|
PolygonState |
getPolygonState()
Gets the polygon state in this set, if present.
|
java.util.Iterator<State> |
getStates()
Gets an iterator for all states in this set.
|
void |
remove(State state)
Removes the specified state from this set.
|
public static StateSet forTwoSidedShinySurface(java.awt.Color color)
This method exists only to provide a simple way to construct a commonly used state set. It does nothing that cannot be accomplished (more tediously) by constructing a state set and adding each of its states using other methods.
color
- the color to be set.public void add(State state)
state
- the state.public void remove(State state)
state
- the state.public boolean contains(java.lang.Class<?> stateClass)
stateClass
- the state class.public State find(java.lang.Class<?> stateClass)
stateClass
- the state class.public java.util.Iterator<State> getStates()
public BlendState getBlendState()
public ColorState getColorState()
public LightModelState getLightModelState()
public LineState getLineState()
public MaterialState getMaterialState()
public PointState getPointState()
public PolygonState getPolygonState()
public int getAttributeBits()
getAttributeBits
in interface State