org.argouml.cognitive
Class Designer

java.lang.Object
  |
  +--org.argouml.cognitive.Designer
All Implemented Interfaces:
java.util.EventListener, ru.novosoft.uml.MElementListener, Poster, java.beans.PropertyChangeListener, java.lang.Runnable, java.io.Serializable

public class Designer
extends java.lang.Object
implements Poster, java.lang.Runnable, java.beans.PropertyChangeListener, ru.novosoft.uml.MElementListener, java.io.Serializable

This class models the designer who is building a complex design in some application domain and needs continuous feedback to aid in the making of good design decisions. This area needs work. Currently everything is hardcoded.

See Also:
Serialized Form

Field Summary
protected  long _critiqueDuration
           
protected  int _critiqueLock
           
protected  long _lastCritique
           
static int _longestAdd
           
static int _longestHot
           
static boolean _userWorking
           
protected static org.apache.log4j.Category cat
           
static Designer TheDesigner
           
static java.util.Vector UNSPEC_DECISION_VECTOR
           
static java.util.Vector UNSPEC_GOAL_VECTOR
           
 
Constructor Summary
Designer()
           
 
Method Summary
 void addToDoItems(ToDoList list)
          Add all the items in the given list to my list.
 boolean canFixIt(ToDoItem item)
           
static void clearCritiquing()
           
 boolean containsKnowledgeType(java.lang.String type)
           
 void critique(Design des)
          Look for potential problems or open issues in the given design.
 void critiqueASAP(java.lang.Object dm, java.lang.String reason)
           
 void defineDecision(java.lang.String decision, int priority)
           
 void determineActiveCritics()
          Ask this designer's agency to select which critics should be active.
static void disableCritiquing()
           
 void disruptivelyWarn(ToDoItem item)
          Inform the human designer that there is an urgent ToDoItem that (s)he must consider before doing any more work.
 int disruptiveThreshold()
          Used to determine which ToDoItems are urgent.
static void enableCritiquing()
           
 java.lang.String expand(java.lang.String desc, org.tigris.gef.util.VectorSet offs)
          Customize the description string just before it is displayed.
 void fixIt(ToDoItem item, java.lang.Object arg)
           
 Agency getAgency()
          Reply the Agency object that is helping this Designer.
 boolean getAutoCritique()
          autoCritique and critiquingInterval are two prameters that control how the critiquing thread operates.
 org.tigris.gef.util.ChildGenerator getChildGenerator()
           
 javax.swing.Icon getClarifier()
           
 int getCritiquingInterval()
           
static java.lang.Object getCritiquingRoot()
           
 DecisionModel getDecisionModel()
           
 java.util.Vector getDecisions()
           
 java.lang.String getExpertEmail()
          Get some contact information on the Poster.
 GoalModel getGoalModel()
           
 java.util.Vector getGoals()
           
 java.util.Properties getPrefs()
          Reply the designers personal preferneces.
 java.util.Vector getSupportedDecisions()
           
 java.util.Vector getSupportedGoals()
           
 ToDoList getToDoList()
          Reply this Designer's ToDoList, a list of pending problems and issues that the designer might be interested in.
 boolean hasGoal(java.lang.String goal)
          Record the extent to which the designer desires the given goal.
 void inform(ToDoItem item)
          Inform the human designer using this system that the given ToDoItem should be considered.
 boolean isConsidering(Decision d)
           
 boolean isConsidering(java.lang.String decision)
          Reply true iff the designer is currently considering the given decison.
 void listRoleItemSet(ru.novosoft.uml.MElementEvent mee)
           
 void nondisruptivelyWarn(ToDoItem item)
          Inform the human designer that there is a ToDoItem that is relevant to his design work, and allow him to consider it on his own initiative.
 void propertyChange(java.beans.PropertyChangeEvent pce)
           
 void propertySet(ru.novosoft.uml.MElementEvent mee)
           
 void recovered(ru.novosoft.uml.MElementEvent mee)
           
 void removed(ru.novosoft.uml.MElementEvent mee)
           
 void removeToDoItems(ToDoList list)
          Remove all the items in the given list from my list.
 void roleAdded(ru.novosoft.uml.MElementEvent mee)
           
 void roleRemoved(ru.novosoft.uml.MElementEvent mee)
           
 void run()
          Continuously select and execute critics against this designer's design. spawnCritiquer is used to start a Thread that runs this.
 void setAutoCritique(boolean b)
           
 void setChildGenerator(org.tigris.gef.util.ChildGenerator cg)
           
 void setCritiquingInterval(int i)
           
