es.prodevelop.gvsig.mobile.fmap.layer
Class FLyrDefault

java.lang.Object
  extended byes.prodevelop.gvsig.mobile.fmap.layer.FLyrDefault
All Implemented Interfaces:
FLayer
Direct Known Subclasses:
FLayerGenericRaster, FLyrVect

public abstract class FLyrDefault
extends java.lang.Object
implements FLayer

Implementación de las características de alto nivel de las capas: visibilidad, activación, nombre, ...


Constructor Summary
FLyrDefault()
           
 
Method Summary
 void addError(FMapDriverException error)
          add an error cause to describe the layer's wrong status
 boolean addLayerListener(LayerListener o)
          Añade a la lista de listener un nuevo LayerListener.
 java.awt.image.BufferedImage getCacheImageDrawnLayers()
           
 ICoordTrans getCoordTrans()
          Devuelve las transformación de coordenadas.
 FMapDriverException getError(int i)
          return the specified error
 java.util.List getErrors()
          Returns a list with all layer errors
 java.lang.String getInfoString()
          Devuelve una cadena con informacion sobre la capa.
 LayerListener[] getLayerListeners()
           
 MapContext getMapContext()
          Devuelve el FMap al que está añadida la capa o null si la capa no ha sido añadida a ningún FMap
 double getMaxScale()
          La capa no se visualiza si está por encima de esa escala
 java.lang.String getMemo()
           
 double getMinScale()
          Método que es llamado por Flayers para notificar a la capa que va a ser añadida.
 java.lang.String getName()
          Devuelve el nombre de la capa.
 int getNumErrors()
          returns the number of errors that causes layer unavailable status
 IProjection getProjection()
           
 java.lang.Object getProperty(java.lang.Object key)
          Useful to associate any object to a layer.
 int getTransparency()
          Devuelve el nivel de transparencia de la capa.
 boolean isActive()
          Devuelve true si la capa esta activa.
 boolean isAvailable()
           
 boolean isCachingDrawnLayers()
           
 boolean isDirty()
           
 boolean isInfoable()
           
 boolean isInTOC()
          If the layer appears in the TOC then true is returned, if false the layer will not be displayed at the TOC although it remains in the view and in the project
 boolean isOk()
          Return if the layer is in OK status (it hasnt got errors)
 boolean isVisible()
          Devuelve true si la capa es visible.
 boolean isWithinScale(double scale)
           
 void load()
          Realiza las operaciones de inicialización de la capa.
 void reload()
          Intenta recuperar una capa ante un posible error.
 boolean removeLayerListener(LayerListener o)
          Borra de la lista de listeners el que se pasa como parámetro.
 void setActive(boolean selected)
          Pone la capa actual a activa o inactiva según el boolean que se pasa como parámetro.
 void setAvailable(boolean a)
           
 void setCacheImageDrawnLayers(java.awt.image.BufferedImage cacheImageDrawnLayers)
           
 void setCachingDrawnLayers(boolean bCacheDrawnLayers)
           
 void setCoordTrans(ICoordTrans ct)
          Inserta la Transformación de coordenadas.
 void setDirty(boolean d)
          true if this layer need a repaint.
 void setInfoable(boolean inf)
           
 void setMapContext(MapContext m)
           
 void setMaxScale(double maxScale)
           
 void setMemo(java.lang.String m)
           
 void setMinScale(double minScale)
           
 void setName(java.lang.String name)
          Inserta un nombre a la capa.
 void setProjection(IProjection proj)
          Inserta una proyección.
 void setProperty(java.lang.Object key, java.lang.Object val)
           
 void setTransparency(int trans)
          Inserta el nivel de transparencia de la capa.
 void setVisible(boolean visibility)
          Pone la capa en modo visible o no visible.
 boolean visibleRequired()
          Devuelve true si la capa esta establecida como visible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface es.prodevelop.gvsig.mobile.fmap.layer.FLayer
clean, draw, getFullExtent, getId, isWritable, toXML, wakeUp
 

Constructor Detail

FLyrDefault

public FLyrDefault()
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Description copied from interface: FLayer
Useful to associate any object to a layer. For example, you can attach a network definition to key "network" and check if a layer has a network loaded if getAssociatedObject("network") is not null

