edu.jhu.tmaj.beans.masks.color
Class ActionList<E>

java.lang.Object
  extended by edu.jhu.tmaj.beans.masks.color.ActionList<E>

public final class ActionList<E>
extends java.lang.Object

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

ActionList

public ActionList()
Method Detail

addAction

public void addAction(E e)
Adds a ACTION (like a selected pixel) to this class.


undo

public boolean undo()
Indicate an undo action, so that the next time the user calls getActionList(), the last action will be left off.


redo

public 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.

Returns:

clear

public void clear()

getActionsList

public java.util.List<E> getActionsList()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
Tests this class.