static void setCritiquingRoot(java.lang.Object d)
           
 void setDecisionPriority(java.lang.String decision, int priority)
          Record the extent to which the designer is considering the given decision.
 void setExpertEmail(java.lang.String addr)
          Update the Poster's contact info.
 void setGoalPriority(java.lang.String goal, int priority)
           
 void snooze()
          temporarily disable this Poster.
 void spawnCritiquer(java.lang.Object root)
          Start a separate thread to continually select and execute critics that are relevant to this designer's work.
 void startConsidering(Decision d)
           
 void startConsidering(java.lang.String decision)
           
 void startDesiring(java.lang.String goal)
           
 boolean stillValid(ToDoItem i, Designer d)
          ToDoItem's that are posted by the designer are assumed to be valid until the designer explicitly removes them.
 void stopConsidering(Decision d)
           
 void stopConsidering(java.lang.String decision)
           
 void stopDesiring(java.lang.String goal)
           
 boolean supports(Decision d)
           
 boolean supports(Goal g)
           
static Designer theDesigner()
           
static void theDesigner(Designer d)
           
 java.lang.String toString()
           
 void unsnooze()
          Unsnooze this Poster, it may resume posting without further delay.
 
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

TheDesigner

public static Designer TheDesigner

_userWorking

public static boolean _userWorking

_longestAdd

public static int _longestAdd

_longestHot

public static int _longestHot

_critiqueDuration

protected long _critiqueDuration

_critiqueLock

protected int _critiqueLock

_lastCritique

protected long _lastCritique

UNSPEC_DECISION_VECTOR

public static java.util.Vector UNSPEC_DECISION_VECTOR

UNSPEC_GOAL_VECTOR

public static java.util.Vector UNSPEC_GOAL_VECTOR
Constructor Detail

Designer

public Designer()
Method Detail

theDesigner

public static void theDesigner(Designer d)

theDesigner

public static Designer theDesigner()

spawnCritiquer

public void spawnCritiquer(java.lang.Object root)
Start a separate thread to continually select and execute critics that are relevant to this designer's work.

run

public void run()
Continuously select and execute critics against this designer's design. spawnCritiquer is used to start a Thread that runs this.
Specified by:
run in interface java.lang.Runnable

critiqueASAP

public void critiqueASAP(java.lang.Object dm,
                         java.lang.String reason)

critique

public void critique(Design des)
Look for potential problems or open issues in the given design.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pce)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

propertySet

public void propertySet(ru.novosoft.uml.MElementEvent mee)
Specified by:
propertySet in interface ru.novosoft.uml.MElementListener

listRoleItemSet

public void listRoleItemSet(ru.novosoft.uml.MElementEvent mee)
Specified by:
listRoleItemSet in interface ru.novosoft.uml.MElementListener

recovered

public void recovered(ru.novosoft.uml.MElementEvent mee)
Specified by:
recovered in interface ru.novosoft.uml.MElementListener

removed

public void removed(ru.novosoft.uml.MElementEvent mee)
Specified by:
removed in interface ru.novosoft.uml.MElementListener

roleAdded

public void roleAdded(ru.novosoft.uml.MElementEvent mee)
Specified by:
roleAdded in interface ru.novosoft.uml.MElementListener

roleRemoved

public void roleRemoved(ru.novosoft.uml.MElementEvent mee)
Specified by:
roleRemoved in interface ru.novosoft.uml.MElementListener

determineActiveCritics

public void determineActiveCritics()
Ask this designer's agency to select which critics should be active.

getAutoCritique

public boolean getAutoCritique()
autoCritique and critiquingInterval are two prameters that control how the critiquing thread operates. If autoCritique is false then now critiquing is done in the background. The critiquingInterval determines how often the critiquing thread executes. The concept of an interval between runs will become less important as Argo is redesigned to be more trigger driven.

setAutoCritique

public void setAutoCritique(boolean b)

getCritiquingInterval

public int getCritiquingInterval()

setCritiquingInterval

public void setCritiquingInterval(int i)

disableCritiquing

public static void disableCritiquing()

enableCritiquing

public static void enableCritiquing()

clearCritiquing

public static void clearCritiquing()

setCritiquingRoot

public static void setCritiquingRoot(java.lang.Object d)

getCritiquingRoot

public static java.lang.Object getCritiquingRoot()

getChildGenerator

public org.tigris.gef.util.ChildGenerator getChildGenerator()

setChildGenerator

public void setChildGenerator(org.tigris.gef.util.ChildGenerator cg)

getDecisionModel

public DecisionModel getDecisionModel()

