Interface ILcdLayered

All Superinterfaces:
Serializable
All Known Subinterfaces:
ILcdGXYView, ILcdLayerTreeNode, ILcdRotationCapableGXYView, ILcdTreeLayered, ILcdTreeLayeredSupport, ILspAWTView, ILspView
All Known Implementing Classes:
ALspAWTView, TLcdEarthGXYViewTileSet, TLcdGXYAsynchronousEditableLabelsLayerTreeNodeWrapper, TLcdGXYAsynchronousLayerTreeNodeWrapper, TLcdGXYLayerTreeNode, TLcdGXYLspAsynchronousLayerTreeNodeWrapper, TLcdGXYViewBufferedImage, TLcdGXYViewCanvas, TLcdGXYViewJPanel, TLcdGXYViewJPanelLightWeight, TLcdGXYViewPanel, TLcdGXYViewPlanarImage, TLcdIndependentOrderTreeLayeredSupport, TLcdLayeredSupport, TLcdLayerTreeNodeSupport, TLcdMapBufferedImage, TLcdMapCanvas, TLcdMapJPanel, TLcdMapJPanelLightWeight, TLcdMapPanel, TLcdTreeLayeredSupport, TLspAWTView, TLspExternalView, TLspFXView, TLspGXYLayerTreeNodeAdapter, TLspLayerTreeNode, TLspOffscreenView, TLspSwingView

