se.liu.ida.critiquer.constraints
Class TimeParameterOrdering

java.lang.Object
  extended by se.liu.ida.critiquer.constraints.TimeParameterOrdering
All Implemented Interfaces:
Serializable, VisualConstraint, ViewRenderingListener

public class TimeParameterOrdering
extends Object
implements VisualConstraint

Check/ensure that t2 doesn't come before t1 This is a modifying constraint for now, but we let it implement the VisualConstraint interface just in case..

See Also:
Serialized Form

Nested Class Summary
static class TimeParameterOrdering.Type
           
 
Constructor Summary
TimeParameterOrdering(TimeParameter t1Param, TimeParameter t2Param, TimeParameterOrdering.Type type)
           
 
Method Summary
 void addStatusListener(ConstraintStatusListener l)
           
 void disableConstraint()
          Remove the activity update listeners when this constraint is removed
 void enableEditFirst()
           
 boolean equals(Object obj)
           
 List<Class<? extends View>> getApplicableViews()
           
 Color getColor()
           
 int getMaxSlack()
           
 int getMinSlack()
           
 TimeParameter getT1()
           
 TimeParameter getT2()
           
 TimeParameterOrdering.Type getType()
           
 boolean isActive()
          Should this constraint be displayed?
 boolean isApplicableFor(View view)
           
 boolean isSlackAllowed()
           
 void removeStatusListener(ConstraintStatusListener l)
           
 void setActive(boolean active)
          Toggles the active state of this constraint on and off.
 void setColor(Color c)
           
 void setMaxSlack(int maxSlack)
           
 void setMinSlack(int minSlack)
           
 void setPolicy(ConstraintPolicy policy)
           
 void setSlackAllowed(boolean allowSlack)
           
 void setType(TimeParameterOrdering.Type type)
           
 String toString()
           
 void viewUpdated(View v, Graphics2D g2)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeParameterOrdering

public TimeParameterOrdering(TimeParameter t1Param,
                             TimeParameter t2Param,
                             TimeParameterOrdering.Type type)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

setPolicy

public void setPolicy(ConstraintPolicy policy)

disableConstraint

public void disableConstraint()
Remove the activity update listeners when this constraint is removed


viewUpdated

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

enableEditFirst

public void enableEditFirst()

getColor

public Color getColor()
Specified by:
getColor in interface VisualConstraint

setColor

public void setColor(Color c)
Specified by:
setColor in interface VisualConstraint

isSlackAllowed

public boolean isSlackAllowed()
Returns:
Returns the allowSlack.

setSlackAllowed

public void setSlackAllowed(boolean allowSlack)
Parameters:
allowSlack - The allowSlack to set.

getT1

public TimeParameter getT1()
Returns:
Returns the t1.

getT2

public TimeParameter getT2()
Returns:
Returns the t2.

getApplicableViews

public List<Class<? extends View>> getApplicableViews()
Specified by:
getApplicableViews in interface VisualConstraint

isApplicableFor

public boolean isApplicableFor(View view)
Specified by:
isApplicableFor in interface VisualConstraint

setActive

public void setActive(boolean active)
Description copied from interface: VisualConstraint
Toggles the active state of this constraint on and off. This does not affect that updates that this constraint gets from the activities though

Specified by:
setActive in interface VisualConstraint

isActive

public boolean isActive()
Description copied from interface: VisualConstraint
Should this constraint be displayed?

Specified by:
isActive in interface VisualConstraint
Returns:
true iff this constraint should be displayed

addStatusListener

public void addStatusListener(ConstraintStatusListener l)

removeStatusListener

public void removeStatusListener(ConstraintStatusListener l)

getType

public TimeParameterOrdering.Type getType()
Returns:
Returns the type.

setType

public void setType(TimeParameterOrdering.Type type)
Parameters:
type - The type to set.

getMaxSlack

public int getMaxSlack()
Returns:
Returns the maxSlack.

setMaxSlack

public void setMaxSlack(int maxSlack)
Parameters:
maxSlack - The maxSlack to set.

getMinSlack

public int getMinSlack()
Returns:
Returns the minSlack.

setMinSlack

public void setMinSlack(int minSlack)
Parameters:
minSlack - The minSlack to set.