org.argouml.cognitive
Class ToDoList

java.lang.Object
  |
  +--java.util.Observable
        |
        +--org.argouml.cognitive.ToDoList
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class ToDoList
extends java.util.Observable
implements java.lang.Runnable, java.io.Serializable

Implements a list of ToDoItem's. If desired it can also spawn a "sweeper" thread that periodically goes through the list and elimiates ToDoItem's that are no longer valid.

One difficulty designers face is keeping track of all the myrid details of thier task. It is all to easy to skip a step in the design process, leave part of the design unspecified, of make a mistake that requires revision. Argo provides the designer with a "to do" list user interface that presents action items in an organized form. These items can be suggestions from critics, reminders to finish steps in the process model, or personal notes entered by the designer. The choice control at the top of the "to do" list pane allow the designer to organize items in different ways: by priority, by decision supported, by offending design element, etc.

The to do lists right now are a bit unstable. Please test and let us know what you find through Issuezilla. Items are shown under all applicable headings. The "to do" list may also be viewed as a flat list.

See Also:
ToDoList, Designer.nondisruptivelyWarn(org.argouml.cognitive.ToDoItem), Serialized Form

Field Summary
protected  Designer _designer
          The designer, used in determining if a ToDoItem is still valid.
protected  java.util.Vector _items
          Pending ToDoItems for the designer to consider.
protected  javax.swing.event.EventListenerList _listenerList
           
static int _longestToDoList
           
static int _numNotValid
           
protected static java.lang.Object _RecentOffender
           
protected static java.util.Vector _RecentOffenderItems
           
protected  java.util.Vector _resolvedItems
          ToDoItems that the designer has explicitly indicated that (s)he considers resolved.
protected  java.lang.Thread _validityChecker
          A Thread that keeps checking if the items on the list are still valid.
protected static org.apache.log4j.Category cat
           
 
Constructor Summary
ToDoList()
           
 
Method Summary
 void addAll(ToDoList list)
           
 void addElement(ToDoItem item)
           
 void addToDoListListener(ToDoListListener l)
           
 ToDoItem elementAt(int index)
           
 java.util.Enumeration elements()
           
 java.util.Vector elementsForOffender(java.lang.Object off)
           
 boolean explicitlyResolve(ToDoItem item, java.lang.String reason)
           
protected  void fireToDoItemAdded(ToDoItem item)
           
protected  void fireToDoItemChanged(ToDoItem item)
           
protected  void fireToDoItemRemoved(ToDoItem item)
           
protected  void fireToDoItemsAdded(java.util.Vector items)
           
protected  void fireToDoItemsRemoved(java.util.Vector items)
           
protected  void fireToDoListChanged()
           
 void forceValidityCheck()
           
protected  void forceValidityCheck(java.util.Vector removes)
          Check each ToDoItem on the list to see if it is still valid.
 java.util.Vector getDecisions()
           
 java.util.Vector getGoals()
           
 org.tigris.gef.util.VectorSet getOffenders()
           
 org.tigris.gef.util.VectorSet getPosters()
           
 java.util.Vector getResolvedItems()
           
 java.util.Vector getToDoItems()
           
 void notifyObservers()
           
 void notifyObservers(java.lang.Object o)
           
 void notifyObservers(java.lang.String action, java.lang.Object arg)
           
protected  void recomputeAllOffenders()
           
protected  void recomputeAllPosters()
           
 void removeAll(ToDoList list)
           
 void removeAllElements()
           
 boolean removeElement(ToDoItem item)
           
 void removeToDoListListener(ToDoListListener l)
           
 boolean resolve(ToDoItem item)
           
 void run()
          Periodically check to see if items on the list are still valid.
 int size()
           
 void spawnValidityChecker(Designer d)
          Start a Thread to delete old items from the ToDoList.
 java.lang.String toString()
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cat

protected static org.apache.log4j.Category cat

_items

protected java.util.Vector _items
Pending ToDoItems for the designer to consider.

_resolvedItems

protected java.util.Vector _resolvedItems
ToDoItems that the designer has explicitly indicated that (s)he considers resolved. TODO: generalize into a design rationale logging facility.

_validityChecker

protected java.lang.Thread _validityChecker
A Thread that keeps checking if the items on the list are still valid.

_designer

protected Designer _designer
The designer, used in determining if a ToDoItem is still valid.

_listenerList

protected javax.swing.event.EventListenerList _listenerList

_longestToDoList

public static int _longestToDoList

_numNotValid

public static int _numNotValid

_RecentOffender

protected static java.lang.Object _RecentOffender

_RecentOffenderItems

protected static java.util.Vector _RecentOffenderItems
Constructor Detail

ToDoList

public ToDoList()
Method Detail

spawnValidityChecker

public void spawnValidityChecker(Designer d)
Start a Thread to delete old items from the ToDoList.

run

public void run()
Periodically check to see if items on the list are still valid.
Specified by:
run in interface java.lang.Runnable

forceValidityCheck

public void forceValidityCheck()

forceValidityCheck

protected void forceValidityCheck(java.util.Vector removes)
Check each ToDoItem on the list to see if it is still valid. If not, then remove that item. This is called automatically by the ValidityCheckingThread, and it can be called by the user pressing a button via forceValidityCheck().

Warning: Fragile code! No method that this method calls can synchronized the Designer, otherwise there will be deadlock.


notifyObservers

public void notifyObservers(java.lang.String action,
                            java.lang.Object arg)

notifyObservers

public void notifyObservers(java.lang.Object o)
Overrides:
notifyObservers in class java.util.Observable

notifyObservers

public void notifyObservers()
Overrides:
notifyObservers in class java.util.Observable

getToDoItems

public java.util.Vector getToDoItems()

getResolvedItems

public java.util.Vector getResolvedItems()

getOffenders

public org.tigris.gef.util.VectorSet getOffenders()
Returns:
the set of offenders

getPosters

public org.tigris.gef.util.VectorSet getPosters()
Returns:
the set of all the posters

getDecisions

public java.util.Vector getDecisions()

getGoals

public java.util.Vector getGoals()

addElement

public void addElement(ToDoItem item)

addAll

public void addAll(ToDoList list)

removeAll

public void removeAll(ToDoList list)

removeElement

public boolean removeElement(ToDoItem item)

resolve

public boolean resolve(ToDoItem item)

explicitlyResolve

public boolean explicitlyResolve(ToDoItem item,
                                 java.lang.String reason)
                          throws UnresolvableException

removeAllElements

public void removeAllElements()

elementsForOffender

public java.util.Vector elementsForOffender(java.lang.Object off)

size

public int size()

elements

public java.util.Enumeration elements()

elementAt

public ToDoItem elementAt(int index)

recomputeAllOffenders

protected void recomputeAllOffenders()

recomputeAllPosters

protected void recomputeAllPosters()

addToDoListListener

public void addToDoListListener(ToDoListListener l)

removeToDoListListener

public void removeToDoListListener(ToDoListListener l)

fireToDoListChanged

protected void fireToDoListChanged()

fireToDoItemChanged

protected void fireToDoItemChanged(ToDoItem item)

fireToDoItemAdded

protected void fireToDoItemAdded(ToDoItem item)

fireToDoItemsAdded

protected void fireToDoItemsAdded(java.util.Vector items)

fireToDoItemRemoved

protected void fireToDoItemRemoved(ToDoItem item)

fireToDoItemsRemoved

protected void fireToDoItemsRemoved(java.util.Vector items)

toString

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


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook