Package ptolemy.vergil.basic
Class WithIconGraphController
- java.lang.Object
-
- diva.graph.AbstractGraphController
-
- ptolemy.vergil.basic.BasicGraphController
-
- ptolemy.vergil.basic.WithIconGraphController
-
- All Implemented Interfaces:
GraphController
,DebugListener
,ValueListener
- Direct Known Subclasses:
OntologyGraphController
,OntologySolverGraphController
,RunnableGraphController
public abstract class WithIconGraphController extends BasicGraphController
A base class for Ptolemy II graph controllers for objects that can have icons. This adds to the base class the context menu items "Edit Custom Icon" and "Remove Custom Icon". This also adds a port controller.- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Red (eal)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
WithIconGraphController.NewPortAction
An action to create a new port.-
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 static EditIconAction
_editIconAction
The edit custom icon action.protected NamedObjController
_portController
The port controller.protected static RemoveIconAction
_removeIconAction
The remove custom icon action.-
Fields inherited from class ptolemy.vergil.basic.BasicGraphController
_animated, _animationRenderer, _configureAction, _configureMenuFactory, _menuCreator, _menuFactory, _openBaseClassAction, _unitSolverDialogAction
-
-
Constructor Summary
Constructors Constructor Description WithIconGraphController()
Create a new controller.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_createControllers()
Create the controllers for nodes in this graph.static double[]
getNewPortLocation(GraphPane pane, BasicGraphFrame frame, IOPort _prototype)
Get a location for a port that hasn't got a location yet.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, addToMenuAndToolbar, clearAllErrorHighlights, clearAnimation, event, getAnimationDelay, getConfiguration, getConfigureMenuFactory, getFrame, getNodeController, 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, getEdgeController, getFigure, getGraphModel, getGraphPane, getSelectionModel, removeEdge, removeGraphViewListener, removeNode, rerender, rerenderEdge, rerenderNode, setGraphModel, setGraphPane, setSelectionModel
-
-
-
-
Field Detail
-
_editIconAction
protected static final EditIconAction _editIconAction
The edit custom icon action.
-
_portController
protected NamedObjController _portController
The port controller.
-
_removeIconAction
protected static final RemoveIconAction _removeIconAction
The remove custom icon action.
-
-
Method Detail
-
getNewPortLocation
public static double[] getNewPortLocation(GraphPane pane, BasicGraphFrame frame, IOPort _prototype)
Get a location for a port that hasn't got a location yet.- Parameters:
pane
- The GraphPane.frame
- The BasicGraphFrame._prototype
- The port.- Returns:
- The location.
-
setConfiguration
public void setConfiguration(Configuration configuration)
Set the configuration. This is used by some of the controllers when opening files or URLs.- Overrides:
setConfiguration
in classBasicGraphController
- Parameters:
configuration
- The configuration.- See Also:
BasicGraphController.getConfiguration()
-
_createControllers
protected void _createControllers()
Create the controllers for nodes in this graph. In this base class, a port controller with PARTIAL access is 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 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. Regrettably, the canvas is not yet associated with the GraphPane, so you can't do any initialization that involves the canvas.- Overrides:
initializeInteraction
in classBasicGraphController
-
-