|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.jhu.tmaj.beans.masks.color.ActionList<E>
public final class ActionList<E>
Represents a data structure of ACTIONS that the user might want to undo or redo. A user of this class uses the addAction(myAction) to add actions to this class. The getActionsList() will return a list of added actions to the user. Users may call the undo() and redo() methods at will. Each time undo() is called, the actionsList returned to the user is shrunk by one. Each time redo() is called, the actionsList returned to the uesr is increased by one (Of course, a redo() has no effect unless a undo() has been done.) Remember there are 2 list of actions: One that this class keeps track of, and one that is returned to the users of this class. The actions-list returned to users of this class will only be a subset of the one in this class. The actions-list returned to user is dependant on how many redos and undos were made.
Constructor Summary | |
---|---|
ActionList()
|
Method Summary | |
---|---|
void |
addAction(E e)
Adds a ACTION (like a selected pixel) to this class. |
void |
clear()
|
java.util.List<E> |
getActionsList()
|
static void |
main(java.lang.String[] args)
Tests this class. |
boolean |
redo()
Indicate a redo action; if undo() was previously called, this will put the action item that was undone back on the stack, so that when the user calls getActionList(), the item will be there. |
java.lang.String |
toString()
|
boolean |
undo()
Indicate an undo action, so that the next time the user calls getActionList(), the last action will be left off. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ActionList()
Method Detail |
---|
public void addAction(E e)
public boolean undo()
public boolean redo()
public void clear()
public java.util.List<E> getActionsList()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |