|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.graph.AbstractGraphController
ptolemy.vergil.basic.BasicGraphController
ptolemy.vergil.basic.WithIconGraphController
ptolemy.vergil.basic.RunnableGraphController
public abstract class RunnableGraphController
A graph controller for models that can be executed. This controller provides toolbar buttons for executing the model. If the model being controlled is not a top-level model, then execution commands are propagated up to the top level.
Red (johnr) |
Red (eal) |
Nested Class Summary | |
---|---|
private class |
RunnableGraphController.ButtonFigureAction
An action to run the model that includes a button. |
private class |
RunnableGraphController.PauseModelAction
An action to pause the model. |
private class |
RunnableGraphController.RunModelAction
An action to run the model. |
private class |
RunnableGraphController.StopModelAction
An action to stop the model. |
Nested classes/interfaces inherited from class ptolemy.vergil.basic.WithIconGraphController |
---|
WithIconGraphController.NewPortAction |
Nested classes/interfaces inherited from class ptolemy.vergil.basic.BasicGraphController |
---|
BasicGraphController.OpenBaseClassAction, BasicGraphController.SchematicContextMenuFactory, BasicGraphController.UnitSolverDialogAction |
Field Summary | |
---|---|
private java.util.List<Attribute> |
_errorHighlights
List of error highlight attributes we have created. |
private Manager |
_manager
The manager we are currently listening to. |
private javax.swing.Action |
_pauseModelAction
Action for pausing the model. |
private Manager.State |
_previousState
The previous state of the manager, to avoid reporting it if it hasn't changed. |
private javax.swing.Action |
_runModelAction
Action for running the model. |
private javax.swing.Action |
_stopModelAction
Action for stopping the model. |
Fields inherited from class ptolemy.vergil.basic.WithIconGraphController |
---|
_editIconAction, _portController, _removeIconAction |
Fields inherited from class ptolemy.vergil.basic.BasicGraphController |
---|
_animated, _animationRenderer, _configureAction, _configureMenuFactory, _menuCreator, _menuFactory, _openBaseClassAction, _unitSolverDialogAction |
Constructor Summary | |
---|---|
RunnableGraphController()
Create a new controller. |
Method Summary | |
---|---|
private void |
_addErrorHighlightIfNeeded(Nameable culprit)
Add an error highlight color to the specified culprit if it is not already present. |
protected void |
_addHotKeys(JGraph jgraph)
Add hot keys to the actions in the given JGraph. |
protected Manager |
_getManager()
Get the manager for the top-level of the associated model, if there is one, or create one if there is not. |
private void |
_highlightError(Nameable culprit)
Highlight the specified object and all its containers to indicate that it is the source of an error. |
void |
addToMenuAndToolbar(javax.swing.JMenu menu,
javax.swing.JToolBar toolbar)
Add execution commands to the toolbar. |
void |
executionError(Manager manager,
java.lang.Throwable throwable)
Report that an execution error has occurred. |
void |
executionFinished(Manager manager)
Report that execution of the model has finished. |
void |
managerStateChanged(Manager manager)
Report that a manager state has changed. |
Methods inherited from class ptolemy.vergil.basic.WithIconGraphController |
---|
_createControllers, getNewPortLocation, initializeInteraction, setConfiguration |
Methods inherited from class ptolemy.vergil.basic.BasicGraphController |
---|
_initializeInteraction, clearAnimation, event, getAnimationDelay, getConfiguration, getConfigureMenuFactory, getFrame, getNodeController, message, setAnimationDelay, setFigure, setFrame, valueChanged |
Methods inherited from class diva.graph.AbstractGraphController |
---|
addEdge, addEdge, addGraphViewListener, addNode, addNode, addNode, addNode, clear, clearEdge, clearNode, dispatch, drawEdge, drawNode, drawNode, getEdgeController, getFigure, getGraphModel, getGraphPane, getSelectionModel, removeEdge, removeGraphViewListener, removeNode, rerender, rerenderEdge, rerenderNode, setGraphModel, setGraphPane, setSelectionModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.List<Attribute> _errorHighlights
private Manager _manager
private javax.swing.Action _pauseModelAction
private Manager.State _previousState
private javax.swing.Action _runModelAction
private javax.swing.Action _stopModelAction
Constructor Detail |
---|
public RunnableGraphController()
Method Detail |
---|
public void addToMenuAndToolbar(javax.swing.JMenu menu, javax.swing.JToolBar toolbar)
addToMenuAndToolbar
in class BasicGraphController
menu
- The menu to add to, which is ignored.toolbar
- The toolbar to add to, or null if none.public void executionError(Manager manager, java.lang.Throwable throwable)
executionError
in interface ExecutionListener
manager
- The manager calling this method.throwable
- The throwable being reported.public void executionFinished(Manager manager)
executionFinished
in interface ExecutionListener
manager
- The manager calling this method.public void managerStateChanged(Manager manager)
managerStateChanged
in interface ExecutionListener
manager
- The manager calling this method.Manager.getState()
protected void _addHotKeys(JGraph jgraph)
_addHotKeys
in class BasicGraphController
jgraph
- The JGraph to which hot keys are to be added.protected Manager _getManager() throws IllegalActionException
IllegalActionException
- If the associated model is
not a CompositeActor, or if the manager cannot be created.private void _addErrorHighlightIfNeeded(Nameable culprit) throws IllegalActionException, NameDuplicationException
culprit
- The culprit to highlight.
IllegalActionException
- If the highlight cannot be added.
NameDuplicationException
- Should not be thrown.private void _highlightError(Nameable culprit)
culprit
- The culprit.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |