ptolemy.vergil.fsm
Class FSMViewerGraphController

java.lang.Object
  extended bydiva.graph.AbstractGraphController
      extended byptolemy.vergil.basic.BasicGraphController
          extended byptolemy.vergil.basic.WithIconGraphController
              extended byptolemy.vergil.basic.RunnableGraphController
                  extended byptolemy.vergil.fsm.FSMViewerGraphController
All Implemented Interfaces:
DebugListener, ExecutionListener, GraphController, ValueListener
Direct Known Subclasses:
FSMGraphController

public class FSMViewerGraphController
extends RunnableGraphController

A graph controller for the Ptolemy II finite-state machine viewer. This controller allows states to be moved and context menus to be accessed, but does not provide interaction for adding or removing states or transitions.

Since:
Ptolemy II 2.0
Version:
$Id: FSMViewerGraphController.java,v 1.27 2004/04/13 05:13:04 cxh Exp $
Author:
Steve Neuendorffer, Contributor: 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
protected  NamedObjController _attributeController
          The attribute controller.
protected  ModalTransitionController _modalTransitionController
          The modal transition controller.
protected  StateController _stateController
          The state controller.
protected  TransitionController _transitionController
          The transition controller.
 
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
FSMViewerGraphController()
          Create a new controller with default port, state, and transition controllers.
 
Method Summary
protected  void _createControllers()
          Create the controllers for nodes in this graph.
 void addToMenuAndToolbar(javax.swing.JMenu menu, javax.swing.JToolBar toolbar)
          Add hot key for look inside.
 void event(DebugEvent event)
          React to an event by highlighting the new state.
 EdgeController getEdgeController(java.lang.Object edge)
          Return the edge controller appropriate for the given node.
 NodeController getNodeController(java.lang.Object object)
          Return the node controller appropriate for the given node.
protected  void initializeInteraction()
          Initialize all interaction on the graph pane.
 void setConfiguration(Configuration configuration)
          Set the configuration.
 
Methods inherited from class ptolemy.vergil.basic.RunnableGraphController
_getManager, executionError, executionFinished, managerStateChanged
 
Methods inherited from class ptolemy.vergil.basic.BasicGraphController
_initializeInteraction, clearAnimation, getAnimationDelay, getConfiguration, getFrame, 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, 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

_attributeController

protected NamedObjController _attributeController
The attribute controller.


_stateController

protected StateController _stateController
The state controller.


_transitionController

protected TransitionController _transitionController
The transition controller.


_modalTransitionController

protected ModalTransitionController _modalTransitionController
The modal transition controller.

Constructor Detail

FSMViewerGraphController

public FSMViewerGraphController()
Create a new controller with default port, state, and transition controllers.

Method Detail

addToMenuAndToolbar

public void addToMenuAndToolbar(javax.swing.JMenu menu,
                                javax.swing.JToolBar toolbar)
Add hot key for look inside.

Overrides:
addToMenuAndToolbar in class RunnableGraphController
Parameters:
menu - The menu to add to, which is ignored.
toolbar - The toolbar to add to, which is also ignored.

event

public void event(DebugEvent event)
React to an event by highlighting the new state.

Specified by:
event in interface DebugListener
Overrides:
event in class BasicGraphController
Parameters:
event - The debug event.

getNodeController

public NodeController getNodeController(java.lang.Object object)
Return the node controller appropriate for the given node.

Specified by:
getNodeController in interface GraphController
Overrides:
getNodeController in class BasicGraphController
Parameters:
object - The object to get a controller for.
Returns:
A custom node controller if there is one, and null otherwise.

getEdgeController

public EdgeController getEdgeController(java.lang.Object edge)
Return the edge controller appropriate for the given node.

Specified by:
getEdgeController in interface GraphController
Specified by:
getEdgeController in class AbstractGraphController

setConfiguration

public void setConfiguration(Configuration configuration)
Set the configuration. This is may be used by derived controllers to open files or URLs.

Overrides:
setConfiguration in class WithIconGraphController
Parameters:
configuration - The configuration.

_createControllers

protected void _createControllers()
Create the controllers for nodes in this graph. In this base class, controllers with PARTIAL access are created. This is called by the constructor, so derived classes that override this must be careful not to reference local variables defined in the derived classes, because the derived classes will not have been fully constructed by the time this is called.

Overrides:
_createControllers in class WithIconGraphController

initializeInteraction

protected void initializeInteraction()
Initialize all interaction on the graph pane. This method is called by the setGraphPane() method of the superclass. This initialization cannot be done in the constructor because the controller does not yet have a reference to its pane at that time.

Overrides:
initializeInteraction in class WithIconGraphController