public interface ILcdLayered extends Serializable
ILcdLayered is a list of zero or more ILcdLayers. Each ILcdLayer has a unique index, ranging from 0 to the number of ILcdLayers in this ILcdLayered minus one (#layers-1).

The layers are ordered by their index. The bottom layer of this ILcdLayered is the first ILcdLayer. The top layer of this ILcdLayered is the last ILcdLayer.

The meaning of top and bottom is that when all ILcdLayers of the ILcdLayered are displayed, an ILcdLayer closer to the top may cover objects of an ILcdLayer closer to the bottom, but not vice versa.

An ILcdLayered has zero or more ILcdLayeredListeners associated to it. The ILcdLayered sends a TLcdLayeredEvent whenever the state of the ILcdLayered changes (listener pattern).

ILcdLayered Structure

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Registers the given ILcdLayeredListener to be notified when layers are added, removed or moved.
    default void
    addLayeredListener(ILcdLayeredListener aListener, boolean aFireForeExistingLayers)
    Registers the given ILcdLayeredListener to be notified when layers are added, removed or moved, with the additional option to be notified for all current layers.
    boolean
    Returns whether this ILcdLayered contains the given layer.
    getLayer(int aIndex)
    Returns the ILcdLayer in this ILcdLayered with index aIndex.
    default List<? extends ILcdLayer>
    Returns a List of the layers.
    int
    Returns the index if the given layer is in the list.
    int
    Returns the number of ILcdLayer objects in this ILcdLayered.
    Returns the ILcdLayer of this ILcdLayered that contains the given ILcdModel.
    Deprecated.
    use getLayers() instead
    Deprecated.
    use Collections.reverse(getLayers()) instead
    void
    moveLayerAt(int aIndex, ILcdLayer aLayer)
    Moves the given layer (which is already in ILcdLayered) to the existing index aIndex.
    void
    Removes all the ILcdLayer objects from this ILcdLayered.
    void
    Removes aLayer from this ILcdLayered.
    void
    Unregisters the given ILcdLayeredListener from receiving layered events for the ILcdLayered.
    default void
    removeLayeredListener(ILcdLayeredListener aListener, boolean aFireForeExistingLayers)
    Unregisters the given ILcdLayeredListener from receiving layered events, with the additional option to be notified for all current layers.
  • Method Details

    • addLayeredListener

      void addLayeredListener(ILcdLayeredListener aLayeredListener)

      Registers the given ILcdLayeredListener to be notified when layers are added, removed or moved.

      In case you need to register a listener which keeps a reference to an object with a shorter life-time than this layered, you can use a ALcdWeakLayeredListener instance as layered listener.

      Parameters:
      aLayeredListener - the listener that from now on will be notified of all changes to the ILcdLayered
      See Also:
    • addLayeredListener

      default void addLayeredListener(ILcdLayeredListener aListener, boolean aFireForeExistingLayers)

      Registers the given ILcdLayeredListener to be notified when layers are added, removed or moved, with the additional option to be notified for all current layers.

      For every existing layer in this ILcdLayered a LAYER_ADDED event will be fired to aListener when aFireForExistingLayers is true. A use-case for this is when you want to use the listener to perform an action on any of the existing layers and on all future layers.

      Parameters:
      aListener - The listener that from now on will be notified of all changes to the ILcdLayered.
      Since:
      2019.1
    • removeLayeredListener

      void removeLayeredListener(ILcdLayeredListener aLayeredListener)
      Unregisters the given ILcdLayeredListener from receiving layered events for the ILcdLayered.
      Parameters:
      aLayeredListener - the listener that will no longer be notified of changes to the ILcdLayered
      See Also:
    • removeLayeredListener

      default void removeLayeredListener(ILcdLayeredListener aListener, boolean aFireForeExistingLayers)

      Unregisters the given ILcdLayeredListener from receiving layered events, with the additional option to be notified for all current layers.

      For every existing layer in this ILcdLayered a LAYER_REMOVED event will be fired to aListener when aFireForExistingLayers is true. A use-case for this is when you might want to unregister additional listeners for existing layers.

      Parameters:
      aListener - The listener that will no longer be notified of changes to the ILcdLayered.
      Since:
      2020.1
    • layerCount

      int layerCount()
      Returns the number of ILcdLayer objects in this ILcdLayered.
      Returns:
      the number of ILcdLayer objects in this ILcdLayered.
    • getLayers

      default List<? extends ILcdLayer> getLayers()
      Returns a List of the layers.
      Returns:
      an unmodifiable List of the layers in this ILcdLayered
      Since:
      2017.1
    • layers

      Deprecated.
      use getLayers() instead
      Returns an Enumeration of all ILcdLayer objects currently in this ILcdLayered, starting from the bottom layer to the top layer.
      Returns:
      an Enumeration of all ILcdLayer objects currently in this ILcdLayered, starting from the bottom layer to the top layer.
    • layersBackwards

      @Deprecated Enumeration layersBackwards()
      Deprecated.
      use Collections.reverse(getLayers()) instead
      Returns an Enumeration of all ILcdLayer objects currently in this ILcdLayered, starting from the top layer to the bottom layer.
      Returns:
      an Enumeration of all ILcdLayer objects currently in this ILcdLayered, starting from the top layer to the bottom layer.
    • getLayer

      ILcdLayer getLayer(int aIndex) throws ArrayIndexOutOfBoundsException
      Returns the ILcdLayer in this ILcdLayered with index aIndex.
      Parameters:
      aIndex - the position of the layer to retrieve in the ILcdLayered.
      Returns:
      the ILcdLayer in this ILcdLayered with index aIndex.
      Throws:
      ArrayIndexOutOfBoundsException - if the given index is invalid
    • layerOf

      ILcdLayer layerOf(ILcdModel aModel) throws NoSuchElementException
      Returns the ILcdLayer of this ILcdLayered that contains the given ILcdModel.
      Parameters:
      aModel - the model to check for in this ILcdLayered.
      Returns:
      the ILcdLayer of this ILcdLayered that contains the given ILcdModel.
      Throws:
      NoSuchElementException - if there is no layer containing the given model
    • indexOf

      int indexOf(ILcdLayer aLayer) throws NoSuchElementException
      Returns the index if the given layer is in the list.
      Parameters:
      aLayer - the layer whose index to return
      Returns:
      the index of aLayer
      Throws:
      NoSuchElementException - if aLayer is not in the list
    • moveLayerAt

      void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException
      Moves the given layer (which is already in ILcdLayered) to the existing index aIndex. When a layer is moved down, all layers in between the previous and future position of the given layer (including the layer at index aIndex) are moved one position up. When a layer is moved up, all layers in between the previous and future position of the given layer (including the layer at index aIndex) are moved one position down.

      More formally, let previousIndex be the index of aLayer before the move. If previousIndex < aIndex, then the index of all ILcdLayer objects in from previousIndex + 1 to aIndex is decremented with 1. If previousIndex > aIndex, then the index of all ILcdLayer objects in from aIndex to previousIndex -1 is incremented with 1.

      Parameters:
      aIndex - the index of the position where to move the layer.
      aLayer - the layer to move.
      Throws:
      NoSuchElementException - if aLayer is not in this ILcdLayered.
      ArrayIndexOutOfBoundsException - if aIndex is not an index of one of the layers of this ILcdLayered.
    • removeLayer

      void removeLayer(ILcdLayer aLayer)
      Removes aLayer from this ILcdLayered.
      Parameters:
      aLayer - the layer to remove.
    • removeAllLayers

      void removeAllLayers()
      Removes all the ILcdLayer objects from this ILcdLayered.
    • containsLayer

      boolean containsLayer(ILcdLayer aLayer)
      Returns whether this ILcdLayered contains the given layer. More formally, returns true if and only if the ILcdLayered contains at least one layer l such that (aLayer==null ? l==null : aLayer.equals(l)).
      Parameters:
      aLayer - the layer to check whether it is in this layered.
      Returns:
      true if aLayer is in this ILcdLayered, false otherwise.