Package ptolemy.vergil.actor
Class ExternalIOPortController
- java.lang.Object
-
- All Implemented Interfaces:
NodeController
- Direct Known Subclasses:
MatchResultViewer.MatchResultExternalPortController
,TransformationEditor.TransformationExternalPortController
public class ExternalIOPortController extends AttributeController
This class provides interaction with nodes that represent Ptolemy II ports inside a composite. It provides a double click binding and context menu entry to edit the parameters of the port ("Configure") and a command to get documentation. It can have one of two access levels, FULL or PARTIAL. If the access level is FULL, the the context menu also contains a command to rename the node. Note that whether the port is an input or output or multiport cannot be controlled via this interface. The "Configure Ports" command of the container should be invoked instead.- Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Steve Neuendorffer and Edward A. Lee, Elaine Cheong
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Red (eal)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ExternalIOPortController.PortRenderer
Render the external ports of a graph as a 5-sided tab thingy.-
Nested classes/interfaces inherited from class ptolemy.vergil.kernel.AttributeController
AttributeController.Access
-
Nested classes/interfaces inherited from class ptolemy.vergil.basic.IconController
IconController.IconRenderer
-
-
Field Summary
Fields Modifier and Type Field Description protected EditIconAction
_editIconAction
The action that handles edit custom icon.static IOPort
_GENERIC_INOUT
Prototype inout port.static IOPort
_GENERIC_INOUT_MULTIPORT
Prototype inout multiport.static IOPort
_GENERIC_INPUT
Prototype input port.static IOPort
_GENERIC_INPUT_MULTIPORT
Prototype input multiport.static IOPort
_GENERIC_OUTPUT
Prototype output port.static IOPort
_GENERIC_OUTPUT_MULTIPORT
Prototype output multiport.protected static java.awt.Font
_labelFont
The font used to label a port.protected RemoveIconAction
_removeIconAction
The action that handles removing a custom icon.static java.lang.Integer[]
IOPORT_COORDINATES
Polygon coordinates for input output port.static java.lang.Integer[]
IPORT_COORDINATES
Polygon coordinates for input port.static java.lang.Integer[]
MULTI_IOPORT_COORDINATES
Polygon coordinates for input multiport.static java.lang.Integer[]
MULTI_IPORT_COORDINATES
Polygon coordinates for input output multiport.static java.lang.Integer[]
MULTI_OPORT_COORDINATES
Polygon coordinates for output multiport.static java.lang.Integer[]
OPORT_COORDINATES
Polygon coordinates for output port.-
Fields inherited from class ptolemy.vergil.kernel.AttributeController
_appearanceMenuActionFactory, _listenToAction, _renameAction, FULL, PARTIAL
-
Fields inherited from class ptolemy.vergil.basic.ParameterizedNodeController
_configureAction, _configureMenuFactory, _menuCreator, _menuFactory
-
Fields inherited from class ptolemy.vergil.basic.NamedObjController
_configuration
-
Fields inherited from class ptolemy.vergil.basic.LocatableNodeController
_decoratable, CLASS_ELEMENT_HIGHLIGHT_COLOR
-
-
Constructor Summary
Constructors Constructor Description ExternalIOPortController(GraphController controller)
Create a port controller associated with the specified graph controller.ExternalIOPortController(GraphController controller, AttributeController.Access access)
Create a port controller associated with the specified graph controller.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
_hide(java.lang.Object node)
Override the base class to return true if the specified node contains an attribute named "_hideInside".protected java.lang.String
_portTooltip(Port port)
Given a port, return a reasonable tooltip message for that port.void
locateFigure(java.lang.Object node)
Move the node's figure to the location specified in the node's semantic object, if that object is an instance of Locatable.void
setConfiguration(Configuration configuration)
Set the configuration.-
Methods inherited from class ptolemy.vergil.kernel.AttributeController
_getComponentType, _moveToFirstDescription, _moveToLastDescription, addHotKeys, renderDecoratorHighlight, renderHighlight
-
Methods inherited from class ptolemy.vergil.basic.ParameterizedNodeController
getConfigureMenuFactory
-
Methods inherited from class ptolemy.vergil.basic.LocatableNodeController
_drawChildren, _getCompositeFigure, _isPropertySet, _renderNode, addNode, drawNode, getLocation, hasLocation, setLocation, setSnapResolution
-
Methods inherited from class diva.graph.BasicNodeController
addNode, addNode, addNode, clearNode, drawNode, getController, getNodeInteractor, getNodeRenderer, removeNode, setNodeInteractor, setNodeRenderer
-
-
-
-
Field Detail
-
_GENERIC_INPUT
public static final IOPort _GENERIC_INPUT
Prototype input port.
-
_GENERIC_OUTPUT
public static final IOPort _GENERIC_OUTPUT
Prototype output port.
-
_GENERIC_INOUT
public static final IOPort _GENERIC_INOUT
Prototype inout port.
-
_GENERIC_INPUT_MULTIPORT
public static final IOPort _GENERIC_INPUT_MULTIPORT
Prototype input multiport.
-
_GENERIC_OUTPUT_MULTIPORT
public static final IOPort _GENERIC_OUTPUT_MULTIPORT
Prototype output multiport.
-
_GENERIC_INOUT_MULTIPORT
public static final IOPort _GENERIC_INOUT_MULTIPORT
Prototype inout multiport.
-
IOPORT_COORDINATES
public static java.lang.Integer[] IOPORT_COORDINATES
Polygon coordinates for input output port.
-
IPORT_COORDINATES
public static java.lang.Integer[] IPORT_COORDINATES
Polygon coordinates for input port.
-
OPORT_COORDINATES
public static java.lang.Integer[] OPORT_COORDINATES
Polygon coordinates for output port.
-
MULTI_IPORT_COORDINATES
public static java.lang.Integer[] MULTI_IPORT_COORDINATES
Polygon coordinates for input output multiport.
-
MULTI_OPORT_COORDINATES
public static java.lang.Integer[] MULTI_OPORT_COORDINATES
Polygon coordinates for output multiport.
-
MULTI_IOPORT_COORDINATES
public static java.lang.Integer[] MULTI_IOPORT_COORDINATES
Polygon coordinates for input multiport.
-
_editIconAction
protected EditIconAction _editIconAction
The action that handles edit custom icon.
-
_labelFont
protected static java.awt.Font _labelFont
The font used to label a port.
-
_removeIconAction
protected RemoveIconAction _removeIconAction
The action that handles removing a custom icon.
-
-
Constructor Detail
-
ExternalIOPortController
public ExternalIOPortController(GraphController controller)
Create a port controller associated with the specified graph controller. The controller is given full access.- Parameters:
controller
- The associated graph controller.
-
ExternalIOPortController
public ExternalIOPortController(GraphController controller, AttributeController.Access access)
Create a port controller associated with the specified graph controller.- Parameters:
controller
- The associated graph controller.access
- The access level.
-
-
Method Detail
-
locateFigure
public void locateFigure(java.lang.Object node)
Move the node's figure to the location specified in the node's semantic object, if that object is an instance of Locatable. If the semantic object is not a location, then do nothing. If the figure associated with the semantic object is an instance of TerminalFigure, then modify the location to ensure that the connect site snaps to grid.- Overrides:
locateFigure
in classLocatableNodeController
- Parameters:
node
- The object to locate.
-
setConfiguration
public void setConfiguration(Configuration configuration)
Set the configuration. This is used in derived classes to to open files (such as documentation). The configuration is is important because it keeps track of which files are already open and ensures that there is only one editor operating on the file at any one time.- Overrides:
setConfiguration
in classAttributeController
- Parameters:
configuration
- The configuration.
-
_hide
protected boolean _hide(java.lang.Object node)
Override the base class to return true if the specified node contains an attribute named "_hideInside". This ensures that ports can be hidden on the outside while still being visible on the outside.- Overrides:
_hide
in classLocatableNodeController
- Parameters:
node
- The node- Returns:
- true if the specified node should be hidden.
-
_portTooltip
protected java.lang.String _portTooltip(Port port)
Given a port, return a reasonable tooltip message for that port.- Parameters:
port
- The port.- Returns:
- The name, type, and whether it's a multiport.
-
-