Class ShapeTool
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:
-
Property Summary
TypePropertyDescriptionDefines the set of interactive operations enabled when using this tool.The type of geometric shape drawn by this tool, set at instantiation usingcreate(ShapeToolType)
.Properties inherited from class com.esri.arcgisruntime.mapping.view.geometryeditor.GeometryEditorTool
style
-
Method Summary
Modifier and TypeMethodDescriptionDefines the set of interactive operations enabled when using this tool.static ShapeTool
create
(ShapeToolType shapeType) Create a ShapeTool to draw the specifiedShapeToolType
.Gets the value of theconfiguration
property.Gets the value of theshapeType
property.void
setConfiguration
(InteractionConfiguration configuration) Sets the value of theconfiguration
property.The type of geometric shape drawn by this tool, set at instantiation usingcreate(ShapeToolType)
.Methods inherited from class com.esri.arcgisruntime.mapping.view.geometryeditor.GeometryEditorTool
getStyle, setStyle, styleProperty
-
Property Details
-
configuration
Defines the set of interactive operations enabled when using this tool.By default, this tool has an
InteractionConfiguration.allowPartCreationProperty()
value of false in theconfigurationProperty()
, which allows only the initial part of the specified shape to be added interactively - subsequent interactions may navigate the map view instead of changing the geometry. To add additional parts to the geometry with each new drag interaction, each with the specifiedShapeToolType
, setInteractionConfiguration.allowPartCreationProperty()
to true.Attempting to set the value to null will throw a NullPointerException exception.
- Since:
- 200.2.0
- See Also:
-
shapeType
The type of geometric shape drawn by this tool, set at instantiation usingcreate(ShapeToolType)
.- Since:
- 200.2.0
- See Also:
-
-
Method Details
-
configurationProperty
Defines the set of interactive operations enabled when using this tool.By default, this tool has an
InteractionConfiguration.allowPartCreationProperty()
value of false in theconfigurationProperty()
, which allows only the initial part of the specified shape to be added interactively - subsequent interactions may navigate the map view instead of changing the geometry. To add additional parts to the geometry with each new drag interaction, each with the specifiedShapeToolType
, setInteractionConfiguration.allowPartCreationProperty()
to true.Attempting to set the value to null will throw a NullPointerException exception.
- Returns:
- the
configuration
property - Since:
- 200.2.0
- See Also:
-
getConfiguration
Gets the value of theconfiguration
property.- Property description:
- Defines the set of interactive operations enabled when using this tool.
By default, this tool has an
InteractionConfiguration.allowPartCreationProperty()
value of false in theconfigurationProperty()
, which allows only the initial part of the specified shape to be added interactively - subsequent interactions may navigate the map view instead of changing the geometry. To add additional parts to the geometry with each new drag interaction, each with the specifiedShapeToolType
, setInteractionConfiguration.allowPartCreationProperty()
to true.Attempting to set the value to null will throw a NullPointerException exception.
- Returns:
- the value of the
configuration
property - Since:
- 200.2.0
- See Also:
-
setConfiguration
Sets the value of theconfiguration
property.- Property description:
- Defines the set of interactive operations enabled when using this tool.
By default, this tool has an
InteractionConfiguration.allowPartCreationProperty()
value of false in theconfigurationProperty()
, which allows only the initial part of the specified shape to be added interactively - subsequent interactions may navigate the map view instead of changing the geometry. To add additional parts to the geometry with each new drag interaction, each with the specifiedShapeToolType
, setInteractionConfiguration.allowPartCreationProperty()
to true.Attempting to set the value to null will throw a NullPointerException exception.
- Parameters:
configuration
- the value for theconfiguration
property- Since:
- 200.2.0
- See Also:
-
shapeTypeProperty
The type of geometric shape drawn by this tool, set at instantiation usingcreate(ShapeToolType)
.- Returns:
- the
shapeType
property - Since:
- 200.2.0
- See Also:
-
getShapeType
Gets the value of theshapeType
property.- Property description:
- The type of geometric shape drawn by this tool, set at instantiation using
create(ShapeToolType)
. - Returns:
- the value of the
shapeType
property - Since:
- 200.2.0
- See Also:
-
create
Create a ShapeTool to draw the specifiedShapeToolType
.By default, this tool enables the creation, selection, transformation, and deletion interactions appropriate for creating geometries with a geometric shape. This behavior can be customized with
configurationProperty()
.- Parameters:
shapeType
- the type of shape drawn by this tool- Returns:
- a new ShapeTool with the given
ShapeToolType
and default configuration and style properties - Throws:
NullPointerException
- if shapeType is null- Since:
- 200.2.0
- See Also:
-