se.liu.ida.critiquer.constraints
Class TimeParameterOrdering
java.lang.Object
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
TimeParameterOrdering
public TimeParameterOrdering(TimeParameter t1Param,
TimeParameter t2Param,
TimeParameterOrdering.Type type)
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.