public class IlpPolyline extends IlpPolyPoints implements Shape, IlpPosition, Cloneable
Constructor and Description |
---|
IlpPolyline(IlpPolyline orig)
Creates a new polyline from a given one.
|
IlpPolyline(IlpPolyline orig,
IlvTransformer t,
boolean removeRedundant)
Creates a new
IlpPolyline instance, connecting the
given points and considering that the given transformer is applied. |
IlpPolyline(IlvPoint[] points)
Creates a new
IlpPolyline instance, connecting given
points. |
IlpPolyline(IlvPoint[] points,
boolean removeRedundant)
Creates a new
IlpPolyline instance, connecting given
points. |
IlpPolyline(IlvPoint[] points,
IlvTransformer t,
boolean removeRedundant)
Creates a new
IlpPolyline instance, connecting the
given points and considering that the given transformer is applied. |
IlpPolyline(IlvPoint from,
IlvPoint to)
Creates a new
IlpPolyline instance. |
Modifier and Type | Method and Description |
---|---|
IlvPoint[] |
adjustForArrow(IlpLineSegment segment,
double arrowSize,
double width)
Returns the points necessary to add to the polyline to draw an arrow at
one extremity of the link.
|
void |
adjustForFromArrow(double arrowSize,
double width)
Adds one or two points depending on the shape of the polyline, which can
then be used to draw a link with an arrow at the from end.
|
void |
adjustForToArrow(double arrowSize,
double width)
Adds one or two points depending on the shape of the polyline, which can
then be used to draw a link with an arrow at the to end.
|
void |
applyTransform(IlvTransformer t)
Applies a transform to the points, thereby destructively modifying the
polyline and its segments.
|
Object |
clone()
Creates a copy of this polyline.
|
IlpPolyline |
computeParallel(double apart,
double miterlimit)
Returns a parallel polyline.
|
IlpPolyline |
computeParallel(double apart,
double miterlimit,
boolean reverse)
Returns a parallel polyline.
|
ilog.cpl.graphic.views.internal.IlpPolyTwoPolylines |
computeThickLinkShape(double thickness,
double miterlimit)
Returns the two polylines bounding the result of blowing up this
polyline to a given thickness.
|
boolean |
contains(double x,
double y) |
boolean |
contains(double x,
double y,
double width,
double height) |
boolean |
contains(Point2D p) |
boolean |
contains(Rectangle2D r) |
IlvPoint |
getFrom()
Returns the starting point of the polyline.
|
ilog.cpl.graphic.views.internal.IlpPolyPointAndDirection |
getMedian()
Returns the "midpoint" of the polyline, and the direction of the
segment containing it.
|
protected ilog.cpl.graphic.views.internal.IlpPolyPointAndDirection |
getMedian(double roundingThreshold)
Returns the "midpoint" of the polyline, and the direction of the
segment containing it.
|
int |
getNumberOfPoints()
Returns the number of points in the polyline.
|
PathIterator |
getPathIterator(AffineTransform transform) |
PathIterator |
getPathIterator(AffineTransform at,
double flatness) |
IlvPoint |
getTo()
Returns the end point of the polyline.
|
void |
insertPoint(IlvPoint p)
Inserts a point into the nearest segment.
|
void |
insertPoint(int index,
IlvPoint p)
Inserts a point into a specific segment.
|
boolean |
intersects(double x,
double y,
double width,
double height) |
boolean |
intersects(Rectangle2D r) |
void |
movePoint(int index,
IlvPoint p)
Moves a specific point to a new location.
|
void |
removePoint(int index)
Removes a specific point.
|
void |
removeRedundantPoints()
Removes all redundant points (points which are between their neighbors).
|
void |
reverse()
Reverses the order of the points, the order of the segments, and the
directions of the segments.
|
equals, getBounds, getBounds2D, getClosestSegment, getGravity0, getGravity1, getNumberOfSegments, getPoint, getPoints, getPointsCloned, getSegment, getSegments, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
getBounds, getBounds2D
public IlpPolyline(IlvPoint from, IlvPoint to)
IlpPolyline
instance. The segments
must be added afterwards.public IlpPolyline(IlpPolyline orig)
public IlpPolyline(IlvPoint[] points, boolean removeRedundant)
IlpPolyline
instance, connecting given
points.points
- A non-empty array of points.removeRedundant
- Indicates whether redundant points shall be removed.public IlpPolyline(IlvPoint[] points)
IlpPolyline
instance, connecting given
points.points
- A non-empty array of points.public IlpPolyline(IlpPolyline orig, IlvTransformer t, boolean removeRedundant)
IlpPolyline
instance, connecting the
given points and considering that the given transformer is applied.public IlpPolyline(IlvPoint[] points, IlvTransformer t, boolean removeRedundant)
IlpPolyline
instance, connecting the
given points and considering that the given transformer is applied.public IlvPoint getFrom()
public IlvPoint getTo()
public Object clone()
clone
in class IlpPolyPoints
public int getNumberOfPoints()
getNumberOfPoints
in class IlpPolyPoints
public boolean contains(double x, double y)
public boolean contains(Point2D p)
public boolean intersects(double x, double y, double width, double height)
intersects
in interface Shape
public boolean intersects(Rectangle2D r)
intersects
in interface Shape
public boolean contains(double x, double y, double width, double height)
public boolean contains(Rectangle2D r)
public PathIterator getPathIterator(AffineTransform transform)
getPathIterator
in interface Shape
public PathIterator getPathIterator(AffineTransform at, double flatness)
getPathIterator
in interface Shape
public ilog.cpl.graphic.views.internal.IlpPolyPointAndDirection getMedian()
getMedian
in class IlpPolyPoints
protected ilog.cpl.graphic.views.internal.IlpPolyPointAndDirection getMedian(double roundingThreshold)
public IlpPolyline computeParallel(double apart, double miterlimit)
apart
- Distance (positive for a parallel polyline to the right
of the polyline, negative for a parallel polyline to the left of the
polyline).miterlimit
- see comments in class IltGraphicUtilpublic IlpPolyline computeParallel(double apart, double miterlimit, boolean reverse)
apart
- Distance (positive for a parallel polyline to the right
of the polyline, negative for a parallel polyline to the left of the
polyline).miterlimit
- see comments in class IltGraphicUtilreverse
- Whether to reverse the orientation of the resulting polyline.public ilog.cpl.graphic.views.internal.IlpPolyTwoPolylines computeThickLinkShape(double thickness, double miterlimit)
computeThickLinkShape
in class IlpPolyPoints
miterlimit
- see comments in class IltGraphicUtilpublic void applyTransform(IlvTransformer t)
applyTransform
in class IlpPolyPoints
public void reverse()
reverse
in class IlpPolyPoints
public void insertPoint(int index, IlvPoint p)
insertPoint
in class IlpPolyPoints
index
- Satisfies -1 <= index <= getNumberOfSegments().
index = -1
means to add the point as a new
"from" end; index = getNumberOfSegments()
means to add the point as a new "to" end.p
- The point to be inserted.public void insertPoint(IlvPoint p)
insertPoint
in class IlpPolyPoints
public void movePoint(int index, IlvPoint p)
movePoint
in class IlpPolyPoints
index
- Satisfies 0 <= index < getNumberOfPoints().p
- The point to be moved.public void removePoint(int index)
removePoint
in class IlpPolyPoints
index
- Satisfies 0 <= index < getNumberOfPoints().public void removeRedundantPoints()
removeRedundantPoints
in class IlpPolyPoints
public void adjustForFromArrow(double arrowSize, double width)
arrowSize
- Length of the arrow in pixels.width
- Width of the arrow in pixels.public void adjustForToArrow(double arrowSize, double width)
arrowSize
- Length of the arrow in pixels.width
- Width of the arrow in pixels.public IlvPoint[] adjustForArrow(IlpLineSegment segment, double arrowSize, double width)
segment
- Oriented segment that is one end of the link. Will be
replaced with an arrow.arrowSize
- Length of the arrow in pixels.width
- Width of the arrow in pixels.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.