org.argouml.cognitive
Class ToDoItem

java.lang.Object
  extended byorg.argouml.cognitive.ToDoItem
All Implemented Interfaces:
Serializable, WizardItem
Direct Known Subclasses:
UMLToDoItem

public class ToDoItem
extends Object
implements Serializable, WizardItem

This class defines the feedback items that can be placed on the Designer's ToDoList. The main point of a ToDoItem is to inform the Designer of some problem or open design issue. Additional information in the ToDoItem helps put the designer in a mental context suitable for resolving the issue: ToDoItem's are well tied into the design and design process so that the Designer can see which design material's are the subject of this ToDoItem, and which Critic raised it. The expert email address helps connect the designer with the organizational context. The more info URL helps provide background knowledge of the domain. In the future ToDoItems will include ties back to the design rationale log. Also the run-time system needs to know who posted each ToDoItem so that it can automatically remove it if it is no longer valid.

See Also:
Serialized Form

Field Summary
static int HIGH_PRIORITY
          The high priority todoitem of 4 levels.
static int INTERRUPTIVE_PRIORITY
          The interruptive priority todoitem of 4 levels.
static int LOW_PRIORITY
          The lowest priority todoitem of 4 levels.
static int MED_PRIORITY
          The medium priority todoitem of 4 levels.
 
Constructor Summary
ToDoItem(Critic c)
          The constructor.
ToDoItem(Critic c, ListSet offs, Designer dsgr)
          The constructor.
ToDoItem(Critic c, Object dm, Designer dsgr)
          The constructor.
ToDoItem(Poster poster, String h, int p, String d, String m)
          The constructor.
ToDoItem(Poster poster, String h, int p, String d, String m, ListSet offs)
          The constructor.
 
Method Summary
 void action()
          The user has double-clicked or otherwise indicated that they want to do something active with this item.
 boolean canFixIt()
          Some problems can be automatically fixed, ask the Critic to do it if it can.
 void changed()
          Notify the user interface that this ToDoItem has changed.
 boolean containsKnowledgeType(String type)
           
 void deselect()
          When a ToDoItem is deselected in the UiToDoList window, unhighlight the "offending" design material's.
 boolean equals(Object o)
          Is this item a copy?
 void fixIt()
          Some problems can be automatically fixed, ask the Critic to do it if it can.
 Icon getClarifier()
          Return a clarifier object that can graphical highlight this error in a design diagram.
 String getDescription()
           
 String getExpertEmail()
          Find the email address of the poster.
 String getHeadline()
           
 String getMoreInfoURL()
           
 ListSet getOffenders()
          Reply a Set of design material's that are the subject of this ToDoItem.
 Poster getPoster()
          Reply the Critic or Designer that posted this ToDoItem.
 int getPriority()
           
 int getProgress()
           
 Wizard getWizard()
           
 int hashCode()
           
 void select()
          When a ToDoItem is selected in the UiToDoList window, highlight the "offending" design material's.
 void setDescription(String d)
           
 void setHeadline(String h)
           
 void setMoreInfoURL(String m)
           
 void setOffenders(ListSet offenders)
          Set the designmatial that is subject of this ToDoItem.
 void setPriority(int p)
           
 boolean stillValid(Designer d)
          Reply true iff this ToDoItem should be kept on the Designer's ToDoList.
 boolean supports(Decision d)
           
 boolean supports(Goal g)
           
 String toString()
          Reply a string for debugging.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INTERRUPTIVE_PRIORITY

public static final int INTERRUPTIVE_PRIORITY
The interruptive priority todoitem of 4 levels.

See Also:
Constant Field Values

HIGH_PRIORITY

public static final int HIGH_PRIORITY
The high priority todoitem of 4 levels.

See Also:
Constant Field Values

MED_PRIORITY

public static final int MED_PRIORITY
The medium priority todoitem of 4 levels.

See Also:
Constant Field Values

LOW_PRIORITY

public static final int LOW_PRIORITY
The lowest priority todoitem of 4 levels.

See Also:
Constant Field Values
Constructor Detail

ToDoItem

public ToDoItem(Poster poster,
                String h,
                int p,
                String d,
                String m,
                ListSet offs)
