ptolemy.vergil.basic
Class RunnableGraphController

java.lang.Object
  extended bydiva.graph.AbstractGraphController
      extended byptolemy.vergil.basic.BasicGraphController
          extended byptolemy.vergil.basic.WithIconGraphController
              extended byptolemy.vergil.basic.RunnableGraphController
All Implemented Interfaces:
DebugListener, ExecutionListener, GraphController, 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: RunnableGraphController.java,v 1.14.2.1 2004/06/18 00:49:29 cxh Exp $
Author:
Edward A. Lee
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Nested Class Summary
 
Nested classes inherited from class ptolemy.vergil.basic.WithIconGraphController
WithIconGraphController.NewPortAction
 
Nested classes 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, _menuCreator, _menuFactory, _openBaseClassAction, _unitSolverDialogAction
 
Constructor Summary
RunnableGraphController()
          Create a new controller.
 
Method Summary
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.
 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, initializeInteraction, setConfiguration
 
Methods inherited from class ptolemy.vergil.basic.BasicGraphController
_initializeInteraction, clearAnimation, event, getAnimationDelay, getConfiguration, 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
 

Constructor Detail

RunnableGraphController

public RunnableGraphController()
Create a new controller.

Method Detail

addToMenuAndToolbar

public void addToMenuAndToolbar(javax.swing.JMenu menu,
                                javax.swing.JToolBar toolbar)
Add execution commands to the toolbar.

Overrides:
addToMenuAndToolbar in class BasicGraphController
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 interface ExecutionListener
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 interface ExecutionListener
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 interface ExecutionListener
Parameters:
manager - The manager calling this method.
See Also:
Manager.getState()

_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.