public class Line
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
protected static int |
CLOSE
Distance in pixels to be close to the line
|
protected static int |
HORIZONTAL |
protected static int |
OTHER |
protected WorkflowRelationship |
rel |
protected int |
type |
protected static int |
VERTICAL |
protected int |
x1 |
protected int |
x2 |
protected int |
y1 |
protected int |
y2 |
Constructor and Description |
---|
Line(WorkflowRelationship rel,
int x1,
int y1,
int x2,
int y2)
Constructs a line
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o)
Compares 2 relationships for the Comparable interface
|
boolean |
equals(java.lang.Object o) |
WorkflowRelationship |
getRelationship()
Returns the relationship
|
int |
getType()
Returns the line type
|
java.awt.Point |
intersect(Line line)
Returns the intersets point of 2 lines
|
boolean |
isClose(java.awt.Point point)
Returns true if the point is close to the line
|
boolean |
overlap(Line line)
Returns whetehr or not the 2 lines overlap
|
java.lang.String |
toString()
Returns the string representatio of the line
|
protected int x1
protected int x2
protected int y1
protected int y2
protected int type
protected WorkflowRelationship rel
protected static final int HORIZONTAL
protected static final int VERTICAL
protected static final int OTHER
protected static final int CLOSE
public Line(WorkflowRelationship rel, int x1, int y1, int x2, int y2)
rel
- The workflow realtionship the line belongs tox1
- The starting x-ccordinatey1
- The starting y-ccordinatex2
- The ending x-ccordinatey2
- The ending x-ccordinatepublic int getType()
public WorkflowRelationship getRelationship()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- The object to compare topublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean isClose(java.awt.Point point)
point
- The point to testpublic boolean overlap(Line line)
line
- The line to find overlap withpublic java.awt.Point intersect(Line line)
line
- The line to find intersection withpublic java.lang.String toString()
toString
in class java.lang.Object