public class XyPolylineBuilder
extends java.lang.Object
This class gives you a straightforward method of accumulating vertices for a polyline. It has a few extra conveniences over a raw XyDynamicPointArray. For example, you can set a minimum segment length, and it will discard points given if they are not at least that far away from the previous point.
Copyright 2007 Partner Software, Inc.
| Constructor and Description |
|---|
XyPolylineBuilder() |
| Modifier and Type | Method and Description |
|---|---|
void |
append(double... coords)
Appends coordinates, which must be in the order x1, y1, x2, y2, etc.
|
void |
append(double[] coords,
int start,
int size)
Appends coordinates, which must be in the order x1, y1, x2, y2, etc.
|
void |
append(XyPoint point)
Adds a new point, if it is different from the current last point.
|
void |
append(XyPolyline polyline)
Appends all the points in the given polyline.
|
void |
clear()
Clears the current points, so that we start fresh.
|
double |
getMinimumSegmentLength()
Get the current minimum segment length setting.
|
int |
getPointCount() |
XyPolyline |
getPolyline()
Returns the constructed XyPolyline, or null if there were not enough
points to build one.
|
boolean |
isEmpty()
Returns true if there are no points appended to this builder.
|
void |
setMinimumSegmentLength(double newLength)
Sets the current minimum segment length.
|
public void append(XyPoint point)
public void append(XyPolyline polyline)
public void append(double... coords)
public void append(double[] coords,
int start,
int size)
public XyPolyline getPolyline()
public void clear()
public boolean isEmpty()
public int getPointCount()
public double getMinimumSegmentLength()
public void setMinimumSegmentLength(double newLength)