kaapo.projectmanager.command
Class ModifyDComponentAttributeEdit
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
kaapo.projectmanager.command.AbstractUndoableEdit
kaapo.projectmanager.command.ModifyDComponentAttributeEdit
- All Implemented Interfaces:
- Serializable, UndoableEdit
public class ModifyDComponentAttributeEdit
- extends AbstractUndoableEdit
Changes the value of the specified attribute in the (first) selected diagram
component when executed.
- Author:
- hprajani, iheikkin, paltamaa
- See Also:
- Serialized Form
ModifyDComponentAttributeEdit
public ModifyDComponentAttributeEdit(String attributeName,
Object newValue)
- Constructs a new
ModifyDComponentAttributeEdit
based on
given attribute-object and attribute-key String.
- Parameters:
attributeName
- The name of the attributenewValue
- The new value for the attribute
ModifyDComponentAttributeEdit
public ModifyDComponentAttributeEdit(DiagramComponent dc,
String attributeName,
Object newValue)
- Constructs a new
ModifyDComponentAttributeEdit
based on
given DiagramComponent
, attribute-object, and
attribute-key.
- Parameters:
dc
- The DiagramComponent to editattributeName
- The name of the attributenewValue
- The new value for the attribute
execute
public void execute(ProjectManager pm)
throws EditFailedException
- Stores the original attribute and sets the new one.
- Specified by:
execute
in class AbstractUndoableEdit
- Parameters:
pm
- the enviroment where the Edit is executed in.
- Throws:
EditFailedException
- See Also:
AbstractUndoableEdit.execute(ProjectManager)
redo
public void redo()
throws CannotRedoException
- Specified by:
redo
in interface UndoableEdit
- Overrides:
redo
in class AbstractUndoableEdit
- Throws:
CannotRedoException
- See Also:
AbstractUndoableEdit.redo()
undo
public void undo()
throws CannotUndoException
- Specified by:
undo
in interface UndoableEdit
- Overrides:
undo
in class AbstractUndoableEdit
- Throws:
CannotUndoException
- See Also:
AbstractUndoableEdit.undo()
canRedo
public boolean canRedo()
- Specified by:
canRedo
in interface UndoableEdit
- Overrides:
canRedo
in class AbstractUndoableEdit
- See Also:
AbstractUndoableEdit.canRedo()
canUndo
public boolean canUndo()
- Specified by:
canUndo
in interface UndoableEdit
- Overrides:
canUndo
in class AbstractUndoableEdit
- See Also:
AbstractUndoableEdit.canUndo()