java.lang.Object
com.esri.arcgisruntime.mapping.view.geometryeditor.GeometryEditorTool
com.esri.arcgisruntime.mapping.view.geometryeditor.ShapeTool

public final class ShapeTool extends GeometryEditorTool
Allows you to create polygon or polyline geometries with a geometric shape by using a single drag interaction.

Create a new shape tool using create(ShapeToolType) and specify the type of shape to be created - the shapeTypeProperty() cannot be changed after the tool is instantiated. Call GeometryEditor.start(GeometryType), passing in either GeometryType.POLYLINE or GeometryType.POLYGON, then drag on the MapView to define the location and size of the shape. For example, drag diagonally to define the corners of a bounding box within which a ShapeToolType.RECTANGLE or ShapeToolType.ARROW shape fits, or to define the center point and a point on the circumference of a ShapeToolType.ELLIPSE or point of a ShapeToolType.TRIANGLE.

You can select different GeometryEditorElement objects by tapping, move selected elements, and use transformation control handles to rotate and scale the selected elements, subject to the current configurationProperty().

You can also use this tool to add new geometric shaped parts to existing polygon or polyline geometries by setting InteractionConfiguration.allowPartCreationProperty() to true in the ShapeTool.configurationProperty() and calling GeometryEditor.start(Geometry). You cannot use ShapeTool to create geometry types other than GeometryType.POLYGON or GeometryType.POLYLINE.

By default, this tool does not display vertices or mid-vertices because you do not interact with individual vertices using this tool. The appearance can be customized by changing GeometryEditorTool.styleProperty(). By default, this tool enables creation, selection, transformation, and deletion. This behavior can be customized with ShapeTool.configurationProperty().

Since:
200.2.0
See Also: