Class TLcdLayeredSupport

java.lang.Object
com.luciad.view.TLcdLayeredSupport
All Implemented Interfaces:
ILcdLayered, Serializable

public class TLcdLayeredSupport extends Object implements ILcdLayered
This is a utility class that can be used to make a class that implements ILcdLayered.
See Also:
  • Constructor Details

    • TLcdLayeredSupport

      public TLcdLayeredSupport(ILcdLayered aLayeredToSupport)
      Creates a new TLcdLayeredSupport that works for the given ILcdLayered.
      Parameters:
      aLayeredToSupport - The layered to support.
    • TLcdLayeredSupport

      public TLcdLayeredSupport()
      Create a new TLcdLayeredSupport, without specifying the ILcdLayered which delegates his methods to this support. Make sure setLayeredToSupport(ILcdLayered) is called before using an instance of this class.
  • Method Details

    • isFireInitialEvents

      public static boolean isFireInitialEvents()
      Returns true if some initial events are fired to a ILcdLayeredListener when it is added. Default is false.
      Returns:
      true if events should be fired to a ILcdLayeredListener that is added.
      See Also:
    • setFireInitialEvents

      public static void setFireInitialEvents(boolean aFireInitialEvents)
      Sets if some initial events are fired to a ILcdLayeredListener when it is added. Prior to version 6.0, the default behavior was true, meaning that a LAYER_REMOVED and LAYER_ADDED event were fired, for every layer, but only to the listener that was just added.

      As of version 6.0 the default is false, meaning no events are fired to a ILcdLayeredListener when it is added. This is consistent with the behavior of all other listeners. For backward compatibility reasons, the old behavior can still be enabled, by setting this value to true.

      This property can also be set by assigning 'true' or 'false' to the system property 'com.luciad.view.TLcdLayeredSupport.fireInitialEvents'. A system property can be set using the command line option -Dkey=value to java.

      Parameters:
      aFireInitialEvents - True if initial events are fired to a listener, false otherwise.
    • getLayeredToSupport

      public ILcdLayered getLayeredToSupport()
      Returns the ILcdLayered which delegates his methods to this support
      Returns:
      the ILcdLayered which delegates his methods to this support
    • setLayeredToSupport

      public void setLayeredToSupport(ILcdLayered aLayeredToSupport)
      Sets the ILcdLayered which delegates his methods to this support
      Parameters:
      aLayeredToSupport - the ILcdLayered which delegates his methods to this support
    • layerCount

      public int layerCount()
      Description copied from interface: ILcdLayered
      Returns the number of ILcdLayer objects in this ILcdLayered.
      Specified by:
      layerCount in interface ILcdLayered
      Returns:
      the number of ILcdLayer objects in this ILcdLayered.
    • layers

      public Enumeration layers()
      Description copied from interface: ILcdLayered
      Returns an Enumeration of all ILcdLayer objects currently in this ILcdLayered, starting from the bottom layer to the top layer.
      Specified by:
      layers in interface ILcdLayered
      Returns:
      an Enumeration of all ILcdLayer objects currently in this ILcdLayered, starting from the bottom layer to the top layer.
    • layersBackwards

      public Enumeration layersBackwards()
      Description copied from interface: ILcdLayered
      Returns an Enumeration of all ILcdLayer objects currently in this ILcdLayered, starting from the top layer to the bottom layer.
      Specified by:
      layersBackwards in interface ILcdLayered
      Returns:
      an Enumeration of all ILcdLayer objects currently in this ILcdLayered, starting from the top layer to the bottom layer.
    • indexOf

      public int indexOf(ILcdLayer aLayer) throws NoSuchElementException
      Description copied from interface: ILcdLayered
      Returns the index if the given layer is in the list.
      Specified by:
      indexOf in interface ILcdLayered
      Parameters:
      aLayer - the layer whose index to return
      Returns:
      the index of aLayer
      Throws:
      NoSuchElementException - if aLayer is not in the list
    • moveLayerAt

      public void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException
      Description copied from interface: ILcdLayered
      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.

      Specified by:
      moveLayerAt in interface ILcdLayered
      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.
    • getLayer

      public ILcdLayer getLayer(int aIndex) throws ArrayIndexOutOfBoundsException
      Description copied from interface: ILcdLayered
      Returns the ILcdLayer in this ILcdLayered with index aIndex.
      Specified by:
      getLayer in interface ILcdLayered
      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

      public ILcdLayer layerOf(ILcdModel aModel) throws NoSuchElementException
      Description copied from interface: ILcdLayered
      Returns the ILcdLayer of this ILcdLayered that contains the given ILcdModel.
      Specified by:
      layerOf in interface ILcdLayered
      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
    • addLayeredListener

      public void addLayeredListener(ILcdLayeredListener aLayeredListener)
      Adds an ILcdLayeredListener to this list.
      Specified by:
      addLayeredListener in interface ILcdLayered
      Parameters:
      aLayeredListener - the listener that from now on will be notified of all changes to the ILcdLayered
      See Also:
    • removeLayeredListener

      public void removeLayeredListener(ILcdLayeredListener aLayeredListener)
      Removes an ILcdLayeredListener from this list.
      Specified by:
      removeLayeredListener in interface ILcdLayered
      Parameters:
      aLayeredListener - the listener that will no longer be notified of changes to the ILcdLayered
      See Also:
    • fireLayeredEvent

      public void fireLayeredEvent(TLcdLayeredEvent aLayeredEvent)
    • removeAllObjects

      public void removeAllObjects()
      Removes all the Objects in each ILcdModel of each ILcdLayer of the list.
    • containsLayer

      public boolean containsLayer(ILcdLayer aLayer)
      Tests if the given ILcdLayer is in the list.
      Specified by:
      containsLayer in interface ILcdLayered
      Parameters:
      aLayer - the layer to check whether it is in this layered.
      Returns:
      true if aLayer is in this ILcdLayered, false otherwise.
    • bottomLayer

      public ILcdLayer bottomLayer() throws NoSuchElementException
      Returns the first ILcdLayer of the list.
      Throws:
      NoSuchElementException
    • topLayer

      public ILcdLayer topLayer() throws NoSuchElementException
      Returns the last ILcdLayer of the list.
      Throws:
      NoSuchElementException
    • addLayer

      public boolean addLayer(ILcdLayer aLayer)
      Adds an ILcdLayer (containing an ILcdModel) on the top of the list. No action is performed if the given ILcdLayer is already contained in the list.
      Parameters:
      aLayer - the layer to be added
      Returns:
      true (false) if the layer has been added (not been added).
    • addLayer

      public boolean addLayer(ILcdLayer aLayer, int aIndex)
      Adds an ILcdLayer (containing an ILcdModel) at index aIndex to the list. No action is performed if the given ILcdLayer is already contained in the list.
      Parameters:
      aLayer - the layer to be added
      aIndex - the target index for aLayer in the list. The index must be a value greater than or equal to 0 and less than or equal to the current number of layers layerCount() . (If the index is equal to the current number of layers, the new element is appended to the list.)
      Returns:
      true (false) if the layer has been added (not been added).
    • removeLayer

      public void removeLayer(ILcdLayer aLayer)
      Removes an ILcdLayer from the list. No action is performed if the given ILcdLayer is not contained in the list.
      Specified by:
      removeLayer in interface ILcdLayered
      Parameters:
      aLayer - the layer to remove.
    • removeAllLayers

      public void removeAllLayers()
      Removes all the ILcdLayer from this list. No action is performed if the given ILcdLayer is not contained in the list.
      Specified by:
      removeAllLayers in interface ILcdLayered
    • removeLayer

      public void removeLayer(String aLayerLabel)
      Removes from the list the ILcdLayer which label is aLayerLabel. No action is performed if the given ILcdLayer is not contained in the list.
    • findModelLayer

      public ILcdLayer findModelLayer(ILcdModel aModel)