|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgenegui.ModelState
ModelState.java Maintains a ModelState to be used for specifying intial states and stoppers.
Constructor Summary | |
ModelState()
Simple constructor does little to be proud of. |
|
ModelState(Model model)
Constructor initializes the ModelState based upon a passed Model. |
Method Summary | |
void |
addModelStateChangeListener(ModelStateChangeListener listener)
Called to add a new ModelStateChangeListener. |
void |
addModelStateView(ModelStateView view)
Called to add a new ModelStateView to the local list. |
void |
addStateChangeListener(NodeStateChangeListener listener,
int index)
Adds a NodeStateChangeListener to the ModelState. |
ModelState |
cloneState()
Makes a duplicate of this model state. |
void |
copyCellValues(int toCell,
int fromCell)
Copies all the values for one cell to another |
ModelStateView |
getActiveModelStateView()
Gets the currently active (selected) ModelStateView. |
CellState |
getCellState(int cellIndex)
Returns the CellState for the cell with the given index. |
CellState[] |
getCellStateArray()
Returns the CellStateArray - Used by serialization |
Model |
getModel()
Returns the Model that this is a ModelState for. |
java.awt.Color |
getNodeColor(int index)
Returns the color for this type of node. |
NodeTemplate[] |
getNodeTemplates()
Returns the array of NodeTemplates. |
int |
getNumberOfCells()
Returns the number of cells in the model. |
int |
getNumberOfNodes()
Returns the number of different types of nodes in the model. |
float |
getTime()
Returns the ModelState time |
ModelStateToolBox |
getToolBox()
Returns the one and only ModelStateToolBox attached to this ModelState |
void |
removeAllModelStateViews()
Removes all ModelStateViews, disposing of them and clearing the local list. |
void |
removeModelStateChangeListener(ModelStateChangeListener listener)
Called to remove a ModelStateChangeListener. |
void |
removeModelStateView(ModelStateView view)
Called to remove a ModelStateView from the local list. |
void |
removeStateChangeListener(NodeStateChangeListener listener,
int index)
Removes a NodeStateChangeListener from the ModelState. |
void |
reset()
Resets the values of all nodes for all cells to 0. |
void |
setActiveModelStateNodePalette(ModelStateNodePalette palette)
Sets the one and only ModelStateNodePalette attached to thsi ModelState. |
void |
setActiveModelStateView(ModelStateView modelStateView)
Sets the ModelStateView that is currently active (selected). |
void |
setCellState(int cellIndex,
CellState state)
Sets the CellState for the given cell to that of a new CellState. |
void |
setCellStateArray(CellState[] cellStateArray)
Replaces the entire CellStateArray with a new one. |
void |
setModel(Model theModel)
Sets the model. |
void |
setModelStateEditor(ModelStateEditor modelStateEditor)
Sets a ModelStateEditor to be used with this ModelState if there is one |
void |
setNodeTemplates(NodeTemplate[] templates)
Sets the node template array. |
void |
setSelectedCells(boolean[] selectedCells)
Accepts a list of cells that are selected in a ModelStateView and updates the ActiveModelStateNodePalette. |
void |
setTime(float time)
Sets the time. |
void |
setToolBox(ModelStateToolBox toolBox)
Sets the one and only ModelStateToolBox attached to this ModelState. |
void |
updateCell(int cellIndex)
Udates the values for a cell and notifies all node listeners that a change has occurred so the cell may be repainted were needed. |
void |
updateModel(Model model,
float time)
Called to completely update the values of the ModelState based upon a passed Model. |
void |
updateNodeValue(int index,
float value)
Updates all the value for a node for all the selected cells in the currently active ModelStateView. |
void |
updateNodeValue(int cellIndex,
int nodeIndex,
float value,
ModelStateChangeListener source)
Updates the value in a node for a state |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ModelState()
public ModelState(Model model)
Method Detail |
public void addModelStateChangeListener(ModelStateChangeListener listener)
public void addModelStateView(ModelStateView view)
public void addStateChangeListener(NodeStateChangeListener listener, int index)
public ModelState cloneState()
public void copyCellValues(int toCell, int fromCell)
public ModelStateView getActiveModelStateView()
public CellState getCellState(int cellIndex)
public CellState[] getCellStateArray()
public Model getModel()
public java.awt.Color getNodeColor(int index)
public NodeTemplate[] getNodeTemplates()
public int getNumberOfCells()
public int getNumberOfNodes()
public float getTime()
public ModelStateToolBox getToolBox()
public void removeAllModelStateViews()
public void removeModelStateChangeListener(ModelStateChangeListener listener)
public void removeModelStateView(ModelStateView view)
public void removeStateChangeListener(NodeStateChangeListener listener, int index)
public void reset()
public void setActiveModelStateNodePalette(ModelStateNodePalette palette)
public void setActiveModelStateView(ModelStateView modelStateView)
public void setCellState(int cellIndex, CellState state)
public void setCellStateArray(CellState[] cellStateArray)
public void setModel(Model theModel)
public void setModelStateEditor(ModelStateEditor modelStateEditor)
public void setNodeTemplates(NodeTemplate[] templates)
public void setSelectedCells(boolean[] selectedCells)
public void setTime(float time)
public void setToolBox(ModelStateToolBox toolBox)
public void updateCell(int cellIndex)
public void updateModel(Model model, float time)
public void updateNodeValue(int index, float value)
public void updateNodeValue(int cellIndex, int nodeIndex, float value, ModelStateChangeListener source)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |