templates.diagram.actions
Class DiagramActions.ShiftDiagramInViewAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by templates.diagram.actions.DiagramActions.ShiftDiagramInViewAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Enclosing class:
DiagramActions

public static class DiagramActions.ShiftDiagramInViewAction
extends javax.swing.AbstractAction

Action which translates a TemplateDiagram so that the diagram is in view (all elements have positive co-ordinates).

This action is not a sublass of AbstractDiagramAction since some methods of the abstract class depend on the functionality of this action.

Author:
Lenko Grigorov
See Also:
Serialized Form

Field Summary
protected  TemplateDiagram diagram
          The TemplateDiagram to be translated.
protected  javax.swing.undo.CompoundEdit parentEdit
          If this action is not independent, the UndoableEdit the action is part of.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields 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
DiagramActions.ShiftDiagramInViewAction(javax.swing.undo.CompoundEdit parentEdit, TemplateDiagram diagram)
          Construct an action for the given parameters.
DiagramActions.ShiftDiagramInViewAction(TemplateDiagram diagram)
          Construct an action for the given parameters.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
 void execute()
          Perform the action.
 
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

parentEdit

protected javax.swing.undo.CompoundEdit parentEdit
If this action is not independent, the UndoableEdit the action is part of. null if this action is independent.


diagram

protected TemplateDiagram diagram
The TemplateDiagram to be translated.

Constructor Detail

DiagramActions.ShiftDiagramInViewAction

public DiagramActions.ShiftDiagramInViewAction(TemplateDiagram diagram)
Construct an action for the given parameters.

Parameters:
diagram - the TemplateDiagram to be translated

DiagramActions.ShiftDiagramInViewAction

public DiagramActions.ShiftDiagramInViewAction(javax.swing.undo.CompoundEdit parentEdit,
                                               TemplateDiagram diagram)
Construct an action for the given parameters.

Parameters:
parentEdit - the UndoableEdit to which this action should add its own undo information
diagram - the TemplateDiagram to be translated
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)

execute

public void execute()
Perform the action.