Polyline
geometries incrementally.
Polyline geometries are immutable and cannot be changed directly once created. The polyline builder allows you
to change the contents of the shape by using the mutable PartCollection
that is accessible from
MultipartBuilder.getParts()
. Each Part
, in the collection, comprises a collection of segments that
make the Part
. You can add or remove a Part
from the PartCollection
, or you can
create a new or edit the segment vertices of an existing Part
. Use GeometryBuilder.toGeometry()
to return the new Polyline
from the builder.
- Since:
- 100.0.0
-
Constructor Summary
ConstructorDescriptionPolylineBuilder
(Part part) Creates a new PolylineBuilder containing the given Part.PolylineBuilder
(PartCollection parts) Creates a new PolylineBuilder containing the Parts in the given PartCollection.PolylineBuilder
(PartCollection parts, SpatialReference spatialReference) Creates a new PolylineBuilder containing the Parts in the given PartCollection, and with the given SpatialReference.PolylineBuilder
(Part part, SpatialReference spatialReference) Creates a new PolylineBuilder containing the given Part, and with the given SpatialReference.PolylineBuilder
(PointCollection points) Creates a new PolylineBuilder containing a copy of the Points in the given PointCollection.PolylineBuilder
(PointCollection points, SpatialReference spatialReference) Creates a new PolylineBuilder containing a copy of the Points in the given PointCollection, and with the given SpatialReference.PolylineBuilder
(Polyline polyline) Creates a new polyline builder by copying the parts from the specifiedPolyline
.PolylineBuilder
(SpatialReference spatialReference) Creates a new empty polyline builder with the specifiedSpatialReference
. -
Method Summary
Modifier and TypeMethodDescriptionReturns a new Polyline based on the current state of this builder.Methods inherited from class com.esri.arcgisruntime.geometry.MultipartBuilder
addPart, addPart, addPart, addParts, addPoint, addPoint, addPoint, addPoints, addPointsToPart, addPointToPart, getParts, replaceGeometry
Methods inherited from class com.esri.arcgisruntime.geometry.GeometryBuilder
create, create, getBuilderType, getExtent, getSpatialReference, hasCurves, hasM, hasZ, isEmpty, isSketchValid
-
Constructor Details
-
PolylineBuilder
Creates a new empty polyline builder with the specifiedSpatialReference
.The
SpatialReference
cannot be changed after instantiation.- Parameters:
spatialReference
- the SpatialReference of the new builder. May be null.- Since:
- 100.0.0
-
PolylineBuilder
Creates a new polyline builder by copying the parts from the specifiedPolyline
.The
SpatialReference
of the new polyline builder will match that of the givenPolyline
. Use this constructor in workflows that create a modified version of an existing geometry, for example feature or graphic editing workflows. Polylines with curves are supported.- Parameters:
polyline
- the Polyline used to initialize this builder- Since:
- 100.0.0
- See Also:
-
PolylineBuilder
Creates a new PolylineBuilder containing a copy of the Points in the given PointCollection. The SpatialReference of the new builder will match that of the given PointCollection.- Parameters:
points
- the PointCollection used to initialize the new builder- Since:
- 100.0.0
-
PolylineBuilder
Creates a new PolylineBuilder containing a copy of the Points in the given PointCollection, and with the given SpatialReference.This overload can be used to initialize a PolylineBuilder with a specific SpatialReference from an existing PointCollection that has a null SpatialReference (the points are assigned the given SpatialReference-they are not projected).
- Parameters:
points
- the PointCollection containing points copied to the new builderspatialReference
- the SpatialReference of the new builder- Throws:
ArcGISRuntimeException
- if the SpatialReference ofpoints
does not match thespatialReference
argument.- Since:
- 100.0.0
-
PolylineBuilder
Creates a new PolylineBuilder containing the given Part. The SpatialReference of the new builder will match that of the given Part.- Parameters:
part
- the Part used to initialize the new builder- Since:
- 100.0.0
-
PolylineBuilder
Creates a new PolylineBuilder containing the given Part, and with the given SpatialReference.- Parameters:
part
- the Part to add to the new builderspatialReference
- the SpatialReference of the new builder- Since:
- 100.0.0
-
PolylineBuilder
Creates a new PolylineBuilder containing the Parts in the given PartCollection. The SpatialReference of the new builder will match that of the given PartCollection.- Parameters:
parts
- the PartCollection containing Parts to add to the new builder- Since:
- 100.0.0
-
PolylineBuilder
Creates a new PolylineBuilder containing the Parts in the given PartCollection, and with the given SpatialReference.- Parameters:
parts
- the PartCollection containing Parts to add to the new builderspatialReference
- the SpatialReference of the new builder
-
-
Method Details
-
toGeometry
Returns a new Polyline based on the current state of this builder. This method can be called as many times as required for any specific instance; it does not affect the state of the builder, and returns a new Polyline each time.Any gaps between the Segments in each part of the returned Polyline will be filled by new connecting LineSegments.
- Specified by:
toGeometry
in classGeometryBuilder
- Returns:
- a new Polyline based on the current state of this builder
- Since:
- 100.0.0
-