Specified by:
getProperty in interface FLayer
Parameters:
key -
Returns:
null if key is not found

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object val)
Specified by:
setProperty in interface FLayer
Parameters:
key -
val -

setActive

public void setActive(boolean selected)
Description copied from interface: FLayer
Pone la capa actual a activa o inactiva según el boolean que se pasa como parámetro.

Specified by:
setActive in interface FLayer
Parameters:
selected - activa.
See Also:
com.iver.cit.gvsig.fmap.layers.FLayer#setActive(boolean)

isActive

public boolean isActive()
Description copied from interface: FLayer
Devuelve true si la capa esta activa.

Specified by:
isActive in interface FLayer
Returns:
activa.
See Also:
com.iver.cit.gvsig.fmap.layers.FLayer#isActive()

setName

public void setName(java.lang.String name)
Description copied from interface: FLayer
Inserta un nombre a la capa.

Specified by:
setName in interface FLayer
Parameters:
name - nombre.
See Also:
com.iver.cit.gvsig.fmap.layers.FLayer#setName(java.lang.String)

getName

public java.lang.String getName()
Description copied from interface: FLayer
Devuelve el nombre de la capa.

Specified by:
getName in interface FLayer
Returns:
nombre de la capa.
See Also:
com.iver.cit.gvsig.fmap.layers.FLayer#getName()

load

public void load()
          throws FMapDriverException
Description copied from interface: FLayer
Realiza las operaciones de inicialización de la capa. El método es invocado una única vez durante la vida de la capa y justo antes de visualizar la capa

Specified by:
load in interface FLayer
Throws:
FMapDriverException

setVisible

public void setVisible(boolean visibility)
Description copied from interface: FLayer
Pone la capa en modo visible o no visible.

Specified by:
setVisible in interface FLayer
Parameters:
visibility - visibilidad.
See Also:
com.iver.cit.gvsig.fmap.layers.FLayer#setVisible(boolean)

isVisible

public boolean isVisible()
Description copied from interface: FLayer
Devuelve true si la capa es visible. Es dependiente isAvialable @link isAvialable

Specified by:
isVisible in interface FLayer
Returns:
visibilidad.
See Also:
com.iver.cit.gvsig.fmap.layers.FLayer#isVisible()

setProjection

public void setProjection(IProjection proj)
Inserta una proyección.

Parameters:
proj - Proyección.

getProjection

public IProjection getProjection()
See Also:
org.cresques.geo.Projected#getProjection()

getTransparency

public int getTransparency()
Devuelve el nivel de transparencia de la capa.

Returns:
Entero que representa el nivel de transparencia.

setTransparency

public void setTransparency(int trans)
Inserta el nivel de transparencia de la capa.

Parameters:
trans - Nivel de transparencia.

getMapContext

public MapContext getMapContext()
Description copied from interface: FLayer
Devuelve el FMap al que está añadida la capa o null si la capa no ha sido añadida a ningún FMap

Specified by:
getMapContext in interface FLayer
Returns:
FMap
See Also:
com.iver.cit.gvsig.fmap.layers.FLayer#getMapContext()

setMapContext

public void setMapContext(MapContext m)
Specified by:
setMapContext in interface FLayer

addLayerListener

public boolean addLayerListener(LayerListener o)
Añade a la lista de listener un nuevo LayerListener.

Specified by:
addLayerListener in interface FLayer
Parameters:
o - LayerListener.
Returns:
boolean.

getLayerListeners

public LayerListener[] getLayerListeners()
Specified by:
getLayerListeners in interface FLayer

removeLayerListener

public boolean removeLayerListener(LayerListener o)
Borra de la lista de listeners el que se pasa como parámetro.

Specified by:
removeLayerListener in interface FLayer
Parameters:
o - LayerListener a borrar.
Returns:
True si ha sido correcto el borrado del Listener.

setCoordTrans

public void setCoordTrans(ICoordTrans ct)
Inserta la Transformación de coordenadas.

Specified by:
setCoordTrans in interface FLayer
Parameters:
ct - Transformación de coordenadas.

getCoordTrans

public ICoordTrans getCoordTrans()
Devuelve las transformación de coordenadas.

Specified by:
getCoordTrans in interface FLayer
Returns:
ct.

getMinScale

