com.iver.cit.gvsig.fmap
Class FMap

java.lang.Object
  extended bycom.iver.cit.gvsig.fmap.FMap

public class FMap
extends java.lang.Object

Modelo del mapa.

Author:
Fernando González Cortés

Nested Class Summary
 class FMap.LayerEventListener
          Evento Layer.
 
Field Summary
static double[] CHANGE
           
static double[] CHANGEM
           
static int CONTAINS
           
static int CROSSES
           
static int DISJOINT
           
static int EQUALS
           
static int INTERSECTS
           
static int OVERLAPS
           
static int TOUCHES
           
static int WITHIN
           
 
Constructor Summary
FMap(ViewPort vp)
          Crea un nuevo FMap.
 
Method Summary
 boolean addAtomicEventListener(AtomicEventListener listener)
          Añade un AtomicEventListener.
 void addLayerListener(LegendListener listener)
          Añade un LegendListener.
 void addToTrackLayer(FLayer vectorial)
          Añade una capa al grupo de capas que se sitúa por encima de todas las otras capas
 void beginAtomicEvent()
          Inicializa los AtomicEvent.
 void callLegendChanged(LegendChangedEvent e)
          Método ejecutado cuando hay un cambio de leyenda que se quiera reflejar.
 FMap cloneFMap()
          Crea un nuevo FMap totalmente desligado, se replican las capas y el ViewPort
static FMap createFromXML(XMLEntity xml)
          Crea un nuevo FMAp a partir del XMLEntity.
 void createIndex()
           
 FMap createNewFMap(ViewPort vp)
          Crea un nuevo FMap con la información del ViewPort que se pasa como parámetro.
 void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g)
           
 void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g, Cancellable cancel)
           
 void drawLabels(java.awt.image.BufferedImage b)
          Dibuja en la imagen que se pasa como parámetro el contenido de las capas visibles del mapa y teniendo en cuenta los datos del ViewPort contenido en este FMap
 void endAtomicEvent()
          Finaliza los AtomicEvent.
 java.awt.geom.Rectangle2D getFullExtent()
          Método de conveniencia.
 FLayers getLayers()
          Devuelve las capas que contiene el mapa.
 IProjection getProjection()
           
 long getScaleView()
          Devuelve la escala de la vista en pantalla.
 java.awt.geom.Rectangle2D getSelectionBounds()
           
 ViewPort getViewPort()
          Devuelve el ViewPort.
 XMLEntity getXMLEntity()
          Devuelve el XMLEntity.
 void invalidate()
          Método de conveniencia que se usa provisionalmente para solicitar un refresco de todo lo que dependa del FMap (MapContext).
 void print(java.awt.Graphics2D g)
          Imprime el las capas que contiene el FMap sobre el Graphics2D que se pasa como parámetro, normalmente es el Graphics de la impresora.
 void process(FeatureVisitor visitor)
           
 void processSelected(FeatureVisitor visitor)
           
 Record[] queryByPoint(java.awt.geom.Point2D p, double tolerance)
           
 Record[] queryByRect(java.awt.geom.Rectangle2D rect)
           
 Record[] queryByShape(IGeometry g, int relationship)
           
 boolean removeAtomicEventListener(AtomicEventListener listener)
          Borra un AtomicEventListener de la lista de listeners.
 void removeLayerListener(LegendListener listener)
          Borra un LegendListener.
 void reProject(ICoordTrans arg0)
           
 void select(FeatureVisitor visitor)
           
 void selectByPoint(java.awt.geom.Point2D p, double tolerance)
           
 void selectByRect(java.awt.geom.Rectangle2D rect)
           
 void selectByShape(IGeometry g, int relationship)
           
 void selectFromSelection()
           
 void setProjection(IProjection proj)
          Inserta la proyección.
 void setVectorial(VectorialAdapter v)
           
 void setViewPort(ViewPort viewPort)
          Inserta un ViewPort.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHANGEM

public static final double[] CHANGEM

CHANGE

public static final double[] CHANGE

EQUALS

public static final int EQUALS
See Also:
Constant Field Values

DISJOINT

public static final int DISJOINT
See Also:
Constant Field Values

INTERSECTS

public static final int INTERSECTS
See Also:
Constant Field Values

TOUCHES

public static final int TOUCHES
See Also:
Constant Field Values

CROSSES

public static final int CROSSES
See Also:
Constant Field Values

WITHIN

public static final int WITHIN
See Also:
Constant Field Values

CONTAINS

public static final int CONTAINS
See Also:
Constant Field Values

OVERLAPS

public static final int OVERLAPS
See Also:
Constant Field Values
Constructor Detail

FMap

public FMap(ViewPort vp)
Crea un nuevo FMap.

Parameters:
vp - ViewPort.
Method Detail

addLayerListener

public void addLayerListener(LegendListener listener)
Añade un LegendListener.

Parameters:
listener - LegendListener a añadir.

callLegendChanged

public void callLegendChanged(LegendChangedEvent e)
Método ejecutado cuando hay un cambio de leyenda que se quiera reflejar.

Parameters:
e - LegendChangedEvent.

removeLayerListener

public void removeLayerListener(LegendListener listener)
Borra un LegendListener.

Parameters:
listener - LegendListener a borrar.

getLayers

public FLayers getLayers()
Devuelve las capas que contiene el mapa.

Returns:
Capas.

drawLabels

public void drawLabels(java.awt.image.BufferedImage b)
Dibuja en la imagen que se pasa como parámetro el contenido de las capas visibles del mapa y teniendo en cuenta los datos del ViewPort contenido en este FMap

Parameters:
b - Imagen.

invalidate

