|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.prodevelop.gvsig.mobile.fmap.MapContext
This class keeps and manages geographic data (basically the viewport and the array of layers). Therefore deals with zooms, extents, selection, etc, and gives access to the management of teh viewport and the layer drawing.
ViewPort
,
FLayer
Field Summary | |
static double |
ASSUMED_DPI
|
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
|
static double |
ZOOMINFACTOR
|
static double |
ZOOMOUTFACTOR
|
Constructor Summary | |
MapContext(ViewPort vp)
|
Method Summary | |
void |
addLayer(FLayer lyr,
boolean repaint)
Add a layer to this mapcontext object |
void |
addViewPortLisneter(ViewPortListener l)
Adds a listener to the viewport |
boolean |
clearSelection()
Clears selection in all layers |
void |
closeDataSources()
Closes the datasources of the layers. |
void |
draw(java.awt.Graphics2D g,
Cancellable cancel)
Draws visible layers in the provided Graphics object. |
java.awt.geom.Rectangle2D |
getAllLayersExtent()
Gets the extent of all the layers |
java.awt.geom.Rectangle2D |
getFullExtent()
Computes the full extent adding the extents of the current layers. |
FLayer[] |
getInfoableLayers(boolean only_vect)
Gets the layers that the user has selected to be queried for info |
FLayer |
getLayer(int index)
Gets i-th layer |
int |
getLayerCount()
Gets the number of layers |
java.util.ArrayList |
getLayers()
|
IProjection |
getProjection()
|
java.awt.geom.Rectangle2D |
getSelectedLayerExtent()
Gets the extent of the selected layers |
FLayer[] |
getSelectedLayers(boolean only_vect)
Gets the currently selected layers |
ViewPort |
getViewPort()
Gets the viewport |
long |
getViewScale()
Get current view scale. |
void |
removeLayer(FLayer lyr)
Removes one layer from this mapcontext |
void |
removeViewPortLisneter(ViewPortListener l)
Removes a listener from the viewport |
void |
setProjection(IProjection proj)
Sets a new projection. |
void |
setViewPort(ViewPort v)
Sets the viewport |
void |
setViewPortImageSize(java.awt.Dimension size)
Set viewport image size |
void |
swapFromBottom(int _a,
int _b)
Changes the order of the layers in those indices. |
java.lang.StringBuffer |
toXML(java.lang.String name,
java.lang.String projPath)
Gets the complete XML description of this mapcontext. |
void |
zoomToSelection()
Zooms to current selection (in all layers) |
void |
zoomToSelection(FLyrVect lyr)
Zooms to current selection in one layer |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double[] CHANGEM
public static final double[] CHANGE
public static final int EQUALS
public static final int DISJOINT
public static final int INTERSECTS
public static final int TOUCHES
public static final int CROSSES
public static final int WITHIN
public static final int CONTAINS
public static final int OVERLAPS
public static double ZOOMINFACTOR
public static double ZOOMOUTFACTOR
public static double ASSUMED_DPI
Constructor Detail |
public MapContext(ViewPort vp)
Method Detail |
public java.util.ArrayList getLayers()
public FLayer getLayer(int index)
index
-
public long getViewScale()
public IProjection getProjection()
public void setProjection(IProjection proj)
proj
- the new projectionpublic void draw(java.awt.Graphics2D g, Cancellable cancel)
g
- the object where layers will be drawn.cancel
- cancel object (follow this parameter to see if it is used.public ViewPort getViewPort()
public void setViewPort(ViewPort v)
v
- the new viewportpublic java.awt.geom.Rectangle2D getFullExtent() throws FMapDriverException
FMapDriverException
public void removeLayer(FLayer lyr)
lyr
- the layer to be removedpublic void addLayer(FLayer lyr, boolean repaint)
lyr
- the layer to be addedrepaint
- whether or not the view has to be repaintedpublic void swapFromBottom(int _a, int _b)
_a
- one of the indices_b
- the other indexpublic void closeDataSources()
public void setViewPortImageSize(java.awt.Dimension size)
size
- the new image size of the viewportpublic void addViewPortLisneter(ViewPortListener l)
l
- listener to be addedpublic void removeViewPortLisneter(ViewPortListener l)
l
- listener to be removedpublic int getLayerCount()
public FLayer[] getSelectedLayers(boolean only_vect)
only_vect
- whether or not only vector layers have to be included
public java.awt.geom.Rectangle2D getSelectedLayerExtent()
public java.awt.geom.Rectangle2D getAllLayersExtent()
public void zoomToSelection()
public void zoomToSelection(FLyrVect lyr)
lyr
- the layer of interestpublic FLayer[] getInfoableLayers(boolean only_vect)
only_vect
- whether or not only vector layers have to be included
public java.lang.StringBuffer toXML(java.lang.String name, java.lang.String projPath)
name
- the name of the mapcontext XML element.projPath
- the project path
public boolean clearSelection()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |