Interface GISLayerContainer<L extends MapLayer>
-
- Type Parameters:
L
- is the type of the layers inside this container.
- All Superinterfaces:
BoundedElement2afp<Rectangle2d>
,GISContainer<L>
,InformedIterable<L>
,Iterable<L>
- All Known Implementing Classes:
BusLineLayer
,BusNetworkLayer
,MultiMapLayer
public interface GISLayerContainer<L extends MapLayer> extends GISContainer<L>
Container of layers for a GIS application.The order of the layers in this container is important. It is assumed to be from the bottom-most layer (at the end of the layer collection) to the top-most layer (at index 0). Iterator on this container must go from top to bottom.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:53
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- giscore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addLayerListener(MapLayerListener listener)
Add a listener on the layer's events.void
addMapLayer(int index, L layer)
Insert a map layer inside this container at the specified index.boolean
addMapLayer(L layer)
Add a map layer inside this container at the top-most position.void
clear()
Remove all the children.void
fireLayerAttributeChangedEvent(MapLayerAttributeChangeEvent event)
Forward to the parent layer the event that indicates the content of a child layer was changed.void
fireLayerContentChangedEvent(MapLayerContentEvent event)
Forward to the parent layer the event that indicates the content of a child layer was changed.void
fireLayerHierarchyChangedEvent(MapLayerHierarchyEvent event)
Fire the event that indicates the hierarchy of layers has changed.List<L>
getAllMapLayers()
Replies the map layers.Iterator<L>
getBottomUpIterator()
Replies a bottom-up iterator.L
getMapLayerAt(int index)
Replies the map layer at the specified index.int
getMapLayerCount()
Replies the count of map layers inside this container.Iterator<L>
getTopDownIterator()
Replies a top-down iterator.Rectangle2d
getVisibleBoundingBox()
Replies the bounding box of this visible elements.int
indexOf(MapLayer layer)
Replies the index of the given layer in this container.boolean
isBottomLayer(MapLayer layer)
Replies if the specified layer is the bottom-most inside this container.boolean
isTopLayer(MapLayer layer)
Replies if the specified layer is the top-most inside this container.boolean
moveLayerDown(int index)
Move the specified layer up.boolean
moveLayerDown(MapLayer layer)
Move the specified layer up.boolean
moveLayerUp(int index)
Move the specified layer up.boolean
moveLayerUp(MapLayer layer)
Move the specified layer up.void
removeLayerListener(MapLayerListener listener)
Remove a listener on the layer's events.boolean
removeMapLayer(MapLayer layer)
Remove a map layer from this container.L
removeMapLayerAt(int index)
Remove the map layer inside this container.Iterator<L>
reverseIterator()
Replies a reverse iterator (from bottom to top).-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.BoundedElement2afp
getBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISContainer
bindChangeListener, getColor, getName, resetBoundingBox, size
-
Methods inherited from interface org.arakhne.afc.util.InformedIterable
getElementType
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
getVisibleBoundingBox
@Pure Rectangle2d getVisibleBoundingBox()
Replies the bounding box of this visible elements.- Returns:
- the bounding box or
null
if not applicable.
-
clear
void clear()
Remove all the children.
-
getMapLayerCount
@Pure int getMapLayerCount()
Replies the count of map layers inside this container.- Returns:
- the count of map layers
-
getMapLayerAt
@Pure L getMapLayerAt(int index)
Replies the map layer at the specified index.- Parameters:
index
- the index.- Returns:
- the map layer at the given index
- Throws:
IndexOutOfBoundsException
- in case of error.
-
addMapLayer
boolean addMapLayer(L layer)
Add a map layer inside this container at the top-most position.- Parameters:
layer
- the layer.- Returns:
true
if the layer was added successfully, otherwisefalse
-
addMapLayer
void addMapLayer(int index, L layer)
Insert a map layer inside this container at the specified index.- Parameters:
index
- the layer position.layer
- the layer.- Throws:
IndexOutOfBoundsException
- in case of error.
-
removeMapLayer
boolean removeMapLayer(MapLayer layer)
Remove a map layer from this container.- Parameters:
layer
- the layer.- Returns:
true
if the layer was removed successfully, otherwisefalse
-
removeMapLayerAt
L removeMapLayerAt(int index)
Remove the map layer inside this container.- Parameters:
index
- the index.- Returns:
- the removed map layer
- Throws:
IndexOutOfBoundsException
- in case of error.
-
moveLayerUp
boolean moveLayerUp(MapLayer layer)
Move the specified layer up.The layer position is important for drawing and event handling. Indeed the layers will be drawn from the index replied by
getMapLayerCount()
minus 1 (last) to the index0
(first). Moreover the events will be forwarded to the layers from the first to the last.- Parameters:
layer
- the layer.- Returns:
true
if the layer was moved. otherwisefalse
-
moveLayerUp
boolean moveLayerUp(int index)
Move the specified layer up.The layer position is important for drawing and event handling. Indeed the layers will be drawn from the index replied by
getMapLayerCount()
minus 1 (last) to the index0
(first). Moreover the events will be forwarded to the layers from the first to the last.- Parameters:
index
- the index.- Returns:
true
if the layer was moved. otherwisefalse
-
moveLayerDown
boolean moveLayerDown(MapLayer layer)
Move the specified layer up.The layer position is important for drawing and event handling. Indeed the layers will be drawn from the index replied by
getMapLayerCount()
minus 1 (last) to the index0
(first). Moreover the events will be forwarded to the layers from the first to the last.- Parameters:
layer
- the layer.- Returns:
true
if the layer was moved. otherwisefalse
-
moveLayerDown
boolean moveLayerDown(int index)
Move the specified layer up.The layer position is important for drawing and event handling. Indeed the layers will be drawn from the index replied by
getMapLayerCount()
minus 1 (last) to the index0
(first). Moreover the events will be forwarded to the layers from the first to the last.- Parameters:
index
- the index.- Returns:
true
if the layer was moved. otherwisefalse
-
addLayerListener
void addLayerListener(MapLayerListener listener)
Add a listener on the layer's events.- Parameters:
listener
- the listener.
-
removeLayerListener
void removeLayerListener(MapLayerListener listener)
Remove a listener on the layer's events.- Parameters:
listener
- the listener.
-
reverseIterator
@Pure Iterator<L> reverseIterator()
Replies a reverse iterator (from bottom to top).- Returns:
- a reverse iterator on layers.
- See Also:
Iterable.iterator()
,getBottomUpIterator()
,getTopDownIterator()
-
getBottomUpIterator
@Pure Iterator<L> getBottomUpIterator()
Replies a bottom-up iterator.- Returns:
- a bottom-up iterator on layers.
- See Also:
Iterable.iterator()
,reverseIterator()
,getTopDownIterator()
-
getTopDownIterator
@Pure Iterator<L> getTopDownIterator()
Replies a top-down iterator.- Returns:
- a top-down iterator on layers.
- See Also:
Iterable.iterator()
,reverseIterator()
,getBottomUpIterator()
-
isBottomLayer
@Pure boolean isBottomLayer(MapLayer layer)
Replies if the specified layer is the bottom-most inside this container.- Parameters:
layer
- the layer.- Returns:
true
if the given layer is the bottom-most layer in this container, otherwisefalse
-
isTopLayer
@Pure boolean isTopLayer(MapLayer layer)
Replies if the specified layer is the top-most inside this container.- Parameters:
layer
- the layer.- Returns:
true
if the given layer is the top-most layer in this container, otherwisefalse
-
indexOf
@Pure int indexOf(MapLayer layer)
Replies the index of the given layer in this container.- Parameters:
layer
- the layer.- Returns:
- the index of the layer or
-1
if not found
-
fireLayerHierarchyChangedEvent
void fireLayerHierarchyChangedEvent(MapLayerHierarchyEvent event)
Fire the event that indicates the hierarchy of layers has changed.- Parameters:
event
- the event.
-
fireLayerContentChangedEvent
void fireLayerContentChangedEvent(MapLayerContentEvent event)
Forward to the parent layer the event that indicates the content of a child layer was changed.- Parameters:
event
- the event.
-
fireLayerAttributeChangedEvent
void fireLayerAttributeChangedEvent(MapLayerAttributeChangeEvent event)
Forward to the parent layer the event that indicates the content of a child layer was changed.- Parameters:
event
- the event.
-
-