Class LayerViewStateChangedEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.esri.arcgisruntime.mapping.view.LayerViewStateChangedEvent
-
- All Implemented Interfaces:
Serializable
public final class LayerViewStateChangedEvent extends EventObject
An event that indicates that the view state of a layer in a GeoView has changed. This can be inspected inside aLayerViewStateChangedListener
.This event returns
LayerViewStatus
as anjava.util.EnumSet
for each layer, which means the layer can have multiple states. SeegetLayerViewStatus()
for more information.- Since:
- 100.0.0
- See Also:
LayerViewStateChangedListener
,LayerViewStatus
, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArcGISRuntimeException
getError()
Gets the error that occurred ifgetLayerViewStatus()
returnsLayerViewStatus.ERROR
.Layer
getLayer()
Returns the layer for which theLayerViewStatus
has changed.EnumSet<LayerViewStatus>
getLayerViewStatus()
Returns the new status as an EnumSet ofLayerViewStatus
s.GeoView
getSource()
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Method Detail
-
getSource
public GeoView getSource()
- Overrides:
getSource
in classEventObject
-
getLayer
public Layer getLayer()
Returns the layer for which theLayerViewStatus
has changed.- Returns:
- the layer
- Since:
- 100.0.0
-
getLayerViewStatus
public EnumSet<LayerViewStatus> getLayerViewStatus()
Returns the new status as an EnumSet ofLayerViewStatus
s.The layer view status is an EnumSet which means a layer can have multiple states. It could for instance be both
LayerViewStatus.NOT_VISIBLE
andLayerViewStatus.OUT_OF_SCALE
, orLayerViewStatus.NOT_VISIBLE
LayerViewStatus.LOADING
. This means your layer list in a table of contents (TOCs) could use the status to both determine whether to gray out the layer, and also show a spinning loading icon. However a layer status ofLayerViewStatus.ACTIVE
can only be combined withLayerViewStatus.WARNING
to indicate that the layer is encountering a problem. For instance it can't both beLayerViewStatus.ACTIVE
andLayerViewStatus.NOT_VISIBLE
. It's important to note that the benefit here over just checking layer visibility and scale ranges, is that also parent layers are taken into account - i.e. if a group layer is out of scale range or off. This greatly simplifies the code needed for building table TOCs that update with the map view.- Returns:
- the layer view status, which can be a set of statuses such as
LayerViewStatus.LOADING
andLayerViewStatus.NOT_VISIBLE
. - Since:
- 100.0.0
-
getError
public ArcGISRuntimeException getError()
Gets the error that occurred ifgetLayerViewStatus()
returnsLayerViewStatus.ERROR
.- Returns:
- an ArcGISRuntimeException if an error occurred, otherwise null
- Since:
- 100.0.0
-
-