public void invalidate()
Método de conveniencia que se usa provisionalmente para solicitar un refresco de todo lo que dependa del FMap (MapContext). Esto provocará un evento de cambio de orden de capas que obligará a redibujar todo lo que depende de FMap (TOC, MapControl, FFrameView, etc).


print

public void print(java.awt.Graphics2D g)
           throws DriverException
Imprime el las capas que contiene el FMap sobre el Graphics2D que se pasa como parámetro, normalmente es el Graphics de la impresora.

Parameters:
g - Graphics2D
Throws:
DriverException

createNewFMap

public FMap createNewFMap(ViewPort vp)
Crea un nuevo FMap con la información del ViewPort que se pasa como parámetro.

Parameters:
vp - ViewPort.
Returns:
FMap nuevo.

cloneFMap

public FMap cloneFMap()
               throws XMLException
Crea un nuevo FMap totalmente desligado, se replican las capas y el ViewPort

Returns:
FMap clonado.
Throws:
XMLException

addToTrackLayer

public void addToTrackLayer(FLayer vectorial)
Añade una capa al grupo de capas que se sitúa por encima de todas las otras capas

Parameters:
vectorial - FLayer.

getScaleView

public long getScaleView()
Devuelve la escala de la vista en pantalla.

Returns:
escala de la vista.

setVectorial

public void setVectorial(VectorialAdapter v)
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#setVectorial(com.iver.cit.gvsig.fmap.VectorialAdapter)

process

public void process(FeatureVisitor visitor)
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#process(com.iver.cit.gvsig.fmap.FeatureSelectorVisitor)

processSelected

public void processSelected(FeatureVisitor visitor)
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#processSelected(com.iver.cit.gvsig.fmap.FeatureVisitor)

select

public void select(FeatureVisitor visitor)
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#select(com.iver.cit.gvsig.fmap.FeatureSelectorVisitor, VectorialSubSet)

selectFromSelection

public void selectFromSelection()
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectFromSelection()

createIndex

public void createIndex()
See Also:
Strategy.createIndex()

getProjection

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

setProjection

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

Parameters:
proj - Proyección.

reProject

public void reProject(ICoordTrans arg0)
See Also:
org.cresques.geo.Projected#reProject(org.cresques.cts.ICoordTrans)

selectByPoint

public void selectByPoint(java.awt.geom.Point2D p,
                          double tolerance)
                   throws DriverException
Throws:
DriverException
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectByPoint(java.awt.geom.Point2D, double)

selectByRect

public void selectByRect(java.awt.geom.Rectangle2D rect)
                  throws DriverException
Throws:
DriverException
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectByRect(java.awt.geom.Rectangle2D)

selectByShape

public void selectByShape(IGeometry g,
                          int relationship)
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#selectByShape(com.iver.cit.gvsig.fmap.fshape.IGeometry, int)

queryByPoint

public Record[] queryByPoint(java.awt.geom.Point2D p,
                             double tolerance)
See Also:
Strategy.queryByPoint(Point2D, double)

queryByRect

public Record[] queryByRect(java.awt.geom.Rectangle2D rect)
See Also:
Strategy.queryByRect(java.awt.geom.Rectangle2D)

queryByShape

public Record[] queryByShape(IGeometry g,
                             int relationship)
See Also:
com.iver.cit.gvsig.fmap.operations.strategies.Strategy#queryByShape(com.iver.cit.gvsig.fmap.fshape.IGeometry, int)

getSelectionBounds

public java.awt.geom.Rectangle2D getSelectionBounds()
See Also:
Strategy.getSelectionBounds()

draw

public void draw(java.awt.image.BufferedImage image,
                 java.awt.Graphics2D g,
                 Cancellable cancel)
          throws DriverException
Throws:
DriverException
See Also:
com.iver.cit.gvsig.fmap.operations.LayerOperations#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, FStyle2D)

draw

public void draw(java.awt.image.BufferedImage image,
                 java.awt.Graphics2D g)
          throws DriverException
Throws:
DriverException
See Also:
com.iver.cit.gvsig.fmap.operations.LayerOperations#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, FStyle2D)

getViewPort

public ViewPort getViewPort()
Devuelve el ViewPort.

Returns:
Returns the viewPort.

setViewPort

public void setViewPort(ViewPort viewPort)
Inserta un ViewPort.

Parameters:
viewPort - The viewPort to set.

getFullExtent

public java.awt.geom.Rectangle2D getFullExtent()
                                        throws DriverException
Método de conveniencia. Recorre las capas y te da el fullExtent

Returns:
fullExtent de todas las capas.
Throws:
DriverException

getXMLEntity

public XMLEntity getXMLEntity()
Devuelve el XMLEntity.

Returns:
XMLEntity.

createFromXML

public static FMap createFromXML(XMLEntity xml)
                          throws XMLException
Crea un nuevo FMAp a partir del XMLEntity.

Parameters:
xml - XMLEntity
Returns:
Nuevo FMap.
Throws:
XMLException

addAtomicEventListener

public boolean addAtomicEventListener(AtomicEventListener listener)
Añade un AtomicEventListener.

Parameters:
listener - AtomicEventListener.
Returns:
True si se ha añadido correctamente.

removeAtomicEventListener

public boolean removeAtomicEventListener(AtomicEventListener listener)
Borra un AtomicEventListener de la lista de listeners.

Parameters:
listener - AtomicEventListener a borrar.
Returns:
True si se ha borrado correctamente.

beginAtomicEvent

public void beginAtomicEvent()
Inicializa los AtomicEvent.


endAtomicEvent

public void endAtomicEvent()
Finaliza los AtomicEvent.