Class MoveNodeAction
java.lang.Object
javax.swing.AbstractAction
ca.phon.opgraph.app.commands.HookableCommand
ca.phon.app.opgraph.editor.actions.OpgraphEditorAction
ca.phon.app.opgraph.editor.actions.graph.MoveNodeAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
ConstructorsConstructorDescriptionMoveNodeAction(OpgraphEditor editor, int deltaX, int deltaY) Constructs a move command that moves the current node selection in the given graph canvas, with this edit posted in the given undo manager. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageIcongetIcon(int xDelta, int yDelta) static KeyStrokegetMoveKeystroke(int xDelta, int yDelta) Get a keystroke for the given deltas.static StringgetMoveString(int xDelta, int yDelta) Get a textual representation of the given deltas.voidMethods inherited from class ca.phon.app.opgraph.editor.actions.OpgraphEditorAction
getEditorMethods inherited from class ca.phon.opgraph.app.commands.HookableCommand
actionPerformedMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
MoveNodeAction
Constructs a move command that moves the current node selection in the given graph canvas, with this edit posted in the given undo manager.- Parameters:
deltaX- the x-axis deltadeltaY- the y-axis delta
-
-
Method Details
-
getMoveString
Get a textual representation of the given deltas. More specifically:- if Δx == 0 and Δy > 0, "Up"
- if Δx == 0 and Δy invalid input: '<' 0, "Down"
- if Δy == 0 and Δx > 0, "Right"
- if Δy == 0 and Δx invalid input: '<' 0, "Left"
- otherwise, ""
- Parameters:
xDelta- the x-axis deltayDelta- the y-axis delta- Returns:
- a textual representation that best represents the action of the specified deltas
-
getIcon
-
getMoveKeystroke
Get a keystroke for the given deltas. More specifically:- if Δx == 0 and Δy > 0, "Up"
- if Δx == 0 and Δy invalid input: '<' 0, "Down"
- if Δy == 0 and Δx > 0, "Right"
- if Δy == 0 and Δx invalid input: '<' 0, "Left"
- otherwise,
null
- Parameters:
xDelta- the x-axis deltayDelta- the y-axis delta- Returns:
- a keystroke for the specified deltas
-
hookableActionPerformed
- Specified by:
hookableActionPerformedin classca.phon.opgraph.app.commands.HookableCommand
-