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 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.
      • getAllMapLayers

        @Pure
        List<L> getAllMapLayers()
        Replies the map layers.
        Returns:
        the map layers
      • 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, otherwise false
      • 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, otherwise false
      • 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 index 0 (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. otherwise false
      • 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 index 0 (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. otherwise false
      • 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 index 0 (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. otherwise false
      • 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 index 0 (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. otherwise false
      • 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.
      • 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, otherwise false
      • 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, otherwise false
      • 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.