ptolemy.vergil.actor
Class ActorEditorGraphController.NewRelationAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ptolemy.vergil.toolbox.FigureAction
          extended by ptolemy.vergil.actor.ActorEditorGraphController.NewRelationAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
TransformationEditor.TransformationActorGraphController.NewRelationAction
Enclosing class:
ActorEditorGraphController

public class ActorEditorGraphController.NewRelationAction
extends FigureAction

An action to create a new relation.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.vergil.toolbox.FigureAction
FigureAction.SourceType
 
Field Summary
 
Fields inherited from class ptolemy.vergil.toolbox.FigureAction
CANVAS_TYPE, CONTEXTMENU_TYPE, HOTKEY_TYPE, MENUBAR_TYPE, PASTE_OFFSET, TOOLBAR_TYPE
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ActorEditorGraphController.NewRelationAction()
          Create an action that creates a new relation.
ActorEditorGraphController.NewRelationAction(java.lang.String[][] iconRoles)
          Create an action that creates a new relation.
 
Method Summary
protected  double[] _offsetVertex(double[] point)
          Offset a figure if another figure is already at that location.
 void actionPerformed(java.awt.event.ActionEvent e)
          Determine the target Ptolemy II object, the originating frame, and the X, Y position of the action, if possible.
 
Methods inherited from class ptolemy.vergil.toolbox.FigureAction
getFigure, getFrame, getSourceType, getTarget, getX, getY, offsetFigure
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActorEditorGraphController.NewRelationAction

public ActorEditorGraphController.NewRelationAction()
Create an action that creates a new relation.


ActorEditorGraphController.NewRelationAction

public ActorEditorGraphController.NewRelationAction(java.lang.String[][] iconRoles)
Create an action that creates a new relation.

Parameters:
iconRoles - A matrix of Strings, where each element consists of two Strings, the absolute URL of the icon and the key that represents the role of the icon. The keys are usually static fields from this class, such as GUIUtilities.LARGE_ICON, GUIUtilities.ROLLOVER_ICON, GUIUtilities.ROLLOVER_SELECTED_ICON or GUIUtilities.SELECTED_ICON. If this parameter is null, then the icon comes from the calling getNodeRenderer() on the WithIconGraphController._portController.
See Also:
GUIUtilities.addIcons(Action, String[][])
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Description copied from class: FigureAction
Determine the target Ptolemy II object, the originating frame, and the X, Y position of the action, if possible. After this is invoked, the other public methods can be used to access this data.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class FigureAction
Parameters:
e - The event.

_offsetVertex

protected double[] _offsetVertex(double[] point)
Offset a figure if another figure is already at that location.

Parameters:
point - An array of two doubles (x and y)
Returns:
An array of two doubles (x and y) that represents either the original location or an offset location that does not obscure an object of class figure.