ptolemy.vergil.toolbox
Class RotateOrFlipPorts

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ptolemy.vergil.toolbox.FigureAction
          extended by ptolemy.vergil.toolbox.RotateOrFlipPorts
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class RotateOrFlipPorts
extends FigureAction

Action to rotate or flip ports. What exactly gets done depends on the constructor arguments.

Since:
Ptolemy II 5.2
Version:
$Id: RotateOrFlipPorts.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Edward A. Lee
See Also:
Serialized Form
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.vergil.toolbox.FigureAction
FigureAction.SourceType
 
Field Summary
private  int _direction
          The direction requested in the constructor.
static int CLOCKWISE
          Indicator to rotate clockwise.
static int COUNTERCLOCKWISE
          Indicator to rotate counterclockwise.
static int FLIP_HORIZONTAL
          Indicator to flip ports horizonally.
static int FLIP_VERTICAL
          Indicator to flip ports vertically.
 
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
RotateOrFlipPorts(int direction, java.lang.String label)
          Create an action to rotate the ports.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Process the rotate command.
 
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
 

Field Detail

CLOCKWISE

public static final int CLOCKWISE
Indicator to rotate clockwise.

See Also:
Constant Field Values

COUNTERCLOCKWISE

public static final int COUNTERCLOCKWISE
Indicator to rotate counterclockwise.

See Also:
Constant Field Values

FLIP_HORIZONTAL

public static final int FLIP_HORIZONTAL
Indicator to flip ports horizonally.

See Also:
Constant Field Values

FLIP_VERTICAL

public static final int FLIP_VERTICAL
Indicator to flip ports vertically.

See Also:
Constant Field Values

_direction

private int _direction
The direction requested in the constructor.

Constructor Detail

RotateOrFlipPorts

public RotateOrFlipPorts(int direction,
                         java.lang.String label)
Create an action to rotate the ports.

Parameters:
direction - One of CLOCKWISE, COUNTERCLOCKWISE, FLIP_HORIZONTAL, or FLIP_VERTICAL.
label - The label to put in the menu.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Process the rotate command.

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