public double getMinScale()
Método que es llamado por Flayers para notificar a la capa que va a ser añadida. Esta previa notificación es util para las capas que necesitan hacer algo antes de ser añadida. Por ejemplo, el raster necesita volver a abrir el fichero que ha podido ser cerrado con anterioridad. Si no se redefine este método no se hará nada ya que este es vacio.

Specified by:
getMinScale in interface FLayer
Returns:
la escala minima de visualización

getMaxScale

public double getMaxScale()
Description copied from interface: FLayer
La capa no se visualiza si está por encima de esa escala

Specified by:
getMaxScale in interface FLayer
Returns:
la escala máxima de visualización

setMinScale

public void setMinScale(double minScale)
Specified by:
setMinScale in interface FLayer

setMaxScale

public void setMaxScale(double maxScale)
Specified by:
setMaxScale in interface FLayer

isWithinScale

public boolean isWithinScale(double scale)
Specified by:
isWithinScale in interface FLayer

isInTOC

public boolean isInTOC()
Description copied from interface: FLayer
If the layer appears in the TOC then true is returned, if false the layer will not be displayed at the TOC although it remains in the view and in the project

Specified by:
isInTOC in interface FLayer

isCachingDrawnLayers

public boolean isCachingDrawnLayers()

setCachingDrawnLayers

public void setCachingDrawnLayers(boolean bCacheDrawnLayers)

getCacheImageDrawnLayers

public java.awt.image.BufferedImage getCacheImageDrawnLayers()

setCacheImageDrawnLayers

public void setCacheImageDrawnLayers(java.awt.image.BufferedImage cacheImageDrawnLayers)

isDirty

public boolean isDirty()
Specified by:
isDirty in interface FLayer
Returns:
true if this layer need a repaint.

setDirty

public void setDirty(boolean d)
Description copied from interface: FLayer
true if this layer need a repaint. By default, all layers will be set to dirty when the extent changes. But for events like changing its legend, or editing a layer, we can perform some optimization in the method prepareDrawing from FMap.

Specified by:
setDirty in interface FLayer
Parameters:
d -

isAvailable

public boolean isAvailable()
Specified by:
isAvailable in interface FLayer
Returns:
true if this layer is aviable. Default value is true.

setAvailable

public void setAvailable(boolean a)
Specified by:
setAvailable in interface FLayer
Returns:
set layer aviable or not.

reload

public void reload()
            throws FMapDriverException
Description copied from interface: FLayer
Intenta recuperar una capa ante un posible error. Si tiene algun problema en la carga, marca el avialable a false y lanza una excepcion.

Specified by:
reload in interface FLayer
Throws:
FMapDriverException

isOk

public boolean isOk()
Description copied from interface: FLayer
Return if the layer is in OK status (it hasnt got errors)

Specified by:
isOk in interface FLayer

getNumErrors

public int getNumErrors()
Description copied from interface: FLayer
returns the number of errors that causes layer unavailable status

Specified by:
getNumErrors in interface FLayer
Returns:

getError

public FMapDriverException getError(int i)
Description copied from interface: FLayer
return the specified error

Specified by:
getError in interface FLayer
Parameters:
i -
Returns:

getErrors

public java.util.List getErrors()
Description copied from interface: FLayer
Returns a list with all layer errors

Specified by:
getErrors in interface FLayer
Returns:

addError

public void addError(FMapDriverException error)
Description copied from interface: FLayer
add an error cause to describe the layer's wrong status

Specified by:
addError in interface FLayer
Parameters:
error -

visibleRequired

public boolean visibleRequired()
Description copied from interface: FLayer
Devuelve true si la capa esta establecida como visible.

Specified by:
visibleRequired in interface FLayer
Returns:
visibilidad.

getInfoString

public java.lang.String getInfoString()
Description copied from interface: FLayer
Devuelve una cadena con informacion sobre la capa.

Specified by:
getInfoString in interface FLayer
Returns:
visibilidad.

isInfoable

public boolean isInfoable()
Specified by:
isInfoable in interface FLayer

setInfoable

public void setInfoable(boolean inf)
Specified by:
setInfoable in interface FLayer

setMemo

public void setMemo(java.lang.String m)
Specified by:
setMemo in interface FLayer

getMemo

public java.lang.String getMemo()
Specified by:
getMemo in interface FLayer