|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.geom.Line2D
ilog.cpl.graphic.views.IlpLineSegment
public class IlpLineSegment
This class describes a line segment.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom.Line2D |
|---|
Line2D.Double, Line2D.Float |
| Constructor Summary | |
|---|---|
IlpLineSegment(IlvPoint from,
IlvPoint to)
Creates a new line segment, connecting two points. |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a copy of this object. |
Rectangle2D |
getBounds2D()
Returns the smallest rectangle covering all points. |
int |
getDirection()
Returns the direction of this line segment. |
IlvPoint |
getFrom()
Returns the starting point of this segment. |
int |
getOrientation()
Returns the orientation of this line segment. |
Point2D |
getP1()
Returns the starting point. |
Point2D |
getP2()
Returns the end point. |
IlvPoint |
getTo()
Returns the end point of this segment. |
double |
getX1()
Returns the X coordinate of the starting point. |
double |
getX2()
Returns the X coordinate of the end point. |
double |
getY1()
Returns the Y coordinate of the starting point. |
double |
getY2()
Returns the Y coordinate of the end point. |
boolean |
intersects(double x1,
double y1,
double x2,
double y2)
Tests whether this segment intersects a given rectangle x1 <= x <= x2, y1 <= y <= y2. |
boolean |
intersects(float x1,
float y1,
float x2,
float y2)
Tests whether this segment intersects a given rectangle x1 <= x <= x2, y1 <= y <= y2. |
boolean |
isParallelTo(IlpLineSegment other)
Tests whether this line segment is parallel to another line segment (same orientation). |
boolean |
isParallelVectorTo(IlpLineSegment other)
Tests whether this line segment is parallel to another line segment including the same direction. |
float |
length()
Returns the Euclidean length of this segment. |
IlvPoint |
nearestTo(IlvPoint p)
Returns the point in this segment which is closest to a given point. |
protected void |
setFrom(IlvPoint p)
Sets the starting point of this segment. |
void |
setLine(double x1,
double y1,
double x2,
double y2)
Constructs and initializes a line from the specified coordinates. |
protected void |
setTo(IlvPoint p)
Sets the end point of this segment. |
float |
sqdist(IlvPoint p)
Returns the square of the distance of a given point to this segment. |
String |
toString()
|
protected void |
transientInit()
Initialize transient fields. |
| Methods inherited from class java.awt.geom.Line2D |
|---|
contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlpLineSegment(IlvPoint from,
IlvPoint to)
| Method Detail |
|---|
protected void transientInit()
public IlvPoint getFrom()
protected void setFrom(IlvPoint p)
p - Starting pointpublic IlvPoint getTo()
protected void setTo(IlvPoint p)
p - End pointpublic int getOrientation()
0, or IlvDirection.Horizontal
or IlvDirection.Vertical, or (for an empty segment)
the combination of IlvDirection.Horizontal and
IlvDirection.Vertical.
public int getDirection()
IlvDirection.Right,
IlvDirection.Left, IlvDirection.Bottom,
IlvDirection.Top, or (for an empty segment)
the combination of IlvDirection.Horizontal and
IlvDirection.Vertical.
public float length()
public IlvPoint nearestTo(IlvPoint p)
public float sqdist(IlvPoint p)
public boolean intersects(float x1,
float y1,
float x2,
float y2)
public boolean intersects(double x1,
double y1,
double x2,
double y2)
intersects in interface Shapeintersects in class Line2Dpublic boolean isParallelTo(IlpLineSegment other)
public boolean isParallelVectorTo(IlpLineSegment other)
public Object clone()
clone in class Line2Dpublic double getX1()
getX1 in class Line2Dpublic double getY1()
getY1 in class Line2Dpublic double getX2()
getX2 in class Line2Dpublic double getY2()
getY2 in class Line2Dpublic Point2D getP1()
getP1 in class Line2Dpublic Point2D getP2()
getP2 in class Line2D
public void setLine(double x1,
double y1,
double x2,
double y2)
setLine in class Line2Dpublic Rectangle2D getBounds2D()
getBounds2D in interface ShapeIlvRect object.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||