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.

It spawns 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.

This class is dependent on Designer.

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

Field Summary
private  VectorSet _allOffenders
          These are computed when needed.
private  VectorSet _allPosters
          These are computed when needed.
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
          needs documenting
static int _longestToDoList
          needs documenting
static int _numNotValid
          needs documenting
protected static java.lang.Object _RecentOffender
          needs documenting
protected static java.util.Vector _RecentOffenderItems
          needs documenting
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 Logger cat
           
private  boolean isPaused
          state variable for whether the validity checking thread is paused (waiting).
private static ToDoList theInstance
          The ToDoList instance that is also the validity checking thread.
 
Fields inherited from class java.util.Observable
 
Constructor Summary
ToDoList()
          creates a new todolist.
 
Method Summary
 void addAll(ToDoList list)
          needs documenting
private  void addE(ToDoItem item)
          needs documenting, why synchronised?
 void addElement(ToDoItem item)
          needs documenting
private  void addOffenders(VectorSet newoffs)
          needs documenting
private  void addPosters(Poster newp)
          needs documenting
 void addToDoListListener(ToDoListListener l)
          needs documenting
 ToDoItem elementAt(int index)
          needs documenting
 java.util.Enumeration elements()
          needs documenting
 java.util.Vector elementsForOffender(java.lang.Object off)
          needs documenting
 boolean explicitlyResolve(ToDoItem item, java.lang.String reason)
          needs documenting
protected  void fireToDoItemAdded(ToDoItem item)
          needs documenting
protected  void fireToDoItemChanged(ToDoItem item)
          needs documenting
protected  void fireToDoItemRemoved(ToDoItem item)
          needs documenting
protected  void fireToDoItemsAdded(java.util.Vector items)
          needs documenting
protected  void fireToDoItemsRemoved(java.util.Vector items)
          needs documenting
protected  void fireToDoListChanged()
          Notify all listeners that have registered interest for notification on this event type.
 void forceValidityCheck()
          needs documenting
protected  void forceValidityCheck(java.util.Vector removes)
          Check each ToDoItem on the list to see if it is still valid.
 java.util.Vector getDecisions()
          needs documenting
 java.util.Vector getGoals()
          needs documenting
static ToDoList getInstance()
          returns the validity checking thread instance.
 VectorSet getOffenders()
           
 VectorSet getPosters()
           
 java.util.Vector getResolvedItems()
          needs documenting
 java.util.Vector getToDoItems()
          needs documenting
 boolean isPaused()
           
 void notifyObservers()
          needs documenting
 void notifyObservers(java.lang.Object o)
          needs documenting
 void notifyObservers(java.lang.String action, java.lang.Object arg)
          needs documenting
 void pause()
           
protected  void recomputeAllOffenders()
          needs documenting
protected  void recomputeAllPosters()
          needs documenting
 void removeAll(ToDoList list)
          needs documenting
 void removeAllElements()
          needs documenting
private  boolean removeE(ToDoItem item)
          needs documenting
 boolean removeElement(ToDoItem item)
          needs documenting
 void removeToDoListListener(ToDoListListener l)
          needs documenting
 boolean resolve(ToDoItem item)
          needs documenting
 void resume()
           
 void run()
          Periodically check to see if items on the list are still valid.
 void setPaused(boolean paused)
          sets the pause state.
 int size()
          needs documenting
private  void sort()
          TODO: not done yet(empty implementation), Sort the items by priority.
 void spawnValidityChecker(Designer d)
          Start a Thread to delete old items from the ToDoList.
 java.lang.String toString()
          needs documenting
 
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 Logger cat

_RecentOffender

protected static java.lang.Object _RecentOffender
needs documenting


_RecentOffenderItems

protected static java.util.Vector _RecentOffenderItems
needs documenting


_items

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


_allOffenders

private VectorSet _allOffenders
These are computed when needed.


_allPosters

