Class LayerList

  • All Implemented Interfaces:
    ListenableList<Layer>, java.lang.Iterable<Layer>, java.util.Collection<Layer>, java.util.List<Layer>

    public final class LayerList
    extends java.lang.Object
    implements ListenableList<Layer>
    Represents the operational layers of an ArcGISMap or the base or reference layers of a Basemap.

    This class is not creatable but layers can be added and removed. Changes to the list can be observed by adding a ListChangedListener.

    If the layers in the list are rendered in a MapView, changes to the list will have an immediate effect on how these layers are rendered in that MapView. If a layer is removed from the list it will disappear from the MapView and vice versa if a layer is added to the list it will be rendered in the MapView.

    The order in which layers are rendered in the MapView corresponds with the order of the layers in the list. The layer at index 0 is rendered as the bottom most layer, followed by the layer at index 1 being drawn above 0, and so on. Note: Elements within this list type will always be automatically wrapped.

    Since:
    100.0.0
    See Also:
    ListenableList, Layer, GeoModel.getOperationalLayers(), Basemap.getBaseLayers(), Basemap.getReferenceLayers(), MapView
    • Method Detail

      • add

        public void add​(int index,
                        Layer layer)
        Specified by:
        add in interface java.util.List<Layer>
      • add

        public boolean add​(Layer layer)
        Specified by:
        add in interface java.util.Collection<Layer>
        Specified by:
        add in interface java.util.List<Layer>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends Layer> layers)
        Specified by:
        addAll in interface java.util.List<Layer>
      • addAll

        public boolean addAll​(java.util.Collection<? extends Layer> layers)
        Specified by:
        addAll in interface java.util.Collection<Layer>
        Specified by:
        addAll in interface java.util.List<Layer>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<Layer>
        Specified by:
        clear in interface java.util.List<Layer>
      • contains

        public boolean contains​(java.lang.Object object)
        Specified by:
        contains in interface java.util.Collection<Layer>
        Specified by:
        contains in interface java.util.List<Layer>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> collection)
        Specified by:
        containsAll in interface java.util.Collection<Layer>
        Specified by:
        containsAll in interface java.util.List<Layer>
      • get

        public Layer get​(int index)
        Specified by:
        get in interface java.util.List<Layer>
      • indexOf

        public int indexOf​(java.lang.Object object)
        Specified by:
        indexOf in interface java.util.List<Layer>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<Layer>
        Specified by:
        isEmpty in interface java.util.List<Layer>
      • iterator

        public java.util.Iterator<Layer> iterator()
        Specified by:
        iterator in interface java.util.Collection<Layer>
        Specified by:
        iterator in interface java.lang.Iterable<Layer>
        Specified by:
        iterator in interface java.util.List<Layer>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object object)
        Specified by:
        lastIndexOf in interface java.util.List<Layer>
      • listIterator

        public java.util.ListIterator<Layer> listIterator()
        Specified by:
        listIterator in interface java.util.List<Layer>
      • listIterator

        public java.util.ListIterator<Layer> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<Layer>
      • remove

        public Layer remove​(int index)
        Specified by:
        remove in interface java.util.List<Layer>
      • remove

        public boolean remove​(java.lang.Object object)
        Specified by:
        remove in interface java.util.Collection<Layer>
        Specified by:
        remove in interface java.util.List<Layer>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> collection)
        Specified by:
        removeAll in interface java.util.Collection<Layer>
        Specified by:
        removeAll in interface java.util.List<Layer>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> collection)
        Specified by:
        retainAll in interface java.util.Collection<Layer>
        Specified by:
        retainAll in interface java.util.List<Layer>
      • set

        public Layer set​(int index,
                         Layer layer)
        Specified by:
        set in interface java.util.List<Layer>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<Layer>
        Specified by:
        size in interface java.util.List<Layer>
      • subList

        public java.util.List<Layer> subList​(int start,
                                             int end)
        Specified by:
        subList in interface java.util.List<Layer>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<Layer>
        Specified by:
        toArray in interface java.util.List<Layer>
      • toArray

        public <T> T[] toArray​(T[] array)
        Specified by:
        toArray in interface java.util.Collection<Layer>
        Specified by:
        toArray in interface java.util.List<Layer>
      • addListChangedListener

        public void addListChangedListener​(ListChangedListener<Layer> listener)
        Description copied from interface: ListenableList
        Adds a listener for added and removed events.

        Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.

        Specified by:
        addListChangedListener in interface ListenableList<Layer>
        Parameters:
        listener - this listener will be called back when items are added to or removed from the list
      • removeListChangedListener

        public boolean removeListChangedListener​(ListChangedListener<Layer> listener)
        Description copied from interface: ListenableList
        Removes the given listener from this class instance. It will no longer receive added or removed events.
        Specified by:
        removeListChangedListener in interface ListenableList<Layer>
        Parameters:
        listener - listener to remove
        Returns:
        true if the listenable list contained the given listener, false otherwise