ILcdUndoable
and TLcdUndoManager
.public class TLcdUndoHistory extends Object
ILcdUndoable
that can perform undo/redo
operations. It keeps a list of Objects that represents a sequence of actions done by an
ILcdUndoable
. Each Object
is supposed to contains the information the
ILcdUndoable
needs to keep in order to perform an undo or redo. The call of
undo(ILcdFunction)
, respectively redo(ILcdFunction)
, will retrieve the
corresponding Object
and apply on it the given ILcdFunction
. This
ILcdFunction
has to be given by the ILcdUndobale
and shall effectively
performs the undo, respectively redo, action. This class keep track of the number of undo and
redo left.ILcdUndoable
,
TLcdUndoManager
,
TLcdUndoAction
,
TLcdRedoAction
Constructor and Description |
---|
TLcdUndoHistory()
Deprecated.
Construct an empty
TLcdUndoHistory . |
Modifier and Type | Method and Description |
---|---|
void |
addElement(Object aObject)
Deprecated.
Appends to this list an
Object supposed to stored the information corresponding to
an action done by an ILcdUndoable and that may need undo/redo. |
void |
addPropertyChangeListener(PropertyChangeListener aListener)
Deprecated.
Adds a
PropertyChangeListener to the listener list. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Deprecated.
|
int |
getRedoLeft()
Deprecated.
Returns the number of redo operations that can still be performed.
|
int |
getUndoLeft()
Deprecated.
Returns the number of undo operations that can still be performed.
|
void |
redo(ILcdFunction aRedoFunction)
Deprecated.
Performs a redo by retrieving the corresponding
Object , and applying the given
ILcdFunction . |
void |
removeAllElements()
Deprecated.
Removes all the Objects supposed to stored the information required by an
ILcdUndoable to perform undo and redo operations. |
void |
removePropertyChangeListener(PropertyChangeListener aListener)
Deprecated.
Removes a
PropertyChangeListener from the listener list. |
void |
undo(ILcdFunction aUndoFunction)
Deprecated.
Performs an undo by retrieving the corresponding
Object , and applying the given
ILcdFunction . |
public TLcdUndoHistory()
TLcdUndoHistory
.public int getUndoLeft()
public int getRedoLeft()
public void addElement(Object aObject)
Object
supposed to stored the information corresponding to
an action done by an ILcdUndoable
and that may need undo/redo. This
Object
can be used later by this ILcdUndoable
in order to perform the
undo or redo operation.public void removeAllElements()
ILcdUndoable
to perform undo and redo operations.public void undo(ILcdFunction aUndoFunction)
Object
, and applying the given
ILcdFunction
. It decrements the number of remaining undo.public void redo(ILcdFunction aRedoFunction)
Object
, and applying the given
ILcdFunction
. It decrements the number of remaining redo.protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
public void addPropertyChangeListener(PropertyChangeListener aListener)
PropertyChangeListener
to the listener list. The listener is registered for
all properties.aListener
- the PropertyChangeListener
to be added.public void removePropertyChangeListener(PropertyChangeListener aListener)
PropertyChangeListener
from the listener list. This removes a
PropertyChangeListener
that was registered for all properties.aListener
- the PropertyChangeListener
to be removed.