|
org.netbeans.api.visual 2.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.api.visual.model.StateModel
public final class StateModel
This class represents a model with a single state which can be boolean or non-negative integer value. It supports stateChanged event listening.
| Nested Class Summary | |
|---|---|
static interface |
StateModel.Listener
The listener for listening on state changed event on a state model. |
| Constructor Summary | |
|---|---|
StateModel()
Creates a boolean (2-states) model. |
|
StateModel(int maxStates)
Creates a model with a specified maximal states. |
|
| Method Summary | |
|---|---|
void |
addListener(StateModel.Listener listener)
Adds a listener of a state value changed. |
void |
decrease()
Decreases the state value. |
boolean |
getBooleanState()
Returns a boolean representation of a state. |
int |
getMaxStates()
Returns a maximal states. |
int |
getState()
Returns a integer representation of the state. |
void |
increase()
Increases the state value. |
void |
removeListener(StateModel.Listener listener)
Removes a listener of a state value changed. |
void |
setBooleanState(boolean state)
Sets a boolean state. |
void |
setState(int state)
Sets a new state value. |
void |
toggleBooleanState()
Toggles boolean state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StateModel()
public StateModel(int maxStates)
maxStates - the maximal states| Method Detail |
|---|
public boolean getBooleanState()
public void setBooleanState(boolean state)
state - the boolean state; if true, then 1 value is used; if false, then 0 value is usedpublic void toggleBooleanState()
public int getState()
public void decrease()
public void increase()
public void setState(int state)
state - the new state valuepublic int getMaxStates()
public void addListener(StateModel.Listener listener)
listener - the listenerpublic void removeListener(StateModel.Listener listener)
listener - the listener
|
org.netbeans.api.visual 2.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||