|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jfimagine.jfgraph.geom.LineSeg
|
+--com.jfimagine.jfgraph.geom.LabelLine
LabelLine class. A class used to represent a line to describe the size of shapes.
Attention: Here we used a clockwise quadrant system. And the first quadrant is under right bottom corner.
| Field Summary | |
int |
CTRL_POINT_LEN
A default minimum length of each ctrl point to end point of label line. |
| Constructor Summary | |
LabelLine()
Constructor for LabelLine. |
|
LabelLine(double x1,
double y1,
double x2,
double y2)
Constructor for LabelLine. |
|
LabelLine(JFPoint startPoint,
JFPoint endPoint)
Constructor for LabelLine. |
|
LabelLine(LabelLine line)
Constructor for LabelLine. |
|
| Method Summary | |
java.lang.Object |
clone()
Creates a new object of the same class and with the same contents as this object. |
boolean |
contains(double x,
double y,
double pickOffset)
Test if a point(x, y coordinates for instead) is on this line. |
boolean |
equals(java.lang.Object obj)
Determines whether or not two objects are equal. |
void |
flipBy(double baseY)
Reverse this line by a y coordinate. |
Rect |
getBounds()
Get the bounds of this line segment. |
boolean |
getCtrl1Direction()
1)Get the direction that the vector from start point to control point1 compares to the vector from start point to end point. 2)False if counter-clockwise, true if clockwise. 3)If ctrl1Direction is under counter-clockwise, then: ctrl2 is under clockwise, ctrl3 is under counter-clockwise, ctrl4 is under clockwise. 4)If reverse or mirror this label line, each direction will be ! |
double |
getCtrl1Len()
Get the length of control point1 to start point. |
double |
getCtrl2Len()
Get the length of control point2 to start point. |
double |
getCtrl3Len()
Get the length of control point3 to end point. |
double |
getCtrl4Len()
Get the length of control point4 to end point. |
JFPoint |
getCtrlPoint1()
Get the coordinates of control point1. |
JFPoint |
getCtrlPoint2()
Get the coordinates of control point2. |
JFPoint |
getCtrlPoint3()
Get the coordinates of control point3. |
JFPoint |
getCtrlPoint4()
Get the coordinates of control point4. |
int |
hashCode()
Returns the hashcode for this Object. |
boolean |
intersects(double x1,
double y1,
double x2,
double y2)
Tests if the specified line segment intersects this LabelLine. |
boolean |
intersects(Rect rect)
Tests if the specified rectangle intersects the interior of this LineSeg. |
void |
mirrorBy(double baseX)
Mirror this line by a x coordinate. |
void |
setCtrl1Direction(boolean direction)
Set the direction that the vector from start point to control point1 compares to the vector from start point to end point. |
void |
setCtrl1Len(double len)
Set the length of control point1 to start point. |
void |
setCtrl2Len(double len)
Set the length of control point2 to start point. |
void |
setCtrl3Len(double len)
Set the length of control point3 to end point. |
void |
setCtrl4Len(double len)
Set the length of control point4 to end point. |
void |
setCtrlPoint1(double x,
double y)
Set the coordinates of control point1. |
void |
setCtrlPoint1(JFPoint pnt)
Set the coordinates of control point1. |
void |
setCtrlPoint2(double x,
double y)
Set the coordinates of control point2. |
void |
setCtrlPoint2(JFPoint pnt)
Set the coordinates of control point2. |
void |
setCtrlPoint3(double x,
double y)
Set the coordinates of control point3. |
void |
setCtrlPoint3(JFPoint pnt)
Set the coordinates of control point3. |
void |
setCtrlPoint4(double x,
double y)
Set the coordinates of control point4. |
void |
setCtrlPoint4(JFPoint pnt)
Set the coordinates of control point4. |
void |
setValue(LabelLine line)
Set a label line's value by a new label line. |
java.lang.String |
toString()
Convert this object to String |
| Methods inherited from class com.jfimagine.jfgraph.geom.LineSeg |
closeTo, contains, contains, contains, distance, distance, flipBy, getCenter, getLength, getLength, getLength, getPoint1, getPoint2, getSlope, getSlope, getSlope, getSlope, getX1, getX2, getY1, getY2, intersects, intersects, intersectsAt, intersectsAt, mirrorBy, moveBy, rotateBy, rotateBy, rotateBy, sameLinePoints, sameLinePoints, scaleBy, scaleBy, scaleBy, scaleBy, setPoint1, setPoint1, setPoint2, setPoint2, setValue, setValue, setValue, setX1, setX2, setY1, setY2, uprightFoot, uprightFoot |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final int CTRL_POINT_LEN
| Constructor Detail |
public LabelLine()
public LabelLine(double x1,
double y1,
double x2,
double y2)
public LabelLine(JFPoint startPoint,
JFPoint endPoint)
startPoint - The first endpoint.endPoint - The second endpoint.public LabelLine(LabelLine line)
| Method Detail |
public boolean getCtrl1Direction()
public void setCtrl1Direction(boolean direction)
direction - A new direction.public double getCtrl1Len()
public void setCtrl1Len(double len)
len - the lengh of ctrl point1 to start pointpublic JFPoint getCtrlPoint1()
public void setCtrlPoint1(JFPoint pnt)
pnt - A new coordinates of control point1.
public void setCtrlPoint1(double x,
double y)
public double getCtrl2Len()
public void setCtrl2Len(double len)
len - the lengh of ctrl point3 to start pointpublic JFPoint getCtrlPoint2()
public void setCtrlPoint2(JFPoint pnt)
pnt - A new coordinates of control point2.
public void setCtrlPoint2(double x,
double y)
public double getCtrl3Len()
public void setCtrl3Len(double len)
len - the lengh of ctrl point3 to end point.public JFPoint getCtrlPoint3()
public void setCtrlPoint3(JFPoint pnt)
pnt - A new coordinates of control point3.
public void setCtrlPoint3(double x,
double y)
public double getCtrl4Len()
public void setCtrl4Len(double len)
len - the lengh of ctrl point4 to end point.public JFPoint getCtrlPoint4()
public void setCtrlPoint4(JFPoint pnt)
pnt - A new coordinates of control point4.
public void setCtrlPoint4(double x,
double y)
public void setValue(LabelLine line)
line - A new label line.public Rect getBounds()
getBounds in class LineSegpublic void mirrorBy(double baseX)
mirrorBy in class LineSegbaseX - A mirror base x coordinate.public void flipBy(double baseY)
flipBy in class LineSegbaseY - A flip base y coordinate.
public boolean contains(double x,
double y,
double pickOffset)
contains in class LineSegx - X coordinate of this point.y - Y coordinate of this point.
public boolean intersects(double x1,
double y1,
double x2,
double y2)
LabelLine.
intersects in class LineSegtrue if the specified line segment intersects
the this LabelLine; false
otherwise.public boolean intersects(Rect rect)
LineSeg.
intersects in class LineSegrect - the specified Rect to test for intersection
with the interior of this LineSeg
true if the specified Rect
intersects the interior of this LineSeg;
false otherwise.public java.lang.String toString()
toString in class LineSeg
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class LineSegjava.lang.CloneNotSupportedExceptionpublic int hashCode()
hashCode in class LineSegpublic boolean equals(java.lang.Object obj)
equals in class LineSegobj - an object to be compared with this object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||