|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.algosome.common.undoable.ChangeManager
public class ChangeManager
Manages a Queue of Changables to perform undo and/or redo operations. Clients can add implementations of the Changeable class to this class, and it will manage undo/redo as a Queue.
Constructor Summary | |
---|---|
ChangeManager()
Creates a new ChangeManager object which is initially empty. |
|
ChangeManager(ChangeManager manager)
Creates a new ChangeManager which is a duplicate of the parameter in both contents and current index. |
Method Summary | |
---|---|
void |
addChangeable(Changeable changeable)
Adds a Changeable to manage. |
void |
addListener(ChangeManagerListener l)
|
void |
backtrackTo(Changeable changeable)
Backtracks to the parameter changeable, or the start if the parameter does not exists in this list (changeable and elements in the list are compared by the equals method) |
boolean |
canRedo()
Determines if a redo can be performed. |
boolean |
canUndo()
Determines if an undo can be performed. |
void |
clear()
Clears all Changables contained in this manager. |
void |
forwardTo(Changeable changeable)
Fastforwards to the parameter changeable, or the end if the parameter does not exists in this list (changeable and elements in the list are compared by the equals method) |
java.util.List<ChangeManagerListener> |
getListeners()
|
ChangeManagerModel |
getModel()
|
void |
redo()
Redoes the Changable at the current index. |
void |
removeListener(ChangeManagerListener l)
|
static void |
setMaxSize(int size)
Sets the max size for this. |
java.lang.String |
toString()
|
void |
undo()
Undoes the Changeable at the current index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChangeManager()
public ChangeManager(ChangeManager manager)
manager
- Method Detail |
---|
public java.util.List<ChangeManagerListener> getListeners()
public static void setMaxSize(int size)
size
- The max size, or -1 for unlimited.public void clear()
public void addChangeable(Changeable changeable)
changeable
- public boolean canUndo()
canUndo
in interface ChangeCando
public boolean canRedo()
canRedo
in interface ChangeCando
public void undo()
undo
in interface Changeable
java.lang.IllegalStateException
- if canUndo returns false.public void backtrackTo(Changeable changeable)
changeable
- public void forwardTo(Changeable changeable)
changeable
- public void redo()
redo
in interface Changeable
java.lang.IllegalStateException
- if canRedo returns false.public void addListener(ChangeManagerListener l)
l
- public void removeListener(ChangeManagerListener l)
l
- public java.lang.String toString()
toString
in class java.lang.Object
public ChangeManagerModel getModel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |