Package ptolemy.vergil.actor
Class ActorViewerGraphController
- java.lang.Object
-
- diva.graph.AbstractGraphController
-
- ptolemy.vergil.basic.BasicGraphController
-
- ptolemy.vergil.basic.WithIconGraphController
-
- ptolemy.vergil.basic.RunnableGraphController
-
- ptolemy.vergil.actor.ActorViewerGraphController
-
- All Implemented Interfaces:
GraphController
,ExecutionListener
,DebugListener
,ValueListener
- Direct Known Subclasses:
ActorEditorGraphController
public class ActorViewerGraphController extends RunnableGraphController
A graph controller for the Ptolemy II schematic viewer. This controller contains a set of default node controllers for attributes, entities, links, ports, and relations. Those default controllers can be overridden by attributes of type NodeControllerFactory. The getNodeController() method determines which controller to return for each node.In addition, this controller provides graph-wide operations that allow nodes to be moved and context menus to be created. It does not provide interaction for adding or removing nodes; those are provided by a derived class. If does provide toolbar buttons for executing the model (or if this is not the top level, delegating to the top level to execute). Right-clicking on the background will create a context-sensitive menu for the graph.
- Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Steve Neuendorffer, Contributor: Edward A. Lee
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Red (eal)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ActorViewerGraphController.EntityLayout
This layout algorithm is responsible for laying out the ports within an entity.-
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 Modifier and Type Field Description protected ActorController
_addonActorController
The controller for actors with addon gui behavior.protected NamedObjController
_attributeController
The attribute controller.protected ActorController
_classDefinitionController
The class definition controller.protected ActorController
_entityController
The entity controller.protected NamedObjController
_entityPortController
The entity port controller.protected LinkController
_linkController
The link controller.protected NamedObjController
_relationController
The relation controller.-
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 ActorViewerGraphController()
Create a new basic controller with default terminal and edge interactors and default context menus.
-
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 void
_createControllers()
Create the controllers for nodes in this graph.void
event(DebugEvent event)
React to an event by highlighting the actor being iterated.EdgeController
getEdgeController(java.lang.Object edge)
Return the edge controller appropriate for the given node, which in this case is the same link controller returned by getLinkController().ActorController
getEntityController()
Return the value of the entity controller.NodeController
getNodeController(java.lang.Object object)
Return the node controller appropriate for the given object.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, _report, _report, addToMenuAndToolbar, executionError, executionFinished, managerStateChanged
-
Methods inherited from class ptolemy.vergil.basic.WithIconGraphController
getNewPortLocation
-
Methods inherited from class ptolemy.vergil.basic.BasicGraphController
_areThereActiveErrorHighlights, _getClearAllErrorHighlightsChangeRequest, _initializeInteraction, clearAllErrorHighlights, clearAnimation, getAnimationDelay, getConfiguration, getConfigureMenuFactory, getFrame, 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, getFigure, getGraphModel, getGraphPane, getSelectionModel, removeEdge, removeGraphViewListener, removeNode, rerender, rerenderEdge, rerenderNode, setGraphModel, setGraphPane, setSelectionModel
-
-
-
-
Field Detail
-
_attributeController
protected NamedObjController _attributeController
The attribute controller.
-
_classDefinitionController
protected ActorController _classDefinitionController
The class definition controller.
-
_addonActorController
protected ActorController _addonActorController
The controller for actors with addon gui behavior.
-
_entityController
protected ActorController _entityController
The entity controller.
-
_entityPortController
protected NamedObjController _entityPortController
The entity port controller.
-
_linkController
protected LinkController _linkController
The link controller.
-
_relationController
protected NamedObjController _relationController
The relation controller.
-
-
Method Detail
-
event
public void event(DebugEvent event)
React to an event by highlighting the actor being iterated. This effectively animates the execution.- Specified by:
event
in interfaceDebugListener
- Overrides:
event
in classBasicGraphController
- Parameters:
event
- The debug event.
-
getEdgeController
public EdgeController getEdgeController(java.lang.Object edge)
Return the edge controller appropriate for the given node, which in this case is the same link controller returned by getLinkController().- Specified by:
getEdgeController
in interfaceGraphController
- Specified by:
getEdgeController
in classAbstractGraphController
- Parameters:
edge
- The edge object.- Returns:
- the edge controller.
-
getEntityController
public ActorController getEntityController()
Return the value of the entity controller. Callers may add context menus by callinggetEntityController.addMenuItemFactory(new XXXDialogFactory);
- Returns:
- the entity controller
-
getNodeController
public NodeController getNodeController(java.lang.Object object)
Return the node controller appropriate for the given object. If the object is an instance of Vertex, then return the local relation controller. If it implements Locatable, then determine whether it is an Entity, Attribute, or Port, and return the appropriate default controller. If the argument is an instance of Port, then return the local port controller.- Specified by:
getNodeController
in interfaceGraphController
- Overrides:
getNodeController
in classBasicGraphController
- Parameters:
object
- A Vertex, Locatable, or Port.- Returns:
- the node controller
-
setConfiguration
public void setConfiguration(Configuration configuration)
Set the configuration. The configuration is used when opening documentation files.- Overrides:
setConfiguration
in classWithIconGraphController
- 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 classRunnableGraphController
- 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 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 classWithIconGraphController
-
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 classWithIconGraphController
-
-