private VectorSet _allPosters
These are computed when needed.


_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
needs documenting


_longestToDoList

public static int _longestToDoList
needs documenting


_numNotValid

public static int _numNotValid
needs documenting


theInstance

private static ToDoList theInstance
The ToDoList instance that is also the validity checking thread. this thread should probably be factored out...


isPaused

private boolean isPaused
state variable for whether the validity checking thread is paused (waiting).

Constructor Detail

ToDoList

public ToDoList()
creates a new todolist. use getInstance() if you want to create the validity checking thread.

Method Detail

getInstance

public static ToDoList getInstance()
returns the validity checking thread instance.


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()
needs documenting


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.


pause

public void pause()

resume

public void resume()

isPaused

public boolean isPaused()

setPaused

public void setPaused(boolean paused)
sets the pause state. if set to false, calls resume() also to start working.


notifyObservers

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


notifyObservers

public void notifyObservers(java.lang.Object o)
needs documenting

Overrides:
notifyObservers in class java.util.Observable

notifyObservers

public void notifyObservers()
needs documenting

Overrides:
notifyObservers in class java.util.Observable

getToDoItems

public java.util.Vector getToDoItems()
needs documenting


getResolvedItems

public java.util.Vector getResolvedItems()
needs documenting


getOffenders

public VectorSet getOffenders()
Returns:
the set of offenders

addOffenders

private void addOffenders(VectorSet newoffs)
needs documenting


getPosters

public VectorSet getPosters()
Returns:
the set of all the posters

addPosters

private void addPosters(Poster newp)
needs documenting


getDecisions

public java.util.Vector getDecisions()
needs documenting


getGoals

public java.util.Vector getGoals()
needs documenting


addE

private void addE(ToDoItem item)
needs documenting, why synchronised?


addElement

public void addElement(ToDoItem item)
needs documenting


addAll

public void addAll(ToDoList list)
needs documenting


removeAll

public void removeAll(ToDoList list)
needs documenting


removeE

private boolean removeE(ToDoItem item)
needs documenting


removeElement

public boolean removeElement(ToDoItem item)
needs documenting


resolve

public boolean resolve(ToDoItem item)
needs documenting


explicitlyResolve

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

UnresolvableException

removeAllElements

public void removeAllElements()
needs documenting


elementsForOffender

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


size

public int size()
needs documenting


elements

public java.util.Enumeration elements()
needs documenting


elementAt

public ToDoItem elementAt(int index)
needs documenting


recomputeAllOffenders

protected void recomputeAllOffenders()
needs documenting


recomputeAllPosters

protected void recomputeAllPosters()
needs documenting


addToDoListListener

public void addToDoListListener(ToDoListListener l)
needs documenting


removeToDoListListener

public void removeToDoListListener(ToDoListListener l)
needs documenting


fireToDoListChanged

protected void fireToDoListChanged()
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

See Also:
EventListenerList

fireToDoItemChanged

protected void fireToDoItemChanged(ToDoItem item)
needs documenting


fireToDoItemAdded

protected void fireToDoItemAdded(ToDoItem item)
needs documenting


fireToDoItemsAdded

protected void fireToDoItemsAdded(java.util.Vector items)
needs documenting


fireToDoItemRemoved

protected void fireToDoItemRemoved(ToDoItem item)
needs documenting


fireToDoItemsRemoved

protected void fireToDoItemsRemoved(java.util.Vector items)
needs documenting


sort

private void sort()
TODO: not done yet(empty implementation), Sort the items by priority. It has been pointed out that sorting and priorities will probably be pretty arbitrary and hard to match with the Designer's (tacit) feelings about the importance of various items. We are thinking about a sort-by-category user interface that would be part of a complete java PIM (personal information manager, AKA, a daily planner).


toString

public java.lang.String toString()
needs documenting

Overrides:
toString in class java.lang.Object


ArgoUML © 1996-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook