Package ptolemy.vergil.basic
Class RunnableGraphController
- java.lang.Object
-
- diva.graph.AbstractGraphController
-
- ptolemy.vergil.basic.BasicGraphController
-
- ptolemy.vergil.basic.WithIconGraphController
-
- ptolemy.vergil.basic.RunnableGraphController
-
- All Implemented Interfaces:
GraphController
,ExecutionListener
,DebugListener
,ValueListener
- Direct Known Subclasses:
ActorViewerGraphController
,FSMViewerGraphController
public abstract class RunnableGraphController extends WithIconGraphController implements ExecutionListener
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.- Since:
- Ptolemy II 2.1
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Red (eal)
-
-
Nested Class Summary
-
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
-
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
Constructors Constructor Description RunnableGraphController()
Create a new controller.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected void
_report(java.lang.String message)
If there is an associated BasicGraphFrame, use it to report a message.protected void
_report(java.lang.Throwable error)
If there is an associated BasicGraphFrame, use it to report 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
_areThereActiveErrorHighlights, _getClearAllErrorHighlightsChangeRequest, _initializeInteraction, clearAllErrorHighlights, clearAnimation, event, getAnimationDelay, getConfiguration, getConfigureMenuFactory, getFrame, getNodeController, highlightError, 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
-
-
-
-
Method Detail
-
addToMenuAndToolbar
public void addToMenuAndToolbar(javax.swing.JMenu menu, javax.swing.JToolBar toolbar)
Add execution commands to the toolbar.- Overrides:
addToMenuAndToolbar
in classBasicGraphController
- Parameters:
menu
- The menu to add to, which is ignored.toolbar
- The toolbar to add to, or null if none.
-
executionError
public void executionError(Manager manager, java.lang.Throwable throwable)
Report that an execution error has occurred. This method is called by the specified manager.- Specified by:
executionError
in interfaceExecutionListener
- Parameters:
manager
- The manager calling this method.throwable
- The throwable being reported.
-
executionFinished
public void executionFinished(Manager manager)
Report that execution of the model has finished.- Specified by:
executionFinished
in interfaceExecutionListener
- Parameters:
manager
- The manager calling this method.
-
managerStateChanged
public void managerStateChanged(Manager manager)
Report that a manager state has changed. This method is called by the specified manager.- Specified by:
managerStateChanged
in interfaceExecutionListener
- Parameters:
manager
- The manager calling this method.- See Also:
Manager.getState()
-
_addHotKeys
protected void _addHotKeys(JGraph jgraph)
Add hot keys to the actions in the given JGraph.- Overrides:
_addHotKeys
in classBasicGraphController
- Parameters:
jgraph
- The JGraph to which hot keys are to be added.
-
_getManager
protected Manager _getManager() throws IllegalActionException
Get the manager for the top-level of the associated model, if there is one, or create one if there is not.- Returns:
- The manager.
- Throws:
IllegalActionException
- If the associated model is not a CompositeActor, or if the manager cannot be created.
-
_report
protected void _report(java.lang.String message)
If there is an associated BasicGraphFrame, use it to report a message. Otherwise, report to standard output.- Parameters:
message
- The message.
-
_report
protected void _report(java.lang.Throwable error)
If there is an associated BasicGraphFrame, use it to report an error. Otherwise, report to standard error.- Parameters:
error
- The throwable.
-
-