easik.sketch.constraint
Class ProductConstraint

java.lang.Object
  extended by easik.sketch.vertex.SketchVertex
      extended by easik.sketch.constraint.Constraint
          extended by easik.sketch.constraint.ProductConstraint

public class ProductConstraint
extends Constraint

Represents the product constraint. Contains a list of paths which all share a source.

Version:
2006-05-25 Vera Ranieri
Author:
Kevin Green 2006, Vera Ranieri 2006

Field Summary
 
Fields inherited from class easik.sketch.constraint.Constraint
_constraintLabel, _constraintNode, _edges, _isVisible, _paths, _visuals
 
Fields inherited from class easik.sketch.vertex.SketchVertex
_marked, _name, _posX, _posY
 
Constructor Summary
ProductConstraint(java.util.ArrayList<SketchPath> inPaths)
          Product constraint constructor.
ProductConstraint(java.util.ArrayList<SketchPath> inPaths, int x, int y, boolean isVisible)
          Product constraint constructor.
 
Method Summary
static boolean isProductConstraint(java.util.ArrayList paths)
          Method to determine whether a given set of paths could legally create a product constraint.
 void setPaths(java.util.ArrayList<SketchPath> inPaths)
          Sets the path array, updates edge list, and updates display
 
Methods inherited from class easik.sketch.constraint.Constraint
addEdges, addVisualsToSketch, getEdges, getNode, getPaths, getTablesInvolvedForError, getType, hasEdge, isDomainOrCoDomain, isVisible, setAllConstraintsVisible, setNode, setVisible, toString
 
Methods inherited from class easik.sketch.vertex.SketchVertex
getMarked, getName, getX, getY, setMarked, setName, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProductConstraint

public ProductConstraint(java.util.ArrayList<SketchPath> inPaths)
Product constraint constructor. Accepts an ArrayList that can have any number of paths. Gives default coordinates.

Parameters:
inPaths - An ArrayList of SketchPaths

ProductConstraint

public ProductConstraint(java.util.ArrayList<SketchPath> inPaths,
                         int x,
                         int y,
                         boolean isVisible)
Product constraint constructor. Accepts coordinates in constructor to allow for user-defined visual placement.

Parameters:
inPaths - An ArrayList of SketchPaths
x - X coordinate of visual on graph
y - Y coordinate of visual on graph
isVisible - If the constraint is visible in the graph or not
Method Detail

setPaths

public void setPaths(java.util.ArrayList<SketchPath> inPaths)
Sets the path array, updates edge list, and updates display

Parameters:
inPaths - The new array of paths

isProductConstraint

public static boolean isProductConstraint(java.util.ArrayList paths)
Method to determine whether a given set of paths could legally create a product constraint.

Parameters:
paths - The paths potentially involved in a product constraint
Returns:
True if a legal path configuration, false otherwise
Since:
2006-05-25 Vera Ranieri