se.liu.ida.critiquer.scenarios.standard
Class CorrectOrdering

java.lang.Object
  extended by se.liu.ida.critiquer.activities.AbstractParamChangedListener
      extended by se.liu.ida.critiquer.constraints.StandardConstraint
          extended by se.liu.ida.critiquer.scenarios.standard.CorrectOrdering
All Implemented Interfaces:
Serializable, Comparable<ActivityUpdateListener>, ActivityConsistencyCheck, ActivityUpdateListener, SingletonConstraint, TextCritic, VisualConstraint, ViewRenderingListener

public class CorrectOrdering
extends StandardConstraint
implements ActivityConsistencyCheck, TextCritic

Verify that there is a destination in the activity that should come before and a static location in the after activity, or a static location in the beforeActivity and a starting location in the afterActivity

Author:
olale
See Also:
Serialized Form

Field Summary
 
Fields inherited from class se.liu.ida.critiquer.constraints.StandardConstraint
applicableViews, statusListeners, violationActivities
 
Constructor Summary
CorrectOrdering()
           
 
Method Summary
 boolean childOfCheck(Activity parentActivity, Activity Child)
           
 String getDescription()
          Describe this constraint
 String getText()
           
protected  void initApplicableViews()
          Make this view applicable to the task view
 boolean orderingCheck(Activity beforeActivity, Activity afterActivity)
          Checks the ordering consistency
<T> void
paramChanged(Activity activity, Parameter<T> p)
          A parameter has changed value
<T> boolean
paramValueCheck(Activity a, Parameter<T> p, T newValue)
          Whenever a paramChanged event occurs, this method is called in all registered ActivityConsistencyCheck listeners that are available in an activity.
 void viewUpdated(View v, Graphics2D g2)
           
 
Methods inherited from class se.liu.ida.critiquer.constraints.StandardConstraint
addStatusListener, debug, error, getApplicableViews, getColor, info, isActive, isApplicableFor, isConsistent, removeStatusListener, setActive, setColor, setConsistent, warn
 
Methods inherited from class se.liu.ida.critiquer.activities.AbstractParamChangedListener
activityCreated, activityRemoved, activityUpdated, compareTo, paramAdded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CorrectOrdering

public CorrectOrdering()
Method Detail

paramValueCheck

public <T> boolean paramValueCheck(Activity a,
                                   Parameter<T> p,
                                   T newValue)
Description copied from interface: ActivityConsistencyCheck
Whenever a paramChanged event occurs, this method is called in all registered ActivityConsistencyCheck listeners that are available in an activity.

Specified by:
paramValueCheck in interface ActivityConsistencyCheck
Type Parameters:
T - - The type of value the parameter represents
newValue - - The suggested new value
Returns:
true - if the change is allowed, false if not

childOfCheck

public boolean childOfCheck(Activity parentActivity,
                            Activity Child)
Specified by:
childOfCheck in interface ActivityConsistencyCheck

orderingCheck

public boolean orderingCheck(Activity beforeActivity,
                             Activity afterActivity)
Checks the ordering consistency

Specified by:
orderingCheck in interface ActivityConsistencyCheck
See Also:
se.liu.ida.critiquer.activities.ActivityConsistencyCheck#orderingCheck(se.liu.ida.critiquer.activities.Activity, critiquer.activities.Activity)

paramChanged

public <T> void paramChanged(Activity activity,
                             Parameter<T> p)
Description copied from interface: ActivityUpdateListener
A parameter has changed value

Specified by:
paramChanged in interface ActivityUpdateListener
Specified by:
paramChanged in class AbstractParamChangedListener

getDescription

public String getDescription()
Describe this constraint

Specified by:
getDescription in interface SingletonConstraint
See Also:
SingletonConstraint.getDescription()

initApplicableViews

protected void initApplicableViews()
Make this view applicable to the task view

Overrides:
initApplicableViews in class StandardConstraint
See Also:
StandardConstraint.initApplicableViews()

viewUpdated

public void viewUpdated(View v,
                        Graphics2D g2)
Specified by:
viewUpdated in interface ViewRenderingListener

getText

public String getText()
Specified by:
getText in interface TextCritic