se.liu.ida.critiquer.constraints
Class TimeCalculator

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.constraints.TimeCalculator
All Implemented Interfaces:
Serializable, Comparable<ActivityUpdateListener>, ActivityUpdateListener, SingletonConstraint, TextCritic, VisualConstraint, ViewRenderingListener

public class TimeCalculator
extends StandardConstraint
implements TextCritic

See Also:
Serialized Form

Field Summary
(package private)  int maxSlack
           
 
Fields inherited from class se.liu.ida.critiquer.constraints.StandardConstraint
applicableViews, statusListeners, violationActivities
 
Constructor Summary
TimeCalculator()
           
 
Method Summary
 String getDescription()
           
 ConstraintPolicy getPolicy()
           
 String getText()
          Present information on which activities that I cannot calculate the time for
protected  void initApplicableViews()
          This can be viewable in the timeline view
 boolean isAggressive()
           
<T> void
paramChanged(Activity activity, Parameter<T> p)
          A parameter has changed value
 void setAggressive(boolean aggressive)
          Set aggressiveness.
 void setPolicy(ConstraintPolicy policy)
           
 void viewUpdated(View v, Graphics2D g2)
          If our policy is to highlight this instead of forcing a value update, we use this method.
 
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
 

Field Detail

maxSlack

int maxSlack
Constructor Detail

TimeCalculator

public TimeCalculator()
Method Detail

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

isAggressive

public boolean isAggressive()
Returns:
Returns the aggressive.

setAggressive

public void setAggressive(boolean aggressive)
Set aggressiveness. If aggressive, the constraint will react on and/or make sure that there is not more time allocated to the activity than what the activity calculates that it will take with the current resources. When not aggressive, it will only react on if there is too little time allocated.

Parameters:
aggressive - The aggressive to set.

getDescription

public String getDescription()
Specified by:
getDescription in interface SingletonConstraint

viewUpdated

public void viewUpdated(View v,
                        Graphics2D g2)
If our policy is to highlight this instead of forcing a value update, we use this method.

Specified by:
viewUpdated in interface ViewRenderingListener
See Also:
ViewRenderingListener.viewUpdated(se.liu.ida.critiquer.gui.View, java.awt.Graphics2D)

initApplicableViews

protected void initApplicableViews()
This can be viewable in the timeline view

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

getPolicy

public ConstraintPolicy getPolicy()
Returns:
Returns the policy.

setPolicy

public void setPolicy(ConstraintPolicy policy)
Parameters:
policy - The policy to set.

getText

public String getText()
Present information on which activities that I cannot calculate the time for

Specified by:
getText in interface TextCritic
See Also:
TextCritic.getText()