Interface LayerCollection

All Superinterfaces:
LayersVisitable, org.gvsig.tools.visitor.Visitable
All Known Implementing Classes:
FLayers

public interface LayerCollection extends LayersVisitable

Interface with methods for a collection of layers.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Value used to specify the insertion after an element.
    static final int
    Value used to specify the insertion before an element.
    static final int
    Value used to specify the insertion at the beginning.
    static final int
    Value used to specify the insertion at the end.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a new layer to this collection.
    void
    addLayer(FLayer layer, int where, FLayer adjoiningLayer)
    Adds a new layer to this collection before or after an element if supplied, and if not at the beginning or end of the collection.
    void
    Adds a listener of events produced on a collection of layers.
    void
     
    void
    endDraw(Graphics2D g, ViewPort viewPort)
     
    Returns an array with all active layers in this collection.
    getLayer(int index)
    Returns the ith-output directed son (from bottom up) of this collection.
    getLayer(String layerName)
    Returns a first-level layer of this collection, using its name.
    getLayer(org.gvsig.fmap.dal.DataStore store)
    Returns a first-level layer of this collection, using its name.
     
    int
    Returns the number of layers that are at the first level inside this one.
    Returns an array with all visible layers in this collection.
    void
    move(FLayer layer, LayerCollection group)
    Moves a layer from this collection to the end of another collection.
    void
    move(FLayer layer, LayerCollection group, int where, FLayer adjoiningLayer)
    Moves a layer from this collection to another collection before or after an element if supplied, and if not at the beginning or end of the collection.
    void
    moveTo(int from, int to)
    Moves a layer of the collection to another position in internal list.
    void
    removeLayer(int idLayer)
    Removes a layer using its identifier.
    void
    removeLayer(String layerName)
    Removes a layer using its name.
    void
    Removes a layer from this collection.
    void
    Removes a listener of events produced on a collection of layers.
    void
    setAllActives(boolean active)
    Changes the status of all layers to active or inactive.
    void
    setAllVisibles(boolean visible)
    Changes the status of all layers to visible or invisible.

    Methods inherited from interface org.gvsig.fmap.mapcontext.layers.operations.LayersVisitable

    accept

    Methods inherited from interface org.gvsig.tools.visitor.Visitable

    accept
  • Field Details

    • BEGIN

      static final int BEGIN
      Value used to specify the insertion at the beginning.
      See Also:
    • END

      static final int END
      Value used to specify the insertion at the end.
      See Also:
    • BEFORE

      static final int BEFORE
      Value used to specify the insertion before an element.
      See Also:
    • AFTER

      static final int AFTER
      Value used to specify the insertion after an element.
      See Also:
  • Method Details

    • addLayerCollectionListener

      void addLayerCollectionListener(LayerCollectionListener listener)

      Adds a listener of events produced on a collection of layers.

      Parameters:
      listener - a LayerCollectionListener
      See Also:
    • removeLayerCollectionListener

      void removeLayerCollectionListener(LayerCollectionListener listener)

      Removes a listener of events produced on a collection of layers.

      Parameters:
      listener - a LayerCollectionListener
      See Also:
    • addLayer

      void addLayer(FLayer layer) throws CancelationException, LoadLayerException

      Adds a new layer to this collection.

      Parameters:
      layer - the new layer
      Throws:
      CancelationException - any exception produced during the cancellation of the driver.
      LoadLayerException - any exception produced loading the layer.
      See Also:
    • addLayer

      void addLayer(FLayer layer, int where, FLayer adjoiningLayer) throws LayerNotFoundInCollectionException

      Adds a new layer to this collection before or after an element if supplied, and if not at the beginning or end of the collection.

      .

      Parameters:
      layer - a FLayer to move
      where - the position parameter. The valid values are:
      0 = BEGIN (first position)
      1 = END (last position)
      2 = BEFORE (before target layer)
      3 = AFTER (after target layer)
      adjoiningLayer - a FLayer a layer adjacent to where to insert the layer.
      group - a LayerCollection in which the layer has to be moved
      Throws:
      CancelationException - any exception produced during the cancellation of the driver.
      LoadLayerException - any exception produced loading the layer.
      LayerNotFoundInCollectionException
      See Also:
      • invalid reference
        #moveTo(FLayer, LayerCollection, int, FLayer)
    • moveTo

      void moveTo(int from, int to) throws CancelationException

      Moves a layer of the collection to another position in internal list. It doesn't consider sub-nodes of layers.

      Parameters:
      from - origin position
      to - destination position
      Throws:
      CancelationException - any exception produced during the cancellation of the driver.
    • removeLayer

      void removeLayer(FLayer lyr) throws CancelationException

      Removes a layer from this collection.

      Parameters:
      lyr - a layer
      Throws:
      CancelationException - any exception produced during the cancellation of the driver.
      See Also:
    • removeLayer

      void removeLayer(int idLayer)

      Removes a layer using its identifier.

      Parameters:
      idLayer - layer identifier
      See Also:
    • removeLayer

      void removeLayer(String layerName)

      Removes a layer using its name.

      Parameters:
      layerName - the name of the layer
      See Also:
    • getVisibles

      FLayer[] getVisibles()

      Returns an array with all visible layers in this collection.

      Returns:
      array with first-level visible layer nodes, or null if no there is no layer visible
      See Also:
    • getActives

      FLayer[] getActives()

      Returns an array with all active layers in this collection.

      Returns:
      array with first-level active layer nodes, or null if no there is no layer actived
      See Also:
    • getLayers

      List<FLayer> getLayers(Predicate<FLayer> filter)
    • getLayer

      FLayer getLayer(int index)

      Returns the ith-output directed son (from bottom up) of this collection.

      Parameters:
      index - index of the ith-output layer in this collection.
      Returns:
      a layer
      See Also:
    • getLayer

      FLayer getLayer(String layerName)
      Returns a first-level layer of this collection, using its name.
      Parameters:
      layerName - name of a layer of this collection
      Returns:
      a layer
      See Also:
    • getLayer

      FLayer getLayer(org.gvsig.fmap.dal.DataStore store)
      Returns a first-level layer of this collection, using its name.
      Parameters:
      store - of a layer of this collection
      Returns:
      a layer
    • getLayersCount

      int getLayersCount()

      Returns the number of layers that are at the first level inside this one.

      Doesn't counts the sublayers (of FLayers subnodes).

      Returns:
      number >= 0 with layers that are at the same first-level
      See Also:
    • setAllActives

      void setAllActives(boolean active)

      Changes the status of all layers to active or inactive.

      Parameters:
      active - a boolean value
      See Also:
    • setAllVisibles

      void setAllVisibles(boolean visible)

      Changes the status of all layers to visible or invisible.

      Parameters:
      visible - a boolean value
      See Also:
    • beginDraw

      void beginDraw(Graphics2D g, ViewPort viewPort)
    • endDraw

      void endDraw(Graphics2D g, ViewPort viewPort)
    • move

      void move(FLayer layer, LayerCollection group, int where, FLayer adjoiningLayer) throws LayerNotFoundInCollectionException

      Moves a layer from this collection to another collection before or after an element if supplied, and if not at the beginning or end of the collection.

      Parameters:
      layer - a FLayer to move
      group - a LayerCollection in which the layer has to be moved
      where - the position parameter. The valid values are:
      0 = BEGIN (first position)
      1 = END (last position)
      2 = BEFORE (before target layer)
      3 = AFTER (after target layer)
      adjoiningLayer - a FLayer a layer adjacent to where to insert the layer.
      Throws:
      LayerNotFoundInCollectionException
      See Also:
    • move

      void move(FLayer layer, LayerCollection group)

      Moves a layer from this collection to the end of another collection.

      Parameters:
      layer - a FLayer to move
      group - a LayerCollection in which the layer has to be moved
      Throws:
      LayerNotFoundInCollectionException