- All Implemented Interfaces:
JsonSerializable
Simple fill symbols can fill the interior of polygons using predefined fill patterns such as
SimpleFillSymbol.Style.BACKWARD_DIAGONAL
, SimpleFillSymbol.Style.VERTICAL
,
SimpleFillSymbol.Style.HORIZONTAL
and SimpleFillSymbol.Style.CROSS
, as well as
SimpleFillSymbol.Style.SOLID
colors. These symbols can have an optional outline, which is defined by
SimpleLineSymbol
.
Example of creating a SimpleFillSymbol with no outline:
PointCollection points = new PointCollection(SpatialReferences.getWebMercator()); points.add(-1.1579397849033352E7, 5618494.623878779); points.add(-1.158486021463032E7, 5020365.591010623); points.add(-1.236324731219847E7, 5009440.859816683); points.add(-1.2360516129399985E7, 5621225.806677263); Polygon square = new Polygon(points); // creates a solid red simple fill symbol SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0x88FF0000, null); // add square with symbol to graphics overlay and add overlay to map view GraphicsOverlay graphicsOverlay = new GraphicsOverlay(); mapView.getGraphicsOverlays().add(graphicsOverlay); graphicsOverlay.getGraphics().add(new Graphic(square, fillSymbol));A SimpleFillSymbol can be displayed using a Graphic and setting it to a GraphicsOverlay or setting the Symbol as a Renderer.
GraphicsOverlay.getGraphics().add(new Graphic(Geometry, SimpleFillSymbol));OR
GraphicsOverlay.setRender(new SimpleRenderer(SimpleFillSymbol));
- Since:
- 100.0.0
- See Also:
-
Property Summary
Properties inherited from class com.esri.arcgisruntime.symbology.FillSymbol
color
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines the fill style for a SimpleFillSymbol. -
Constructor Summary
ConstructorDescriptionCreates a simple fill symbol object with default values.SimpleFillSymbol
(SimpleFillSymbol.Style style, int color, LineSymbol outline) Deprecated, for removal: This API element is subject to removal in a future version.SimpleFillSymbol
(SimpleFillSymbol.Style style, Color color, LineSymbol outline) Creates a simple fill symbol object with a color, style and outline. -
Method Summary
Modifier and TypeMethodDescriptiongetStyle()
Gets the fill style that describes how the Symbol's pattern is being displayed.void
setStyle
(SimpleFillSymbol.Style style) Sets the fill style that describes how this Symbol's pattern will be displayed.Gets aMultilayerPolygonSymbol
from a SimpleFillSymbol.Methods inherited from class com.esri.arcgisruntime.symbology.FillSymbol
colorProperty, getColor, getOutline, setColor, setColor, setOutline
Methods inherited from class com.esri.arcgisruntime.symbology.Symbol
createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, fromJson, getUnknownJson, getUnsupportedJson, toJson
-
Constructor Details
-
SimpleFillSymbol
public SimpleFillSymbol()Creates a simple fill symbol object with default values.The default values are:
-
getStyle()
-SimpleFillSymbol.Style.SOLID
-
FillSymbol.colorProperty()
- gray -
FillSymbol.getOutline()
- null
This is useful if the properties of the symbol are only known after the application is running.
- Since:
- 100.0.0
-
-
SimpleFillSymbol
@Deprecated(since="200.0.0", forRemoval=true) public SimpleFillSymbol(SimpleFillSymbol.Style style, int color, LineSymbol outline) Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bySimpleFillSymbol(Style, Color, LineSymbol)
Creates a new SimpleFillSymbol with the given properties:- Color, interior color of the Symbol.
- Style, pattern that makes up the interior of this Symbol.
- Outline, the LineSymbol that makes up the border of this SimpleFillSymbol.
The outline can be left null which will apply no outline to this symbol.
- Parameters:
style
- the fill style, not nullcolor
- an integer representing the fill color as 0xAARRGGBBoutline
- the Symbol's outline, if any- Throws:
IllegalArgumentException
- if style is null- Since:
- 100.0.0
-
SimpleFillSymbol
Creates a simple fill symbol object with a color, style and outline.- Parameters:
style
- the type of simple fill symbol to create, not nullcolor
- the color of the simple fill symboloutline
- the outline of the simple fill symbol, may be null- Throws:
IllegalArgumentException
- if style is nullIllegalArgumentException
- if color is null- Since:
- 200.0.0
-
-
Method Details
-
toMultilayerSymbol
Gets aMultilayerPolygonSymbol
from a SimpleFillSymbol.This method allows you to create complex and custom symbols with multiple layers of different types of symbology. Simple fill symbol provides a factory of predefined fill styles such as cross and backward_diagonal. This method generates a
MultilayerPolygonSymbol
with aHatchFillSymbolLayer
for any of the styles containing lines, or aSolidFillSymbolLayer
if the fill style isSimpleFillSymbol.Style.SOLID
.- Returns:
- a converted multilayer polygon symbol
- Since:
- 100.5.0
-
getStyle
Gets the fill style that describes how the Symbol's pattern is being displayed.Default value is SOLID.
- Returns:
- the current fill style for this Symbol
- Since:
- 100.0.0
- See Also:
-
setStyle
Sets the fill style that describes how this Symbol's pattern will be displayed.- Parameters:
style
- the new fill style for this symbol, not null- Throws:
IllegalArgumentException
- if style is null- Since:
- 100.0.0
- See Also:
-
SimpleFillSymbol(Style, Color, LineSymbol)