The constructor.

Parameters:
poster - the poster
h - the headline
p - the priority
d - the description
m - the more info url
offs - the offenders

ToDoItem

public ToDoItem(Poster poster,
                String h,
                int p,
                String d,
                String m)
The constructor.

Parameters:
poster - the poster
h - the headline
p - the priority
d - the description
m - the more info url

ToDoItem

public ToDoItem(Critic c,
                Object dm,
                Designer dsgr)
The constructor.

Parameters:
c - the poster (critic)
dm - A single offender.
dsgr - the designer

ToDoItem

public ToDoItem(Critic c,
                ListSet offs,
                Designer dsgr)
The constructor.

Parameters:
c - the poster (critic)
offs - the offenders
dsgr - the designer

ToDoItem

public ToDoItem(Critic c)
The constructor.

Parameters:
c - the poster (critic)
Method Detail

getHeadline

public String getHeadline()
Returns:
the headline

setHeadline

public void setHeadline(String h)
Parameters:
h - the headline

getDescription

public String getDescription()
Returns:
the description

setDescription

public void setDescription(String d)
Parameters:
d - the description

getMoreInfoURL

public String getMoreInfoURL()
Returns:
the more-info-url

setMoreInfoURL

public void setMoreInfoURL(String m)
Parameters:
m - the more-info-url

getPriority

public int getPriority()
Returns:
the priority

setPriority

public void setPriority(int p)
Parameters:
p - the priority

getProgress

public int getProgress()
Returns:
the wizard progress. An integer between 0 and 100, shows percent done.

getOffenders

public ListSet getOffenders()
Reply a Set of design material's that are the subject of this ToDoItem.

Returns:
the offenders

setOffenders

public void setOffenders(ListSet offenders)
Set the designmatial that is subject of this ToDoItem.

Parameters:
offenders - the offenders

getPoster

public Poster getPoster()
Reply the Critic or Designer that posted this ToDoItem.

Returns:
the poster

getExpertEmail

public String getExpertEmail()
Find the email address of the poster.

Returns:
the email address

getClarifier

public Icon getClarifier()
Return a clarifier object that can graphical highlight this error in a design diagram. Return a clarifier for this todoitem, if not found by the poster, or null.

Returns:
an Icon or null if none found.

getWizard

public Wizard getWizard()
Returns:
the wizard

containsKnowledgeType

public boolean containsKnowledgeType(String type)
Parameters:
type - the knowledgetype
Returns:
true if the poster contains the given knowledgetype

supports

public boolean supports(Decision d)
Parameters:
d - the decision
Returns:
true if the decision is supported by the poster

supports

public boolean supports(Goal g)
Parameters:
g - the given goal
Returns:
true if the poster supports the given goal

hashCode

public int hashCode()
See Also:
Object.hashCode()

equals

public boolean equals(Object o)
Is this item a copy?

See Also:
Object.equals(java.lang.Object)

select

public void select()
When a ToDoItem is selected in the UiToDoList window, highlight the "offending" design material's.


deselect

public void deselect()
When a ToDoItem is deselected in the UiToDoList window, unhighlight the "offending" design material's.


action

public void action()
The user has double-clicked or otherwise indicated that they want to do something active with this item. By default, just re-select it, subclasses may choose to do more (e.g., navigate to the offending item if it is not visible).


changed

public void changed()
Notify the user interface that this ToDoItem has changed. Currently, this is used to update the progress bar.

Specified by:
changed in interface WizardItem

fixIt

public void fixIt()
Some problems can be automatically fixed, ask the Critic to do it if it can.


canFixIt

public boolean canFixIt()
Some problems can be automatically fixed, ask the Critic to do it if it can.

Returns:
true if the critic can automatically fix the problem

stillValid

public boolean stillValid(Designer d)
Reply true iff this ToDoItem should be kept on the Designer's ToDoList. This should return false if the poster has been deactivated, or if it can be determined that the problem that raised this issue is no longer present.

Parameters:
d - the given designer
Returns:
true if the todoitem is still valid

toString

public String toString()
Reply a string for debugging.

See Also:
Object.toString()


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook