Class Layers

  • All Implemented Interfaces:
    java.lang.Iterable<Layer>, java.util.RandomAccess

    public class Layers
    extends java.lang.Object
    implements java.lang.Iterable<Layer>, java.util.RandomAccess
    A thread-safe Layer list which does not allow null elements.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, Layer layer)
      Adds a new layer at the specified position.
      void add​(int index, Layer layer, boolean redraw)
      Adds a new layer at the specified position.
      void add​(Layer layer)
      Adds a new layer on top.
      void add​(Layer layer, boolean redraw)
      Adds a new layer on top.
      void add​(Layer layer, int group)
      Adds a new layer using layer groups.
      void add​(Layer layer, int group, boolean redraw)
      Adds a new layer using layer groups.
      boolean addAll​(int index, java.util.Collection<Layer> layers)
      Adds multiple new layers at the specified position.
      boolean addAll​(int index, java.util.Collection<Layer> layers, boolean redraw)
      Adds multiple new layers at the specified position.
      boolean addAll​(java.util.Collection<Layer> layers)
      Adds multiple new layers on top.
      boolean addAll​(java.util.Collection<Layer> layers, boolean redraw)
      Adds multiple new layers on top.
      boolean addAll​(java.util.Collection<Layer> layers, int group)
      Adds multiple new layers using layer groups.
      boolean addAll​(java.util.Collection<Layer> layers, int group, boolean redraw)
      Adds multiple new layers using layer groups.
      void addGroup​(int group)
      Adds a new layer group.
      void clear()
      Removes all layers.
      void clear​(boolean redraw)
      Removes all layers.
      boolean contains​(Layer layer)  
      Layer get​(int index)  
      int indexOf​(Layer layer)  
      boolean isEmpty()  
      java.util.Iterator<Layer> iterator()  
      Layer remove​(int index)
      Removes a layer.
      Layer remove​(int index, boolean redraw)
      Removes a layer.
      boolean remove​(Layer layer)
      Removes a layer.
      boolean remove​(Layer layer, boolean redraw)
      Removes a layer.
      boolean removeAll​(java.util.Collection<Layer> layers)
      Removes multiple layers.
      boolean removeAll​(java.util.Collection<Layer> layers, boolean redraw)
      Removes multiple layers.
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • add

        public void add​(int index,
                        Layer layer)
        Adds a new layer at the specified position.

        Note: By default a redraw will take place afterwards. To avoid this, use add(int, Layer, boolean).

        Parameters:
        index - The position at which to add the new layer (the lowest layer has position 0)
        layer - The new layer to add
        See Also:
        List.add(int, Object)
      • add

        public void add​(int index,
                        Layer layer,
                        boolean redraw)
        Adds a new layer at the specified position.
        Parameters:
        index - The position at which to add the new layer (the lowest layer has position 0)
        layer - The new layer to add
        redraw - Whether the map should be redrawn after adding the layer
        See Also:
        List.add(int, Object)
      • add

        public void add​(Layer layer)
        Adds a new layer on top.

        Note: By default a redraw will take place afterwards. To avoid this, use add(Layer, boolean).

        Parameters:
        layer - The new layer to add
        See Also:
        List.add(Object)
      • add

        public void add​(Layer layer,
                        boolean redraw)
        Adds a new layer on top.
        Parameters:
        layer - The new layer to add
        redraw - Whether the map should be redrawn after adding the layer
        See Also:
        List.add(Object)
      • add

        public void add​(Layer layer,
                        int group)
        Adds a new layer using layer groups.

        Note: By default a redraw will take place afterwards. To avoid this, use add(Layer, int, boolean).

        Parameters:
        layer - The new layer to add
        group - The layer group
        See Also:
        List.add(Object)
      • add

        public void add​(Layer layer,
                        int group,
                        boolean redraw)
        Adds a new layer using layer groups.
        Parameters:
        layer - The new layer to add
        group - The layer group
        redraw - Whether the map should be redrawn after adding the layer
        See Also:
        List.add(Object)
      • addAll

        public boolean addAll​(java.util.Collection<Layer> layers)
        Adds multiple new layers on top.

        Note: By default a redraw will take place afterwards. To avoid this, use addAll(Collection, boolean).

        Parameters:
        layers - The new layers to add
        See Also:
        List.addAll(Collection)
      • addAll

        public boolean addAll​(java.util.Collection<Layer> layers,
                              boolean redraw)
        Adds multiple new layers on top.
        Parameters:
        layers - The new layers to add
        redraw - Whether the map should be redrawn after adding the layers
        See Also:
        List.addAll(Collection)
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<Layer> layers)
        Adds multiple new layers at the specified position.

        Note: By default a redraw will take place afterwards. To avoid this, use addAll(int, Collection, boolean).

        Parameters:
        index - The position at which to add the new layers (the lowest layer has position 0)
        layers - The new layers to add
        See Also:
        List.addAll(int, Collection)
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<Layer> layers,
                              boolean redraw)
        Adds multiple new layers at the specified position.
        Parameters:
        index - The position at which to add the new layers (the lowest layer has position 0)
        layers - The new layers to add
        redraw - Whether the map should be redrawn after adding the layers
        See Also:
        List.addAll(int, Collection)
      • addAll

        public boolean addAll​(java.util.Collection<Layer> layers,
                              int group)
        Adds multiple new layers using layer groups.

        Note: By default a redraw will take place afterwards. To avoid this, use addAll(Collection, int, boolean).

        Parameters:
        layers - The new layers to add
        group - The layer group
        See Also:
        List.addAll(Collection)
      • addAll

        public boolean addAll​(java.util.Collection<Layer> layers,
                              int group,
                              boolean redraw)
        Adds multiple new layers using layer groups.
        Parameters:
        layers - The new layers to add
        group - The layer group
        redraw - Whether the map should be redrawn after adding the layers
        See Also:
        List.addAll(Collection)
      • addGroup

        public void addGroup​(int group)
        Adds a new layer group.
        Parameters:
        group - The layer group
      • clear

        public void clear()
        Removes all layers.

        Note: By default a redraw will take place afterwards. To avoid this, use clear(boolean).

        See Also:
        List.clear()
      • clear

        public void clear​(boolean redraw)
        Removes all layers.
        Parameters:
        redraw - Whether the map should be redrawn after removing the layers
        See Also:
        List.clear()
      • contains

        public boolean contains​(Layer layer)
        See Also:
        List.contains(Object)
      • get

        public Layer get​(int index)
        See Also:
        List.get(int)
      • indexOf

        public int indexOf​(Layer layer)
        See Also:
        List.indexOf(Object)
      • isEmpty

        public boolean isEmpty()
        See Also:
        List.isEmpty()
      • iterator

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

        public Layer remove​(int index)
        Removes a layer.

        Note: By default a redraw will take place afterwards. To avoid this, use remove(int, boolean).

        Parameters:
        index - The index of the layer to remove
        See Also:
        List.remove(int)
      • remove

        public Layer remove​(int index,
                            boolean redraw)
        Removes a layer.
        Parameters:
        index - The index of the layer to remove
        redraw - Whether the map should be redrawn after removing the layer
        See Also:
        List.remove(int)
      • remove

        public boolean remove​(Layer layer)
        Removes a layer.

        Note: By default a redraw will take place afterwards. To avoid this, use remove(Layer, boolean).

        Parameters:
        layer - The layer to remove
        See Also:
        List.remove(Object)
      • remove

        public boolean remove​(Layer layer,
                              boolean redraw)
        Removes a layer.
        Parameters:
        layer - The layer to remove
        redraw - Whether the map should be redrawn after removing the layer
        See Also:
        List.remove(Object)
      • removeAll

        public boolean removeAll​(java.util.Collection<Layer> layers)
        Removes multiple layers.

        Note: By default a redraw will take place afterwards. To avoid this, use removeAll(Collection, boolean).

        Parameters:
        layers - The layers to remove
        See Also:
        List.removeAll(Collection)
      • removeAll

        public boolean removeAll​(java.util.Collection<Layer> layers,
                                 boolean redraw)
        Removes multiple layers.
        Parameters:
        layers - The layers to remove
        redraw - Whether the map should be redrawn after removing the layers
        See Also:
        List.removeAll(Collection)
      • size

        public int size()
        See Also:
        List.size()