org.argouml.cognitive.critics
Class CompoundCritic
java.lang.Object
|
+--org.argouml.cognitive.critics.Critic
|
+--org.argouml.cognitive.critics.CompoundCritic
- All Implemented Interfaces:
- Poster, java.io.Serializable
- public class CompoundCritic
- extends Critic
A CompoundCritic acts like a regular critic in that it checks the
design and produces design feedback. However, a CompoundCritic is
composed of several regular critics that are applied in order.
The first one the produces feedback ends the application. This is
useful when criticism can be ordered from specific to general:
general feedback should not be produced if specific feedback is
available. For example, one critic might check for the legality
of the name of a design element, and another might check for the
presence of any name. If a given design element has no name, both
critics could produce feedback, but it would be more useful if
only the first one did.
- See Also:
- Serialized Form
Field Summary |
protected java.util.Vector |
_critics
The sub-critics that make up this CompoundCritic. |
Fields inherited from class org.argouml.cognitive.critics.Critic |
_clarifier, _knowledgeTypes, _numCriticsFired, _supportedDecisions, _supportedGoals, _triggerMask, cat, DEFAULT_CLARIFIER, ENABLED, KT_COMPLETENESS, KT_CONSISTENCY, KT_CORRECTNESS, KT_DESIGNERS, KT_EXPERIENCIAL, KT_OPTIMIZATION, KT_ORGANIZATIONAL, KT_PRESENTATION, KT_SEMANTICS, KT_SYNTAX, KT_TOOL, NO_PROBLEM, PROBLEM_FOUND, RESOURCE_BUNDLE, SNOOZE_ORDER |
Methods inherited from class org.argouml.cognitive.critics.Critic |
addControlRec, addTrigger, beActive, beInactive, canFixIt, defaultMoreInfoURL, fixIt, getArg, getArgs, getControlRec, getCriticCategory, getCriticKey, getCriticName, getCriticType, getDecisionCategory, getDescription, getDescriptionTemplate, getExpertEmail, getHeadline, getHeadline, getHeadline, getMoreInfoURL, getMoreInfoURL, getPriority, getPriority, getTriggerMask, getWizardClass, initWizard, isRelevantToDecisions, isRelevantToGoals, makeWizard, matchReason, postItem, predicate, reasonCodeFor, setArg, setArgs, setDecisionCategory, setDescription, setEnabled, setExpertEmail, setHeadline, setKnowledgeTypes, setKnowledgeTypes, setKnowledgeTypes, setKnowledgeTypes, setMoreInfoURL, setPriority, snooze, snoozeOrder, stillValid, toString, unsnooze |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_critics
protected java.util.Vector _critics
- The sub-critics that make up this CompoundCritic.
CompoundCritic
public CompoundCritic()
CompoundCritic
public CompoundCritic(Critic c1,
Critic c2)
CompoundCritic
public CompoundCritic(Critic c1,
Critic c2,
Critic c3)
CompoundCritic
public CompoundCritic(Critic c1,
Critic c2,
Critic c3,
Critic c4)
setCritics
public void setCritics(java.util.Vector critics)
getCritics
public java.util.Vector getCritics()
addCritic
public void addCritic(Critic c)
removeCritic
public void removeCritic(Critic c)
critique
public void critique(java.lang.Object dm,
Designer dsgr)
- Description copied from class:
Critic
- Examine the given Object and Designer and, if
appropriate, produce one or more ToDoItem's and add them to the
offending design material's and the Designer's ToDoList. By
default this is basically a simple if-statement that relies on
predicate() to determine if there is some appropriate feedback,
and toDoItem() to produce the ToDoItem.
The predicate() and toDoItem() pair of methods is simple and
convient for many critics. More sophisticated critics that
produce more than one ToDoItem per critiquing, or that produce
ToDoItem's that contain information that was already computed in
the predicate, should override critique. If you override this
method, you should call super.critique().
- Overrides:
critique
in class Critic
- Following copied from class:
org.argouml.cognitive.critics.Critic
- See Also:
# @see Critic#toDoItem
supports
public boolean supports(Decision d)
- Overrides:
supports
in class Critic
getSupportedDecisions
public java.util.Vector getSupportedDecisions()
- Overrides:
getSupportedDecisions
in class Critic
addSupportedDecision
public void addSupportedDecision(Decision d)
- Overrides:
addSupportedDecision
in class Critic
supports
public boolean supports(Goal g)
- Overrides:
supports
in class Critic
getSupportedGoals
public java.util.Vector getSupportedGoals()
- Overrides:
getSupportedGoals
in class Critic
addSupportedGoal
public void addSupportedGoal(Goal g)
- Overrides:
addSupportedGoal
in class Critic
containsKnowledgeType
public boolean containsKnowledgeType(java.lang.String type)
- Overrides:
containsKnowledgeType
in class Critic
addKnowledgeType
public void addKnowledgeType(java.lang.String type)
- Overrides:
addKnowledgeType
in class Critic
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.
- Overrides:
expand
in class Critic
getClarifier
public javax.swing.Icon getClarifier()
- Overrides:
getClarifier
in class Critic
isActive
public boolean isActive()
- Description copied from class:
Critic
- Reply true iff this Critic can execute. This fact is normally
determined by a ControlMech.
- Overrides:
isActive
in class Critic
isEnabled
public boolean isEnabled()
- Description copied from class:
Critic
- This is a convient method for accessing one well-known control
record. The enabled control record is a boolean that the user can
turn on or off to manually enable or disable this Critic. It is
normally combined with other ControlMech determinations with a
logic-and.
- Overrides:
isEnabled
in class Critic
toDoItem
public ToDoItem toDoItem(java.lang.Object dm,
Designer dsgr)
- Description copied from class:
Critic
- Reply the ToDoItem that the designer should see iff predicate()
returns true. By default it just fills in the fields of the
ToDoItem from accessor methods of this Critic. Critic Subclasses
may override this method or the accessor methods to add computed
fields to the ToDoItem.
TODO: Critic's may want to add new fields to a
ToDoItem to make stillValid more efficent.
- Overrides:
toDoItem
in class Critic
- Following copied from class:
org.argouml.cognitive.critics.Critic
- See Also:
Critic.critique(java.lang.Object, org.argouml.cognitive.Designer)