Package com.luciad.layers
Class LayerListEvent
java.lang.Object
com.luciad.layers.LayerListEvent
An event object, describing a change in a
LayerList
instance.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LayerListEvent
Returns a new event that indicates that a layer has been added to theLayerList
.Returns the event type.getLayer()
Returns the layer for which a change was made.Returns the new index of the layer, or nothing in case of an LayerListChangeType::Removed event.Returns the old index of the layer, or nothing in case of an LayerListChangeType::Added event.static LayerListEvent
Returns a new event that indicates that a layer has been moved in theLayerList
.static LayerListEvent
Returns a new event that indicates that a layer has been removed from theLayerList
.
-
Method Details
-
added
@NotNull public static LayerListEvent added(@NotNull Layer layer, long index) throws NullPointerException Returns a new event that indicates that a layer has been added to theLayerList
.- Parameters:
layer
- the layer that was added, must not benull
index
- the index if the layer in theLayerList
- Returns:
- a new event that indicates that a layer has been added to the
LayerList
- Throws:
NullPointerException
- when the layer isnull
.
-
moved
@NotNull public static LayerListEvent moved(@NotNull Layer layer, long oldIndex, long newIndex) throws NullPointerException Returns a new event that indicates that a layer has been moved in theLayerList
.- Parameters:
layer
- the layer that was moved, must not benull
oldIndex
- the previous index in theLayerList
newIndex
- the new index in theLayerList
- Returns:
- a new event that indicates that a layer has been moved in the
LayerList
- Throws:
NullPointerException
- when the layer isnull
.
-
removed
@NotNull public static LayerListEvent removed(@NotNull Layer layer, long oldIndex) throws NullPointerException Returns a new event that indicates that a layer has been removed from theLayerList
.- Parameters:
layer
- the layer that was removed, must not benull
oldIndex
- the index of the layer in theLayerList
before it was removed- Returns:
- a new event that indicates that a layer has been removed from the
LayerList
- Throws:
NullPointerException
- when the layer isnull
.
-
getLayer
Returns the layer for which a change was made.- Returns:
- the layer for which a change was made.
-
getEventType
Returns the event type.Depending on this type, the
LayerListEvent#getOldIndex
andLayerListEvent#getNewIndex
methods return different values:- Added: getOldIndex returns
null
, getNewIndex returns the index at which the layer was added - Moved: both getOldIndex and getNewIndex return a value
- Removed: getNewIndex returns
null
, getOldIndex return the index from which the layer was removed
- Returns:
- the event type.
- Added: getOldIndex returns
-
getOldIndex
Returns the old index of the layer, or nothing in case of an LayerListChangeType::Added event.- Returns:
- the old index of the layer, or nothing in case of an LayerListChangeType::Added event.
-
getNewIndex
Returns the new index of the layer, or nothing in case of an LayerListChangeType::Removed event.- Returns:
- the new index of the layer, or nothing in case of an LayerListChangeType::Removed event.
-