Class FLayerStatus
- All Implemented Interfaces:
IFLayerStatus,org.gvsig.tools.persistence.Persistent
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanThe layer is active if it's selected at the TOC.booleanLayer's availability: the layer is available if the source of its data is on-line.booleanThis state reports if the layer stores previous draws.booleanOne layer is dirty if needs to be refreshed.booleanThis parameter reports if the layer it's being edited now.booleanThe layer is in TOC if it's being listed in a TOC GUI.booleanLayer's visibility: the layer is visible if it's selected its check box associated in TOC.booleanThis parameter reports if the layer can be modified and saved the changes. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance with the default status of aFLyrDefaultlayer:
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 TypeMethodDescriptionvoidaddLayerError(Throwable error) Stores information of an exception produced working with a driver of the layer.booleangetError(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.intGets the number of driver exceptions produced working with the layer.booleanReturns if has been loaded successfully the driver for managing the layer.booleanisOk()Returns if there have been driver errors working with the layer.voidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidsetDriverLoaded(boolean driverLoaded) Sets if has been loaded successfully the driver for managing the layer.void
-
Field Details
-
available
public boolean availableLayer's availability: the layer is available if the source of its data is on-line.
-
visible
public boolean visibleLayer'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 activeThe layer is active if it's selected at the TOC.
-
dirty
public boolean dirtyOne layer is dirty if needs to be refreshed.
-
inTOC
public boolean inTOCThe layer is in TOC if it's being listed in a TOC GUI.
-
editing
public boolean editingThis parameter reports if the layer it's being edited now.
-
writable
public boolean writableThis parameter reports if the layer can be modified and saved the changes.
-
cacheDrawnLayers
public boolean cacheDrawnLayersThis 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
FLyrDefaultlayer:
- 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.
- Visible:
-
-
Method Details
-
addLayerError
Stores information of an exception produced working with a driver of the layer.
- Parameters:
error- the driver exception
-
setLayerError
-
cloneStatus
-
equals
-
getNumErrors
public int getNumErrors()Gets the number of driver exceptions produced working with the layer.
- Returns:
- number of driver exceptions produced
-
getError
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:
trueif there have driver errors working with the layer; otherwisefalse
-
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:
trueif has been loaded successfully the driver for managing the layer; otherwisefalse
-
setDriverLoaded
public void setDriverLoaded(boolean driverLoaded) Sets if has been loaded successfully the driver for managing the layer.
- Parameters:
driverLoaded-trueif has been loaded successfully the driver for managing the layer; otherwisefalse
-
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.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:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-