ptolemy.vergil.kernel
Class AttributeController

java.lang.Object
  extended by diva.graph.BasicNodeController
      extended by ptolemy.vergil.basic.LocatableNodeController
          extended by ptolemy.vergil.basic.NamedObjController
              extended by ptolemy.vergil.basic.ParameterizedNodeController
                  extended by ptolemy.vergil.basic.IconController
                      extended by ptolemy.vergil.kernel.AttributeController
All Implemented Interfaces:
NodeController
Direct Known Subclasses:
ActorController, ExternalIOPortController, IOPortController, ResizableAttributeControllerFactory.ResizeAttributeController, StateController, StateController, 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: AttributeController.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Steve Neuendorffer and Edward A. Lee
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Nested Class Summary
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
protected  MenuActionFactory _appearanceMenuActionFactory
          The appearance menu factory.
private  GetDocumentationAction _getDocumentationAction
          The "get documentation" action.
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
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
protected  java.lang.String _getComponentType()
          Get the class label of the component.
 void addHotKeys(JGraph jgraph)
          Add hot keys to the actions in the given JGraph.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


_renameAction

protected RenameDialogAction _renameAction
Action to launch rename dialog.


_listenToAction

protected ListenToAction _listenToAction
Action to listen to debug messages.


_getDocumentationAction

private GetDocumentationAction _getDocumentationAction
The "get documentation" action.

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 class NamedObjController
Parameters:
jgraph - The JGraph to which hot keys are to be added.

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 class NamedObjController
Parameters:
configuration - The configuration.

_getComponentType

protected java.lang.String _getComponentType()
Get the class label of the component.

Returns:
the class label of the component.