Package ptolemy.vergil.actor
Class IOPortController
- java.lang.Object
-
- All Implemented Interfaces:
NodeController
- Direct Known Subclasses:
MatchResultViewer.MatchResultPortController
,TransformationEditor.TransformationPortController
public class IOPortController extends AttributeController
This class provides interaction with nodes that represent Ptolemy II ports on an actor. 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
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Red (eal)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
IOPortController.EntityPortRenderer
Render the ports of components as triangles.-
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 static double
MULTIPORT_CONNECTION_SPACING
The spacing between individual connections to a multiport.-
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 IOPortController(GraphController controller)
Create a port controller associated with the specified graph controller.IOPortController(GraphController controller, AttributeController.Access access)
Create a port controller associated with the specified graph controller.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static int
_getCardinality(Port port)
Deprecated.Use public getCardinality() method insteadprotected java.lang.String
_getComponentType()
Get the class label of the component.protected static int
_getDirection(int portRotation)
Deprecated.Use public getDirection() method insteadprotected java.lang.String
_moveToFirstDescription()
The text used in the MoveAction.TO_FIRST action menu choice.protected java.lang.String
_moveToLastDescription()
The text used in the MoveAction.TO_LAST action menu choice.static int
getCardinality(Port port)
Return one of {-270, -180, -90, 0, 90, 180, 270} specifying the orientation of a port.static int
getDirection(int portRotation)
Return the direction associated with the specified angle, which is assumed to be one of {-270, -180, -90, 0, 90, 180, 270}.-
Methods inherited from class ptolemy.vergil.kernel.AttributeController
addHotKeys, renderDecoratorHighlight, renderHighlight, setConfiguration
-
Methods inherited from class ptolemy.vergil.basic.ParameterizedNodeController
getConfigureMenuFactory
-
Methods inherited from class ptolemy.vergil.basic.LocatableNodeController
_drawChildren, _getCompositeFigure, _hide, _isPropertySet, _renderNode, addNode, drawNode, getLocation, hasLocation, locateFigure, setLocation, setSnapResolution
-
Methods inherited from class diva.graph.BasicNodeController
addNode, addNode, addNode, clearNode, drawNode, getController, getNodeInteractor, getNodeRenderer, removeNode, setNodeInteractor, setNodeRenderer
-
-
-
-
Field Detail
-
MULTIPORT_CONNECTION_SPACING
public static final double MULTIPORT_CONNECTION_SPACING
The spacing between individual connections to a multiport.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IOPortController
public IOPortController(GraphController controller)
Create a port controller associated with the specified graph controller. The controller is given full access.- Parameters:
controller
- The associated graph controller.
-
IOPortController
public IOPortController(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
-
getCardinality
public static int getCardinality(Port port)
Return one of {-270, -180, -90, 0, 90, 180, 270} specifying the orientation of a port. This depends on whether the port is an input, output, or both, whether the port has a parameter named "_cardinal" that specifies a cardinality, and whether the containing actor has a parameter named "_rotatePorts" that specifies a rotation of the ports. In addition, if the containing actor has a parameter named "_flipPortsHorizontal" or "_flipPortsVertical" with value true, then any ports that end up on the left or right (top or bottom) will be reversed.- Parameters:
port
- The port.- Returns:
- One of {-270, -180, -90, 0, 90, 180, 270}.
-
getDirection
public static int getDirection(int portRotation)
Return the direction associated with the specified angle, which is assumed to be one of {-270, -180, -90, 0, 90, 180, 270}.- Parameters:
portRotation
- The angle- Returns:
- One of SwingUtilities.NORTH, SwingUtilities.EAST, SwingUtilities.SOUTH, or SwingUtilities.WEST.
-
_getCardinality
@Deprecated protected static int _getCardinality(Port port)
Deprecated.Use public getCardinality() method insteadReturn one of {-270, -180, -90, 0, 90, 180, 270} specifying the orientation of a port. This depends on whether the port is an input, output, or both, whether the port has a parameter named "_cardinal" that specifies a cardinality, and whether the containing actor has a parameter named "_rotatePorts" that specifies a rotation of the ports. In addition, if the containing actor has a parameter named "_flipPortsHorizontal" or "_flipPortsVertical" with value true, then any ports that end up on the left or right (top or bottom) will be reversed.- Parameters:
port
- The port.- Returns:
- One of {-270, -180, -90, 0, 90, 180, 270}.
- See Also:
getCardinality(Port)
-
_getComponentType
protected java.lang.String _getComponentType()
Get the class label of the component.- Overrides:
_getComponentType
in classAttributeController
- Returns:
- the class label of the component.
-
_getDirection
@Deprecated protected static int _getDirection(int portRotation)
Deprecated.Use public getDirection() method insteadReturn the direction associated with the specified angle, which is assumed to be one of {-270, -180, -90, 0, 90, 180, 270}.- Parameters:
portRotation
- The angle- Returns:
- One of SwingUtilities.NORTH, SwingUtilities.EAST, SwingUtilities.SOUTH, or SwingUtilities.WEST.
- See Also:
getDirection(int)
-
_moveToFirstDescription
protected java.lang.String _moveToFirstDescription()
The text used in the MoveAction.TO_FIRST action menu choice.- Overrides:
_moveToFirstDescription
in classAttributeController
- Returns:
- the text.
-
_moveToLastDescription
protected java.lang.String _moveToLastDescription()
The text used in the MoveAction.TO_LAST action menu choice.- Overrides:
_moveToLastDescription
in classAttributeController
- Returns:
- the text.
-
-