Class LayerViewStateChangedEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.esri.arcgisruntime.mapping.view.LayerViewStateChangedEvent
-
- All Implemented Interfaces:
java.io.Serializable
public final class LayerViewStateChangedEvent extends java.util.EventObjectAn event that indicates that the view state of a layer in a GeoView has changed. This can be inspected inside aLayerViewStateChangedListener.This event returns
LayerViewStatusas anjava.util.EnumSetfor each layer, which means the layer can have multiple states. SeegetLayerViewStatus()for more information.- Since:
- 100.0.0
- See Also:
LayerViewStateChangedListener,LayerViewStatus, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArcGISRuntimeExceptiongetError()Gets the error that occurred ifgetLayerViewStatus()returnsLayerViewStatus.ERROR.LayergetLayer()Returns the layer for which theLayerViewStatushas changed.java.util.EnumSet<LayerViewStatus>getLayerViewStatus()Returns the new status as an EnumSet ofLayerViewStatuss.GeoViewgetSource()
-
-
-
Method Detail
-
getSource
public GeoView getSource()
- Overrides:
getSourcein classjava.util.EventObject
-
getLayer
public Layer getLayer()
Returns the layer for which theLayerViewStatushas changed.- Returns:
- the layer
- Since:
- 100.0.0
-
getLayerViewStatus
public java.util.EnumSet<LayerViewStatus> getLayerViewStatus()
Returns the new status as an EnumSet ofLayerViewStatuss.The layer view status is an EnumSet which means a layer can have multiple states. It could for instance be both
LayerViewStatus.NOT_VISIBLEandLayerViewStatus.OUT_OF_SCALE, orLayerViewStatus.NOT_VISIBLELayerViewStatus.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.ACTIVEcan only be combined withLayerViewStatus.WARNINGto indicate that the layer is encountering a problem. For instance it can't both beLayerViewStatus.ACTIVEandLayerViewStatus.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.LOADINGandLayerViewStatus.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
-
-