ptolemy.vergil.actor
Class ActorEditorGraphController

java.lang.Object
  extended by diva.graph.AbstractGraphController
      extended by ptolemy.vergil.basic.BasicGraphController
          extended by ptolemy.vergil.basic.WithIconGraphController
              extended by ptolemy.vergil.basic.RunnableGraphController
                  extended by ptolemy.vergil.actor.ActorViewerGraphController
                      extended by ptolemy.vergil.actor.ActorEditorGraphController
All Implemented Interfaces:
GraphController, ExecutionListener, DebugListener, ValueListener
Direct Known Subclasses:
CaseGraphFrame.CaseGraphController, CaseGraphFrame.CaseGraphController, MatchResultViewer.MatchResultActorGraphController, TransformationEditor.TransformationActorGraphController

public class ActorEditorGraphController
extends ActorViewerGraphController

A Graph Controller for the Ptolemy II schematic editor. In addition to the interaction allowed in the viewer, this controller allows nodes to be dragged and dropped onto its graph. Relations can be created by control-clicking on the background. Links can be created by control-clicking and dragging on a port or a relation. In addition links can be created by clicking and dragging on the ports that are inside an entity. Anything can be deleted by selecting it and pressing the delete key on the keyboard.

Since:
Ptolemy II 2.0
Version:
$Id: ActorEditorGraphController.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Steve Neuendorffer, Contributor: Edward A. Lee, Bert Rodiers
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Nested Class Summary
protected  class ActorEditorGraphController.LinkCreator
          This class is an interactor that interactively drags edges from one terminal to another, creating a link to connect them.
private  class ActorEditorGraphController.ListenToActorFactory
           
 class ActorEditorGraphController.NewRelationAction
          An action to create a new relation.
protected  class ActorEditorGraphController.RelationCreator
          An interactor for creating relations upon control clicking.
 
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  ConfigureUnitsAction _configureUnitsAction
           
private  ActorEditorGraphController.LinkCreator _linkCreator
          The interactors that interactively creates edges.
private  ActorEditorGraphController.ListenToActorFactory _listenToActorFactory
          Factory for listen to actor menu item.
private  javax.swing.Action _newInoutMultiportAction
          Action for creating a new inout multiport.
private  javax.swing.Action _newInoutPortAction
          Action for creating a new input/output port.
private  javax.swing.Action _newInputMultiportAction
          Action for creating a new input multiport.
private  javax.swing.Action _newInputPortAction
          Action for creating a new input port.
private  javax.swing.Action _newOutputMultiportAction
          Action for creating a new output multiport.
private  javax.swing.Action _newOutputPortAction
          Action for creating a new output port.
protected  javax.swing.Action _newRelationAction
          Action for creating a new relation.
private  PortDialogAction _portDialogAction
          The port dialog factory.
private  ActorEditorGraphController.RelationCreator _relationCreator
          The interactor for creating new relations.
private  MouseFilter _shortcutFilter
          The filter for shortcut operations.
 
Fields inherited from class ptolemy.vergil.actor.ActorViewerGraphController
_attributeController, _classDefinitionController, _entityController, _entityPortController, _linkController, _relationController
 
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
ActorEditorGraphController()
          Create a new basic controller with default terminal and edge interactors.
 
Method Summary
protected  void _addHotKeys(JGraph jgraph)
          Add hot keys to the actions in the given JGraph.
protected  void _createControllers()
          Create the controllers for nodes in this graph.
protected  void _initializeInteraction(NamedObjController controller)
          Initialize interactions for the specified controller.
 void addToMenuAndToolbar(javax.swing.JMenu menu, javax.swing.JToolBar toolbar)
          Add commands to the specified menu and toolbar, as appropriate for this controller.
protected  void initializeInteraction()
          Initialize all interaction on the graph pane.
 void setConfiguration(Configuration configuration)
          Set the configuration.
 
Methods inherited from class ptolemy.vergil.actor.ActorViewerGraphController
event, getEdgeController, getEntityController, getNodeController
 
Methods inherited from class ptolemy.vergil.basic.RunnableGraphController
_getManager, executionError, executionFinished, managerStateChanged
 
Methods inherited from class ptolemy.vergil.basic.WithIconGraphController
getNewPortLocation
 
Methods inherited from class ptolemy.vergil.basic.BasicGraphController
clearAnimation, getAnimationDelay, getConfiguration, getConfigureMenuFactory, 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

_newRelationAction

protected javax.swing.Action _newRelationAction
Action for creating a new relation.


_configureUnitsAction

private ConfigureUnitsAction _configureUnitsAction

_linkCreator

private ActorEditorGraphController.LinkCreator _linkCreator
The interactors that interactively creates edges.


_listenToActorFactory

private ActorEditorGraphController.ListenToActorFactory _listenToActorFactory
Factory for listen to actor menu item.


_newInoutMultiportAction

private javax.swing.Action _newInoutMultiportAction
Action for creating a new inout multiport.


_newInoutPortAction

private javax.swing.Action _newInoutPortAction
Action for creating a new input/output port.


_newInputMultiportAction

private javax.swing.Action _newInputMultiportAction
Action for creating a new input multiport.


_newInputPortAction

private javax.swing.Action _newInputPortAction
Action for creating a new input port.


_newOutputMultiportAction

private javax.swing.Action _newOutputMultiportAction
Action for creating a new output multiport.


_newOutputPortAction

private javax.swing.Action _newOutputPortAction
Action for creating a new output port.


_portDialogAction

private PortDialogAction _portDialogAction
The port dialog factory.


_relationCreator

private ActorEditorGraphController.RelationCreator _relationCreator
The interactor for creating new relations.


_shortcutFilter

private MouseFilter _shortcutFilter
The filter for shortcut operations. This is used for creation of relations and creation of links from relations. Under PC, this is a control-1 click. Under Mac OS X, the control key is used for context menus and this corresponds to the command-1 click. For details, see the Apple java archive http://lists.apple.com/archives/java-dev User: archives, passwd: archives

Constructor Detail

ActorEditorGraphController

public ActorEditorGraphController()
Create a new basic controller with default terminal and edge interactors.

Method Detail

addToMenuAndToolbar

public void addToMenuAndToolbar(javax.swing.JMenu menu,
                                javax.swing.JToolBar toolbar)
Add commands to the specified menu and toolbar, as appropriate for this controller. In this class, commands are added to create ports and relations.

Overrides:
addToMenuAndToolbar in class RunnableGraphController
Parameters:
menu - The menu to add to, or null if none.
toolbar - The toolbar to add to, or null if none.

setConfiguration

public void setConfiguration(Configuration configuration)
Set the configuration. The configuration is used when opening documentation files.

Overrides:
setConfiguration in class ActorViewerGraphController
Parameters:
configuration - The configuration.
See Also:
BasicGraphController.getConfiguration()

_addHotKeys

protected void _addHotKeys(JGraph jgraph)
Add hot keys to the actions in the given JGraph.

Overrides:
_addHotKeys in class ActorViewerGraphController
Parameters:
jgraph - The JGraph to which hot keys are to be added.

_createControllers

protected void _createControllers()
Create the controllers for nodes in this graph. In this class, controllers with FULL 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 ActorViewerGraphController

_initializeInteraction

protected void _initializeInteraction(NamedObjController controller)
Initialize interactions for the specified controller. This method is called when a new controller is constructed. In this class, this method attaches a link creator to the controller if the controller is an instance of ExternalIOPortController, IOPortController, or RelationController.

Overrides:
_initializeInteraction in class BasicGraphController
Parameters:
controller - The controller for which to initialize interaction.

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 ActorViewerGraphController