kaapo.projectmanager.command
Class NewDiagramEdit
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
kaapo.projectmanager.command.AbstractUndoableEdit
kaapo.projectmanager.command.NewDiagramEdit
- All Implemented Interfaces:
- Serializable, UndoableEdit
public class NewDiagramEdit
- extends AbstractUndoableEdit
This Edit adds a new Diagram
to a
Project
.
- Author:
- hprajani, paltamaa
- See Also:
- Serialized Form
NewDiagramEdit
public NewDiagramEdit(Class diagram,
String name)
- When executed, adds a new diagram after the visible diagram. If no
diagram is selected, new diagram is added to after last diagram in
current project.
- Parameters:
diagram
- the class of the new diagramname
- the name of the new diagram
NewDiagramEdit
public NewDiagramEdit(Class diagram,
String name,
DiagramWrapper parent,
DiagramWrapper prevSibling)
- constrcuts the edit with knowledge in the Project's Diagram hierarchy.
- Parameters:
diagram
- the class of the new diagramname
- the name of the new diagramparent
- the parent diagram in the project diagram hieararchyprevSibling
- the previous sibling in project diagram hierarchy
execute
public void execute(ProjectManager pm)
- Adds the new Diagram to the Project.
- Specified by:
execute
in class AbstractUndoableEdit
- Parameters:
pm
- the enviroment where the Edit is executed in.- See Also:
Edit.execute(ProjectManager)
undo
public void undo()
- Specified by:
undo
in interface UndoableEdit
- Overrides:
undo
in class AbstractUndoableEdit
- See Also:
UndoableEdit.undo()
redo
public void redo()
- Specified by:
redo
in interface UndoableEdit
- Overrides:
redo
in class AbstractUndoableEdit
- See Also:
UndoableEdit.redo()
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()