Class FLayerStatus

java.lang.Object
org.gvsig.fmap.mapcontext.layers.FLayerStatus
All Implemented Interfaces:
IFLayerStatus, org.gvsig.tools.persistence.Persistent

public class FLayerStatus extends Object implements IFLayerStatus

All layers in libFMap can be in a set of states, that their combination represent the status of a layer.

FLayerStatus class supports the common status for all kind of FLyrDefault layers.

This means that not necessarily all layers can stay in all possible status, it depends on its particular nature.

Layer status states defined in FLayerStatus are:

  • Available: the layer is available if the source of its data is on-line.
  • Visible: one layer is visible if it's selected its check box associated in TOC. This implies that layer will be called to be painted unless the necessary data would be unavailable; this situation is more frequent with layers of remote services.
  • Active: is active if it's selected at the TOC.
  • Dirty: is dirty if needs to be refreshed.
  • In TOC: if it's being listed in a TOC GUI.
  • Editing: if the layer it's being edited now.
  • Writable: if can be modified and saved the changes.
  • Cache drawn layers: if stores previous draws. This is useful to accelerate the draw of the layer.
  • Driver loaded: if driver for managing the layer has been loaded successfully.

Author:
azabala
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    The layer is active if it's selected at the TOC.
    boolean
    Layer's availability: the layer is available if the source of its data is on-line.
    boolean
    This state reports if the layer stores previous draws.
    boolean
    One layer is dirty if needs to be refreshed.
    boolean
    This parameter reports if the layer it's being edited now.
    boolean
    The layer is in TOC if it's being listed in a TOC GUI.
    boolean
    Layer's visibility: the layer is visible if it's selected its check box associated in TOC.
    boolean
    This parameter reports if the layer can be modified and saved the changes.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance with the default status of a FLyrDefault layer:
    Visible: true . Active: false . In TOC: true . Editing: false . Cache drawn layers: false . Dirty: false . Available: true . Driver loaded: true . Writable: false . Without driver errors.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Stores information of an exception produced working with a driver of the layer.
     
    boolean
     
    getError(int i)
    Gets the information of the nth layer driver exception registered in the status.
    Returns a list of errors produced in a layer working with its driver.
    int
    Gets the number of driver exceptions produced working with the layer.
    boolean
    Returns if has been loaded successfully the driver for managing the layer.
    boolean
    Returns if there have been driver errors working with the layer.
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    setDriverLoaded(boolean driverLoaded)
    Sets if has been loaded successfully the driver for managing the layer.
    void
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • available

      public boolean available

      Layer's availability: the layer is available if the source of its data is on-line.

    • visible

      public boolean visible

      Layer's visibility: the layer is visible if it's selected its check box associated in TOC. This implies that layer will tried to be painted unless the necessary data would be unavailable; this situation is more frequent with layers of remote services.

    • active

      public boolean active

      The layer is active if it's selected at the TOC.

    • dirty

      public boolean dirty

      One layer is dirty if needs to be refreshed.

    • inTOC

      public boolean inTOC

      The layer is in TOC if it's being listed in a TOC GUI.

    • editing

      public boolean editing

      This parameter reports if the layer it's being edited now.

    • writable

      public boolean writable

      This parameter reports if the layer can be modified and saved the changes.

    • cacheDrawnLayers

      public boolean cacheDrawnLayers

      This state reports if the layer stores previous draws. That's useful to accelerate the draw of the layer.

  • Constructor Details

    • FLayerStatus

      public FLayerStatus()

      Creates an instance with the default status of a FLyrDefault layer:

      • Visible: true .
      • Active: false .
      • In TOC: true .
      • Editing: false .
      • Cache drawn layers: false .
      • Dirty: false .
      • Available: true .
      • Driver loaded: true .
      • Writable: false .
      • Without driver errors.

  • Method Details

    • addLayerError

      public void addLayerError(Throwable error)

      Stores information of an exception produced working with a driver of the layer.

      Parameters:
      error - the driver exception
    • setLayerError

      public void setLayerError(Throwable ex)
    • cloneStatus

      public FLayerStatus cloneStatus()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getNumErrors

      public int getNumErrors()

      Gets the number of driver exceptions produced working with the layer.

      Returns:
      number of driver exceptions produced
    • getError

      public Throwable getError(int i)

      Gets the information of the nth layer driver exception registered in the status.

      Parameters:
      i - ith layer exception registered
      Returns:
      the nth layer driver exception registered
    • isOk

      public boolean isOk()

      Returns if there have been driver errors working with the layer.

      Returns:
      true if there have driver errors working with the layer; otherwise false
    • getErrors

      public List<Throwable> getErrors()

      Returns a list of errors produced in a layer working with its driver.

      Returns:
      list errors produced in a layer working with its driver
    • isDriverLoaded

      public boolean isDriverLoaded()

      Returns if has been loaded successfully the driver for managing the layer.

      Returns:
      true if has been loaded successfully the driver for managing the layer; otherwise false
    • setDriverLoaded

      public void setDriverLoaded(boolean driverLoaded)

      Sets if has been loaded successfully the driver for managing the layer.

      Parameters:
      driverLoaded - true if has been loaded successfully the driver for managing the layer; otherwise false
    • loadFromState

      public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      loadFromState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • saveToState

      public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      saveToState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException