Package com.esri.arcgisruntime.symbology
Class SimpleFillSymbol
- java.lang.Object
-
- com.esri.arcgisruntime.symbology.Symbol
-
- com.esri.arcgisruntime.symbology.FillSymbol
-
- com.esri.arcgisruntime.symbology.SimpleFillSymbol
-
- All Implemented Interfaces:
JsonSerializable
public final class SimpleFillSymbol extends FillSymbol
Defines a SimpleFillSymbol which is a FillSymbol based on simple pre-defined patterns.SimpleFillSymbols symbolize Graphics and Features having Polygon geometries, which defines how to fill it's interior using a color and a fill pattern. A LineSymbol can be used in combination with a SimpleFillSymbol to add an outline. The outline property is optional and null can be passed if no LineSymbol is given, which will add no border to this Symbol.
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));
ORGraphicsOverlay.setRender(new SimpleRenderer(SimpleFillSymbol));
- Since:
- 100.0.0
- See Also:
Graphic
,GraphicsOverlay
,SimpleRenderer
,SimpleLineSymbol
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleFillSymbol.Style
Defines the fill style for a SimpleFillSymbol.
-
Constructor Summary
Constructors Constructor Description SimpleFillSymbol()
Creates a new SimpleFillSymbol with default properties set.SimpleFillSymbol(SimpleFillSymbol.Style style, int color, LineSymbol outline)
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleFillSymbol.Style
getStyle()
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.MultilayerPolygonSymbol
toMultilayerSymbol()
Gets a multilayer polygon symbol generated from this simple fill symbol.-
Methods inherited from class com.esri.arcgisruntime.symbology.FillSymbol
getColor, getOutline, setColor, setOutline
-
Methods inherited from class com.esri.arcgisruntime.symbology.Symbol
createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, fromJson, getUnknownJson, getUnsupportedJson, toJson
-
-
-
-
Constructor Detail
-
SimpleFillSymbol
public SimpleFillSymbol()
Creates a new SimpleFillSymbol with default properties set. Useful if the properties of this Symbol are only known after the application is running.Each property can be set on its own but setting the style property by itself will have no effect on making the Symbol visible.
Default properties:
- Color, gray, 0xFFD3D3D3
- Style,
SimpleFillSymbol.Style.SOLID
- Outline, null
- Since:
- 100.0.0
-
SimpleFillSymbol
public SimpleFillSymbol(SimpleFillSymbol.Style style, int color, LineSymbol outline)
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
-
-
Method Detail
-
toMultilayerSymbol
public MultilayerPolygonSymbol toMultilayerSymbol()
Gets a multilayer polygon symbol generated from this simple fill symbol. The multilayer symbol will contain aHatchFillSymbolLayer
for any of thestyles
containing lines, or aSolidFillSymbolLayer
if the fill style isSimpleFillSymbol.Style.SOLID
.- Returns:
- a converted multilayer polygon symbol
- Since:
- 100.5.0
-
getStyle
public SimpleFillSymbol.Style 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:
SimpleFillSymbol.Style
-
setStyle
public void setStyle(SimpleFillSymbol.Style style)
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
-
-