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 DiagramWorkflowRelationship |
rel |
protected int |
type |
protected static int |
VERTICAL |
protected int |
x1 |
protected int |
x2 |
protected int |
y1 |
protected int |
y2 |
Constructor and Description |
---|
Line(DiagramWorkflowRelationship 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
|
DiagramWorkflowRelationship |
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 whether or not the 2 lines overlap
|
java.lang.String |
toString()
Returns the string representation of the line
|
protected int x1
protected int x2
protected int y1
protected int y2
protected int type
protected DiagramWorkflowRelationship rel
protected static final int HORIZONTAL
protected static final int VERTICAL
protected static final int OTHER
protected static final int CLOSE
public Line(DiagramWorkflowRelationship 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 DiagramWorkflowRelationship getRelationship()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- The object to compare topublic 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