Package com.esri.arcgisruntime.symbology
Class SimpleRenderer
- java.lang.Object
-
- com.esri.arcgisruntime.symbology.Renderer
-
- com.esri.arcgisruntime.symbology.SimpleRenderer
-
- All Implemented Interfaces:
JsonSerializable
public final class SimpleRenderer extends Renderer
A SimpleRenderer uses one Symbol and draws all Features/Graphics using that Symbol.Properties of a SimpleRenderer:
- Symbol, the Symbol that is used to draw Features/Graphics to a GeoView.
- Description, gives detail information about what this Renderer's does.
- Label, name that this Renderer can be referred to.
Example of creating a SimpleRender:
// create a mapView ... // create a GraphicsOverlay and set it to the mapView GraphicsOverlay graphicsOverlay = new GraphicsOverlay(); mapView.getGraphicsOverlays().add(graphicsOverlay); SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.TRIANGLE, 0xffff0000, 5); SimpleRenderer simpleRenderer = new SimpleRenderer(symbol); graphicsOverlay.setRenderer(simpleRenderer); // the graphic's symbol should be that of the renderer that was assigned Point randomPoint = new Point(2000000, 2000000); Graphic graphic = new Graphic(randomPoint); graphicsOverlay.getGraphics().add(graphic);
- Since:
- 100.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.esri.arcgisruntime.symbology.Renderer
Renderer.SceneProperties
-
-
Constructor Summary
Constructors Constructor Description SimpleRenderer()
Creates a new SimpleRenderer with given default properties: Symbol, Color: Red, Size: 10, Style: Circle Description, null Label, nullSimpleRenderer(Symbol symbol)
Creates a new SimpleRenderer with the given Symbol.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
Gets the description that describes what this Renderer's does.java.lang.String
getLabel()
Gets the name of this Renderer.Symbol
getSymbol()
Gets the Symbol that is being used by this Renderer to draw Features/Graphics to the GeoView.Symbol
getSymbol(Feature feature)
Gets the Symbol used to display the given Feature.Symbol
getSymbol(Graphic graphic)
Gets the Symbol used to display the given Graphic.void
setDescription(java.lang.String description)
Sets the description, which gives detail information about what this Renderer's does.void
setLabel(java.lang.String label)
Sets a name that this Renderer can be referred to.void
setSymbol(Symbol symbol)
Sets the Symbol to be used by this Renderer to draw Features/Graphics to the GeoView.-
Methods inherited from class com.esri.arcgisruntime.symbology.Renderer
fromJson, getRotationExpression, getRotationType, getSceneProperties, getSymbol, getSymbol, getUnknownJson, getUnsupportedJson, setRotationExpression, setRotationType, toJson
-
-
-
-
Constructor Detail
-
SimpleRenderer
public SimpleRenderer()
Creates a new SimpleRenderer with given default properties:- Symbol, Color: Red, Size: 10, Style: Circle
- Description, null
- Label, null
- Since:
- 100.0.0
-
SimpleRenderer
public SimpleRenderer(Symbol symbol)
Creates a new SimpleRenderer with the given Symbol.Setting the Symbol to null will just apply a default red circle Symbol.
- Parameters:
symbol
- the Symbol for this Renderer, can be null- Since:
- 100.0.0
-
-
Method Detail
-
getSymbol
public Symbol getSymbol(Feature feature)
Gets the Symbol used to display the given Feature.- Specified by:
getSymbol
in classRenderer
- Parameters:
feature
- the Feature to get a Symbol from, not null- Returns:
- the Symbol of the Feature that was passed
- Throws:
java.lang.IllegalArgumentException
- if feature is null- Since:
- 100.0.0
- See Also:
Renderer.getSymbol(com.esri.arcgisruntime.data.Feature)
-
getSymbol
public Symbol getSymbol(Graphic graphic)
Gets the Symbol used to display the given Graphic.- Specified by:
getSymbol
in classRenderer
- Parameters:
graphic
- the Graphic to get a Symbol from, not null- Returns:
- the Symbol of the Graphic that was passed
- Throws:
java.lang.IllegalArgumentException
- if graphic is null- Since:
- 100.0.0
- See Also:
Renderer.getSymbol(com.esri.arcgisruntime.mapping.view.Graphic)
-
getSymbol
public Symbol getSymbol()
Gets the Symbol that is being used by this Renderer to draw Features/Graphics to the GeoView.Default value is a red circle Symbol.
- Returns:
- the Symbol being used by this Renderer
- Since:
- 100.0.0
- See Also:
setSymbol(com.esri.arcgisruntime.symbology.Symbol)
-
setSymbol
public void setSymbol(Symbol symbol)
Sets the Symbol to be used by this Renderer to draw Features/Graphics to the GeoView.Setting the Symbol to null will just apply a default red circle Symbol.
- Parameters:
symbol
- the new Symbol used by this Renderer, can be null- Since:
- 100.0.0
-
getDescription
public java.lang.String getDescription()
Gets the description that describes what this Renderer's does.Default value an empty string.
- Returns:
- the description of this Renderer
- Since:
- 100.0.0
-
setDescription
public void setDescription(java.lang.String description)
Sets the description, which gives detail information about what this Renderer's does. An example could be describing the meaning behind the Symbol it uses.- Parameters:
description
- the new description for this Renderer
-
getLabel
public java.lang.String getLabel()
Gets the name of this Renderer.Default value is an empty string.
- Returns:
- the label of this Renderer
- Since:
- 100.0.0
-
setLabel
public void setLabel(java.lang.String label)
Sets a name that this Renderer can be referred to.- Parameters:
label
- the new label for this Renderer- Since:
- 100.0.0
-
-