public class Line
extends java.lang.Object
implements java.lang.Comparable
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
|
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