Package ptolemy.vergil.icon
Class EditIconGraphController
- java.lang.Object
-
- diva.graph.AbstractGraphController
-
- ptolemy.vergil.basic.BasicGraphController
-
- ptolemy.vergil.icon.EditIconGraphController
-
- All Implemented Interfaces:
GraphController
,DebugListener
,ValueListener
public class EditIconGraphController extends BasicGraphController
A graph controller for the Ptolemy II icon editor. This controller contains a set of default node controllers for attributes, which are the only objects that an icon editor can contain. The default controller can be overridden by attributes of type NodeControllerFactory. The getNodeController() method always returns an attribute controller.- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Yellow (eal)
-
-
Nested Class Summary
-
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 NamedObjController
_attributeController
The attribute controller.-
Fields inherited from class ptolemy.vergil.basic.BasicGraphController
_animated, _animationRenderer, _configureAction, _configureMenuFactory, _menuCreator, _menuFactory, _openBaseClassAction, _unitSolverDialogAction
-
-
Constructor Summary
Constructors Constructor Description EditIconGraphController()
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
_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.EdgeController
getEdgeController(java.lang.Object edge)
Throw an exception.NodeController
getNodeController(java.lang.Object object)
Return the node controller appropriate for the specified 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.BasicGraphController
_addHotKeys, _areThereActiveErrorHighlights, _getClearAllErrorHighlightsChangeRequest, _initializeInteraction, clearAllErrorHighlights, clearAnimation, event, 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.
-
-
Method Detail
-
addToMenuAndToolbar
public void addToMenuAndToolbar(javax.swing.JMenu menu, javax.swing.JToolBar toolbar)
Add hot key for look inside.- Overrides:
addToMenuAndToolbar
in classBasicGraphController
- Parameters:
menu
- The menu to add to, which is ignored.toolbar
- The toolbar to add to, which is also ignored.
-
getEdgeController
public EdgeController getEdgeController(java.lang.Object edge)
Throw an exception. This should not be called.- Specified by:
getEdgeController
in interfaceGraphController
- Specified by:
getEdgeController
in classAbstractGraphController
- Parameters:
edge
- The edge object.- Returns:
- An exception.
- Throws:
InternalErrorException
- If this is called.
-
getNodeController
public NodeController getNodeController(java.lang.Object object)
Return the node controller appropriate for the specified object. If the specified object is an instance of Locatable and its container contains a NodeControllerFactory (which is an attribute), then invoke that factory to create a node controller. Otherwise, if the object implements Locatable and is contained by an instance of Attribute, then return the attribute controller. Otherwise, throw a runtime exception.- Specified by:
getNodeController
in interfaceGraphController
- Overrides:
getNodeController
in classBasicGraphController
- Parameters:
object
- A Vertex, Locatable, or Port.- Returns:
- object The node controller.
- Throws:
java.lang.RuntimeException
- If the specified object is not a Locatable contained by an Attribute.
-
setConfiguration
public void setConfiguration(Configuration configuration)
Set the configuration. The configuration is used when opening documentation files, for example.- Overrides:
setConfiguration
in classBasicGraphController
- Parameters:
configuration
- The configuration.- See Also:
BasicGraphController.getConfiguration()
-
_createControllers
protected void _createControllers()
Create the controllers for nodes in this graph. 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 classBasicGraphController
-
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 classBasicGraphController
-
-