se.liu.ida.critiquer.constraints
Class ConstraintFactory

java.lang.Object
  extended by se.liu.ida.critiquer.constraints.ConstraintFactory

public class ConstraintFactory
extends Object


Constructor Summary
ConstraintFactory()
           
 
Method Summary
static TimeParameterOrdering connectEndToEnd(Activity parent, Activity child)
          Used when creating a sub-activity that is supposed to be performed within the time frame of the parent activity.
static TimeParameterOrdering connectEndToStart(Activity a1, Activity a2)
          Connect two activities to form a sequence.
static TimeParameterOrdering connectStartToEnd(Activity a)
          Make sure the activity is internally consistent so that start always comes before end
static TimeParameterOrdering connectStartToStart(Activity a1, Activity a2)
          Used when creating a sub-activity that is supposed to be performed within the time frame of the parent activity.
static TimeParameterOrdering createLaterThanConstraint(TimeParameter endtimeA1, TimeParameter starttimeA2, TimeParameterOrdering.Type type, ConstraintPolicy policy)
           
static void createSingletonConstraint(Class constraintClass, boolean enabled)
          Visual constraints that are only supposed to be created once are created here.
static SingletonConstraint getSingletonConstraint(Class visualConstraintClass)
           
static VisualConstraint getVisualConstraint(Class visualConstraintClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintFactory

public ConstraintFactory()
Method Detail

getVisualConstraint

public static VisualConstraint getVisualConstraint(Class visualConstraintClass)

getSingletonConstraint

public static SingletonConstraint getSingletonConstraint(Class visualConstraintClass)

createLaterThanConstraint

public static TimeParameterOrdering createLaterThanConstraint(TimeParameter endtimeA1,
                                                              TimeParameter starttimeA2,
                                                              TimeParameterOrdering.Type type,
                                                              ConstraintPolicy policy)

createSingletonConstraint

public static void createSingletonConstraint(Class constraintClass,
                                             boolean enabled)
Visual constraints that are only supposed to be created once are created here. The ones that need to be updated when parameter values change should inherit from StandardConstraint so that they are added to the list of activity update listeners through the default constructor of that class.

Parameters:
constraintClass -
enabled -

connectStartToStart

public static TimeParameterOrdering connectStartToStart(Activity a1,
                                                        Activity a2)
Used when creating a sub-activity that is supposed to be performed within the time frame of the parent activity. This constraint makes sure the child activity cannot start before the parent activity.

Parameters:
a1 - the parent activity
a2 - the child activity
Returns:
a time parameter ordering constraint

connectEndToEnd

public static TimeParameterOrdering connectEndToEnd(Activity parent,
                                                    Activity child)
Used when creating a sub-activity that is supposed to be performed within the time frame of the parent activity. This constraint ensures taht the child activity cannot end after the parent activity.

Parameters:
parent - the parent activity
child - the child activity
Returns:
a time parameter ordering constraint

connectStartToEnd

public static TimeParameterOrdering connectStartToEnd(Activity a)
Make sure the activity is internally consistent so that start always comes before end

Parameters:
a -
Returns:
a parameter order constraint

connectEndToStart

public static TimeParameterOrdering connectEndToStart(Activity a1,
                                                      Activity a2)
Connect two activities to form a sequence.

Parameters:
a1 - the activity that should be performed first
a2 - the activity that should come second
Returns:
an ordering constraint that assures that activity a1 comes before a2