|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteasik.sketch.vertex.SketchVertex
easik.sketch.constraint.Constraint
public abstract class Constraint
This is the superclass for all constraints. Constraints get a non-unique label that shows what kind of constraint it is (symbolically) and have a set of paths which it deals with.
Field Summary | |
---|---|
protected java.lang.String |
_constraintLabel
The label on the constraint |
protected javax.swing.tree.DefaultMutableTreeNode |
_constraintNode
The DefaultMutableTreeNode respresentation of this constraint |
protected java.util.ArrayList<SketchEdge> |
_edges
The edge involved in the constraint |
protected boolean |
_isVisible
Stores whether the constraint is visible or not |
protected java.util.ArrayList<SketchPath> |
_paths
The paths involved in the constraint |
protected java.util.ArrayList<GuideEdge> |
_visuals
The Guide Edges of the constraint |
Fields inherited from class easik.sketch.vertex.SketchVertex |
---|
_marked, _name, _posX, _posY |
Constructor Summary | |
---|---|
Constraint()
Default constructor needed for subclasses |
|
Constraint(java.lang.String name,
int x,
int y,
boolean isVisible)
Creates a very simple constraint node. |
Method Summary | |
---|---|
protected void |
addEdges()
Adds all edges participating in this constraint to an arraylist of edges. |
void |
addVisualsToSketch(org.jgrapht.graph.ListenableDirectedGraph<SketchVertex,org.jgrapht.graph.DefaultEdge> inGraph,
SketchAdapter adapter)
Adds the visual aids to the sketch provided |
java.util.ArrayList<SketchEdge> |
getEdges()
Returns the edges dealt with in the constraint. |
javax.swing.tree.DefaultMutableTreeNode |
getNode()
Returns the node used to display the constraint in the tree |
java.util.ArrayList<SketchPath> |
getPaths()
Returns the set of the paths involved in the constraint |
static java.lang.String |
getTablesInvolvedForError(java.util.ArrayList<SketchPath> paths)
Determines the entities involved in a constraint and lists them for an error message. |
java.lang.String |
getType()
Returns a string corresponding to the constraint type. |
boolean |
hasEdge(SketchEdge inEdge)
Checks to see if the constraint contains a path that uses an edge |
boolean |
isDomainOrCoDomain(EntityNode inEntity)
Tests to see if an entity is either the domain or co-domain of any of the paths involved in the constraint |
boolean |
isVisible()
Returns if the constraint is visible or not (True = visible) |
static void |
setAllConstraintsVisible(java.util.LinkedList<Constraint> constraints,
boolean show)
Sets all constraints to visible/invisible in the sketch. |
void |
setNode(javax.swing.tree.DefaultMutableTreeNode inNode)
Sets the node used to display the constraint in the tree |
void |
setVisible(boolean inIsVisible)
Sets if the constraint should be visible or not |
java.lang.String |
toString()
Accessor for the constraint label |
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 |
Field Detail |
---|
protected java.lang.String _constraintLabel
protected java.util.ArrayList<SketchPath> _paths
protected java.util.ArrayList<SketchEdge> _edges
protected javax.swing.tree.DefaultMutableTreeNode _constraintNode
protected boolean _isVisible
protected java.util.ArrayList<GuideEdge> _visuals
Constructor Detail |
---|
public Constraint()
public Constraint(java.lang.String name, int x, int y, boolean isVisible)
name
- The label on the nodex
- x coordinatey
- y coordinateisVisible
- If the constraint is visible in the graph or notMethod Detail |
---|
public boolean isVisible()
public void setVisible(boolean inIsVisible)
inIsVisible
- If the constraint should be visible or not.public void addVisualsToSketch(org.jgrapht.graph.ListenableDirectedGraph<SketchVertex,org.jgrapht.graph.DefaultEdge> inGraph, SketchAdapter adapter)
inGraph
- The graph which will be getting the visual aidsadapter
- The adapter between the graph and the sketchpublic boolean isDomainOrCoDomain(EntityNode inEntity)
inEntity
- The entity to be tested
protected void addEdges()
public java.lang.String toString()
toString
in class SketchVertex
public boolean hasEdge(SketchEdge inEdge)
inEdge
- The edge to check against.
public java.util.ArrayList<SketchEdge> getEdges()
public java.util.ArrayList<SketchPath> getPaths()
public java.lang.String getType()
public void setNode(javax.swing.tree.DefaultMutableTreeNode inNode)
inNode
- The node used to display the constraint in the treepublic javax.swing.tree.DefaultMutableTreeNode getNode()
public static void setAllConstraintsVisible(java.util.LinkedList<Constraint> constraints, boolean show)
constraints
- The list of constraints.show
- true if constraints are to be set to visible, false otherwisepublic static java.lang.String getTablesInvolvedForError(java.util.ArrayList<SketchPath> paths)
paths
- The paths forming the constraint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |