Package ptolemy.vergil.kernel
Class AttributeController
- java.lang.Object
-
- All Implemented Interfaces:
NodeController
- Direct Known Subclasses:
ActorController
,AttributeWithIconController
,ChicController
,ExternalIOPortController
,IOPortController
,MoMLModelAttributeController
,ResizableAttributeControllerFactory.ResizeAttributeController
,TransformationAttributeController
public class AttributeController extends IconController
This class provides interaction with nodes that represent Ptolemy II attributes. It provides a double click binding and context menu entry to edit the parameters of the node ("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.- 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 protected static class
AttributeController.Access
A static enumerator for constructor arguments.-
Nested classes/interfaces inherited from class ptolemy.vergil.basic.IconController
IconController.IconRenderer
-
-
Field Summary
Fields Modifier and Type Field Description protected MenuActionFactory
_appearanceMenuActionFactory
The appearance menu factory.protected ListenToAction
_listenToAction
Action to listen to debug messages.protected RenameDialogAction
_renameAction
Action to launch rename dialog.static AttributeController.Access
FULL
Indicator to give full access to the attribute.static AttributeController.Access
PARTIAL
Indicator to give partial access to the attribute.-
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 AttributeController(GraphController controller)
Create an attribute controller associated with the specified graph controller.AttributeController(GraphController controller, AttributeController.Access access)
Create an attribute controller associated with the specified graph controller.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
_getComponentType()
Get the class label of the component.protected 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.void
addHotKeys(JGraph jgraph)
Add hot keys to the actions in the given JGraph.static void
renderDecoratorHighlight(NamedObj namedObj, Figure figure)
Render the value of the _highlightColor parameter.static void
renderHighlight(NamedObj namedObj, Figure figure)
Render the value of the _highlightColor parameter.void
setConfiguration(Configuration configuration)
Set the configuration.-
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
-
FULL
public static final AttributeController.Access FULL
Indicator to give full access to the attribute.
-
PARTIAL
public static final AttributeController.Access PARTIAL
Indicator to give partial access to the attribute.
-
_appearanceMenuActionFactory
protected MenuActionFactory _appearanceMenuActionFactory
The appearance menu factory.
-
_listenToAction
protected ListenToAction _listenToAction
Action to listen to debug messages.
-
_renameAction
protected RenameDialogAction _renameAction
Action to launch rename dialog.
-
-
Constructor Detail
-
AttributeController
public AttributeController(GraphController controller)
Create an attribute controller associated with the specified graph controller. The attribute controller is given full access.- Parameters:
controller
- The associated graph controller.
-
AttributeController
public AttributeController(GraphController controller, AttributeController.Access access)
Create an attribute controller associated with the specified graph controller.- Parameters:
controller
- The associated graph controller.access
- The access level.
-
-
Method Detail
-
addHotKeys
public void addHotKeys(JGraph jgraph)
Add hot keys to the actions in the given JGraph. It would be better that this method was added higher in the hierarchy. Now most controllers- Overrides:
addHotKeys
in classNamedObjController
- Parameters:
jgraph
- The JGraph to which hot keys are to be added.
-
renderHighlight
public static void renderHighlight(NamedObj namedObj, Figure figure)
Render the value of the _highlightColor parameter.- Parameters:
namedObj
- The NamedObj that contains the _highlightColor parameter.figure
- the Diva figure that is rendered.
-
renderDecoratorHighlight
public static void renderDecoratorHighlight(NamedObj namedObj, Figure figure)
Render the value of the _highlightColor parameter.- Parameters:
namedObj
- The NamedObj that contains the _highlightColor parameter.figure
- the Diva figure that is rendered.
-
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 classNamedObjController
- Parameters:
configuration
- The configuration.
-
_getComponentType
protected java.lang.String _getComponentType()
Get the class label of the component.- Returns:
- the class label of the component.
-
_moveToFirstDescription
protected java.lang.String _moveToFirstDescription()
The text used in the MoveAction.TO_FIRST action menu choice. Derived classes like IOPortController change this.- Returns:
- the text.
-
_moveToLastDescription
protected java.lang.String _moveToLastDescription()
The text used in the MoveAction.TO_LAST action menu choice. Derived classes like IOPortController change this.- Returns:
- the text.
-
-