easik.sketch.constraint
Class CommutativeDiagram

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

public class CommutativeDiagram
extends Constraint

The commutative diagram is a constraint made up of two lists (Arrays) of sketch edges. These two lists should share a domain and codomain.

Version:
2006-06-13 Kevin Green
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
CommutativeDiagram(java.util.ArrayList<SketchPath> inPaths, int x, int y, boolean isVisible)
          Creates a commutative diagram from an ArrayList of paths.
CommutativeDiagram(SketchPath pathA, SketchPath pathB)
          Creates a commutative diagram from two paths.
CommutativeDiagram(SketchPath pathA, SketchPath pathB, int x, int y, boolean isVisible)
          Creates a commutative diagram from two path.
 
Method Summary
 SketchPath getPathA()
          Return the first path
 SketchPath getPathB()
          Return the second path
static boolean isCommutativeDiagram(SketchPath pathA, SketchPath pathB)
          Checks whether the current selected paths form a commutative diagram.
 
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

CommutativeDiagram

public CommutativeDiagram(java.util.ArrayList<SketchPath> inPaths,
                          int x,
                          int y,
                          boolean isVisible)
Creates a commutative diagram from an ArrayList of paths. The ArrayList should contain only two paths. Also sets details of the visual representation.

Parameters:
inPaths - ArrayList that should contain only the two paths used for the commutative diagram
x - x coordinate
y - y coordinate
isVisible - If true the constraint will be shown in the graph, otherwise it will not be visible.

CommutativeDiagram

public CommutativeDiagram(SketchPath pathA,
                          SketchPath pathB)
Creates a commutative diagram from two paths.

Parameters:
pathA - The first path.
pathB - The second path.

CommutativeDiagram

public CommutativeDiagram(SketchPath pathA,
                          SketchPath pathB,
                          int x,
                          int y,
                          boolean isVisible)
Creates a commutative diagram from two path. Also sets details of the visual representation.

Parameters:
pathA - The first path
pathB - The second path
x - x coordinate
y - y coordinate
isVisible - If true the constraint will be shown in the graph, otherwise it will not be visible.
Method Detail

getPathA

public SketchPath getPathA()
Return the first path

Returns:
The first path

getPathB

public SketchPath getPathB()
Return the second path

Returns:
The second path

isCommutativeDiagram

public static boolean isCommutativeDiagram(SketchPath pathA,
                                           SketchPath pathB)
Checks whether the current selected paths form a commutative diagram. This is determined by checking whether the two paths participating in the commutative diagram have the same domain and codomain.

Parameters:
pathA - The first path participating in the commutative diagram
pathB - the second path participating in the commutative diagram
Returns:
True if it forms a commutative diagram, false otherwise
Since:
2006-05-25 Vera Ranieri