getDecisions

public java.util.Vector getDecisions()

getGoalModel

public GoalModel getGoalModel()

getGoals

public java.util.Vector getGoals()

stillValid

public boolean stillValid(ToDoItem i,
                          Designer d)
ToDoItem's that are posted by the designer are assumed to be valid until the designer explicitly removes them. Perhaps in the future the designer could specify a condition to determine when his items expire.
Specified by:
stillValid in interface Poster
See Also:
ToDoItem, Critic.stillValid(org.argouml.cognitive.ToDoItem, org.argouml.cognitive.Designer)

supports

public boolean supports(Decision d)
Specified by:
supports in interface Poster

getSupportedDecisions

public java.util.Vector getSupportedDecisions()
Specified by:
getSupportedDecisions in interface Poster

supports

public boolean supports(Goal g)
Specified by:
supports in interface Poster

getSupportedGoals

public java.util.Vector getSupportedGoals()
Specified by:
getSupportedGoals in interface Poster

containsKnowledgeType

public boolean containsKnowledgeType(java.lang.String type)
Specified by:
containsKnowledgeType in interface Poster

expand

public java.lang.String expand(java.lang.String desc,
                               org.tigris.gef.util.VectorSet offs)
Description copied from interface: Poster
Customize the description string just before it is displayed.
Specified by:
expand in interface Poster

getClarifier

public javax.swing.Icon getClarifier()
Specified by:
getClarifier in interface Poster

getToDoList

public ToDoList getToDoList()
Reply this Designer's ToDoList, a list of pending problems and issues that the designer might be interested in.
See Also:
ToDoList

addToDoItems

public void addToDoItems(ToDoList list)
Add all the items in the given list to my list.

removeToDoItems

public void removeToDoItems(ToDoList list)
Remove all the items in the given list from my list.

getPrefs

public java.util.Properties getPrefs()
Reply the designers personal preferneces.

isConsidering

public boolean isConsidering(java.lang.String decision)
Reply true iff the designer is currently considering the given decison.

isConsidering

public boolean isConsidering(Decision d)

setDecisionPriority

public void setDecisionPriority(java.lang.String decision,
                                int priority)
Record the extent to which the designer is considering the given decision.

defineDecision

public void defineDecision(java.lang.String decision,
                           int priority)

startConsidering

public void startConsidering(java.lang.String decision)

startConsidering

public void startConsidering(Decision d)

stopConsidering

public void stopConsidering(java.lang.String decision)

stopConsidering

public void stopConsidering(Decision d)

hasGoal

public boolean hasGoal(java.lang.String goal)
Record the extent to which the designer desires the given goal.

setGoalPriority

public void setGoalPriority(java.lang.String goal,
                            int priority)

startDesiring

public void startDesiring(java.lang.String goal)

stopDesiring

public void stopDesiring(java.lang.String goal)

getExpertEmail

public java.lang.String getExpertEmail()
Description copied from interface: Poster
Get some contact information on the Poster.
Specified by:
getExpertEmail in interface Poster

setExpertEmail

public void setExpertEmail(java.lang.String addr)
Description copied from interface: Poster
Update the Poster's contact info. Is this needed?
Specified by:
setExpertEmail in interface Poster

snooze

public void snooze()
Description copied from interface: Poster
temporarily disable this Poster.
Specified by:
snooze in interface Poster

unsnooze

public void unsnooze()
Description copied from interface: Poster
Unsnooze this Poster, it may resume posting without further delay.
Specified by:
unsnooze in interface Poster

getAgency

public Agency getAgency()
Reply the Agency object that is helping this Designer.

inform

public void inform(ToDoItem item)
Inform the human designer using this system that the given ToDoItem should be considered. This can be disruptive if the item is urgent, or (more commonly) it is added to his ToDoList so that he can consider it at his leisure.

disruptivelyWarn

public void disruptivelyWarn(ToDoItem item)
Inform the human designer that there is an urgent ToDoItem that (s)he must consider before doing any more work. Currently not implemented.

nondisruptivelyWarn

public void nondisruptivelyWarn(ToDoItem item)
Inform the human designer that there is a ToDoItem that is relevant to his design work, and allow him to consider it on his own initiative.

disruptiveThreshold

public int disruptiveThreshold()
Used to determine which ToDoItems are urgent.

toString

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

fixIt

public void fixIt(ToDoItem item,
                  java.lang.Object arg)
Specified by:
fixIt in interface Poster

canFixIt

public boolean canFixIt(ToDoItem item)
Specified by:
canFixIt in interface Poster


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