templates.diagram.actions
Class DiagramUndoableEdits.SetControllabilityEdit

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by templates.diagram.actions.AbstractDiagramUndoableEdit
          extended by templates.diagram.actions.DiagramUndoableEdits.SetControllabilityEdit
All Implemented Interfaces:
java.io.Serializable, javax.swing.undo.UndoableEdit
Enclosing class:
DiagramUndoableEdits

public static class DiagramUndoableEdits.SetControllabilityEdit
extends AbstractDiagramUndoableEdit

Edit which does and undoes setting the controllability of a DESEvent in the FSAModel.

Author:
Lenko Grigorov
See Also:
Serialized Form

Field Summary
protected  long eventID
          The id of the DESEvent whose controllability has to be set.
protected  ides.api.model.fsa.FSAModel model
          The FSAModel which contains the DESEvent whose controllability should be set.
protected  boolean newControllable
          The new controllability setting of the event.
protected  boolean oldControllable
          The old controllability setting of the event.
 
Fields inherited from class templates.diagram.actions.AbstractDiagramUndoableEdit
usePluralDescription
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
DiagramUndoableEdits.SetControllabilityEdit(ides.api.model.fsa.FSAModel model, long eventID, boolean isControllable)
          Constructs an edit with the given parameters.
 
Method Summary
 boolean canRedo()
           
 boolean canUndo()
           
 java.lang.String getPresentationName()
          Returns the name that should be displayed besides the Undo/Redo menu items, so the user knows which action will be undone/redone.
 void redo()
          Has to be called once after the instantiation of the edit, in order to enact it.
 void undo()
           
 
Methods inherited from class templates.diagram.actions.AbstractDiagramUndoableEdit
setLastOfMultiple
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

model

protected ides.api.model.fsa.FSAModel model
The FSAModel which contains the DESEvent whose controllability should be set.


eventID

protected long eventID
The id of the DESEvent whose controllability has to be set.


newControllable

protected boolean newControllable
The new controllability setting of the event.


oldControllable

protected boolean oldControllable
The old controllability setting of the event.

Constructor Detail

DiagramUndoableEdits.SetControllabilityEdit

public DiagramUndoableEdits.SetControllabilityEdit(ides.api.model.fsa.FSAModel model,
                                                   long eventID,
                                                   boolean isControllable)
Constructs an edit with the given parameters.

Parameters:
model - the FSAModel which contains the DESEvent whose controllability should be set
eventID - the id of the DESEvent whose controllability has to be set
isControllable - the new controllability setting for the event (if true, the event will become controllable; if false the event will become uncontrollable)
Method Detail

redo

public void redo()
          throws javax.swing.undo.CannotRedoException
Has to be called once after the instantiation of the edit, in order to enact it.

Specified by:
redo in interface javax.swing.undo.UndoableEdit
Overrides:
redo in class javax.swing.undo.AbstractUndoableEdit
Throws:
javax.swing.undo.CannotRedoException

undo

public void undo()
          throws javax.swing.undo.CannotUndoException
Specified by:
undo in interface javax.swing.undo.UndoableEdit
Overrides:
undo in class javax.swing.undo.AbstractUndoableEdit
Throws:
javax.swing.undo.CannotUndoException

canUndo

public boolean canUndo()
Specified by:
canUndo in interface javax.swing.undo.UndoableEdit
Overrides:
canUndo in class javax.swing.undo.AbstractUndoableEdit

canRedo

public boolean canRedo()
Specified by:
canRedo in interface javax.swing.undo.UndoableEdit
Overrides:
canRedo in class javax.swing.undo.AbstractUndoableEdit

getPresentationName

public java.lang.String getPresentationName()
Returns the name that should be displayed besides the Undo/Redo menu items, so the user knows which action will be undone/redone.

Specified by:
getPresentationName in interface javax.swing.undo.UndoableEdit
Overrides:
getPresentationName in class javax.swing.undo.AbstractUndoableEdit