Modifier and Type | Class and Description |
---|---|
static class |
LayerListEvent.Type
The type of
LayerListEvent . |
Modifier and Type | Method and Description |
---|---|
static LayerListEvent |
added(Layer layer,
long index)
Returns a new event that indicates that a layer has been added to the
LayerList . |
LayerListEvent.Type |
getEventType()
Returns the event type.
|
Layer |
getLayer()
Returns the layer for which a change was made.
|
Long |
getNewIndex()
Returns the new index of the layer, or nothing in case of an LayerListChangeType::Removed event.
|
Long |
getOldIndex()
Returns the old index of the layer, or nothing in case of an LayerListChangeType::Added event.
|
static LayerListEvent |
moved(Layer layer,
long oldIndex,
long newIndex)
Returns a new event that indicates that a layer has been moved in the
LayerList . |
static LayerListEvent |
removed(Layer layer,
long oldIndex)
Returns a new event that indicates that a layer has been removed from the
LayerList . |
@NotNull public static LayerListEvent added(@NotNull Layer layer, long index) throws NullPointerException
LayerList
.layer
- the layer that was added, must not be null
index
- the index if the layer in the LayerList
LayerList
NullPointerException
- when the layer is null
.@NotNull public static LayerListEvent moved(@NotNull Layer layer, long oldIndex, long newIndex) throws NullPointerException
LayerList
.layer
- the layer that was moved, must not be null
oldIndex
- the previous index in the LayerList
newIndex
- the new index in the LayerList
LayerList
NullPointerException
- when the layer is null
.@NotNull public static LayerListEvent removed(@NotNull Layer layer, long oldIndex) throws NullPointerException
LayerList
.layer
- the layer that was removed, must not be null
oldIndex
- the index of the layer in the LayerList
before it was removedLayerList
NullPointerException
- when the layer is null
.@NotNull public Layer getLayer()
@NotNull public LayerListEvent.Type getEventType()
Depending on this type, the LayerListEvent#getOldIndex
and LayerListEvent#getNewIndex
methods return different values:
null
, getNewIndex returns the index at which the layer was added
null
, getOldIndex return the index from which the layer was removed
@Nullable public Long getOldIndex()
@Nullable public Long getNewIndex()