kaapo.projectmanager.command
Class AbstractUndoableEdit
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
kaapo.projectmanager.command.AbstractUndoableEdit
- All Implemented Interfaces:
- Serializable, UndoableEdit
- Direct Known Subclasses:
- AddConnectionEdit, AddElementEdit, ChangeDiagramNameEdit, ChangeProjectNameEdit, ModifyDComponentAttributeEdit, MoveConnectionPointEdit, MoveDComponentEdit, MoveDiagramDownEdit, MoveDiagramUpEdit, NewDiagramEdit, RemoveDComponentEdit, RemoveDiagramEdit, ResizeElementEdit
public abstract class AbstractUndoableEdit
- extends AbstractUndoableEdit
Abstract class that all the Edits extend.
- Author:
- hprajani
- See Also:
- Serialized Form
pm
protected ProjectManager pm
visibleDiagram
protected DiagramWrapper visibleDiagram
AbstractUndoableEdit
public AbstractUndoableEdit()
execute
public abstract void execute(ProjectManager pm)
throws EditFailedException
- Executes the created Edit inside the given environment.
- Parameters:
pm
- the enviroment where the Edit is executed in.
- Throws:
EditFailedException
- if the edit fails for some reason
changeCorrectVisibleDiagram
protected void changeCorrectVisibleDiagram(ProjectManager pm,
DiagramWrapper visibleDiagram)
- Changes the visible diagram into the correct given one if the current visible one is
something else. This is mainly used when undoing or redoing stuff.
- Parameters:
pm
- the environment where the Edit's view is executed in. (This is done because
if we use the field this.pm there can be a NullPointerException)visibleDiagram
- the latest visibleDiagram
canUndo
public boolean canUndo()
- Specified by:
canUndo
in interface UndoableEdit
- Overrides:
canUndo
in class AbstractUndoableEdit
- See Also:
UndoableEdit.canUndo()
canRedo
public boolean canRedo()
- Specified by:
canRedo
in interface UndoableEdit
- Overrides:
canRedo
in class AbstractUndoableEdit
- See Also:
UndoableEdit.canRedo()