public class MapContext extends AbstractDisposable implements Projected, Persistent, Observer, java.lang.Iterable<FLayer>
The MapContext
class represents the model and a part of the
control and view around graphical layers used by
MapControl
.
An instance of MapContext
is made up with:
FLayers
nodes
GraphicLayer
layer
ViewPort
EventButter
LegendListener
s
LayerDrawingListener
s
ErrorListener
s
Modifier and Type | Class and Description |
---|---|
class |
MapContext.LayerEventListener
The class
LayerEventListener implements the methods of
LayerCollectionListener that handles the
"layer added" or "layer removed" events in a map. |
static interface |
MapContext.MapTimeContext |
static class |
MapContext.RegisterPersistence |
Modifier and Type | Field and Description |
---|---|
static java.util.ArrayList |
AREAABBR |
static java.util.ArrayList |
AREANAMES |
static java.util.ArrayList |
AREATRANS2METER |
static double[] |
CHANGE
Deprecated.
use getDistanceTrans2Meter() * 100
|
static double[] |
CHANGEM
Deprecated.
use getDistanceTrans2Meter()
|
static int |
CONTAINS |
static int |
CROSSES |
static java.awt.Color |
DEFAULT_SELECTION_COLOR |
static int |
DISJOINT |
static java.util.ArrayList |
DISTANCEABBR |
static java.util.ArrayList |
DISTANCENAMES |
static java.util.ArrayList |
DISTANCETRANS2METER |
static int |
EQUALS |
static int |
INTERSECTS |
protected FLayers |
layers
A hierarchy of
FLayers nodes. |
static int |
OVERLAPS |
static int |
TOUCHES |
static int |
WITHIN |
static double |
ZOOMINFACTOR
Default zoom in factor.
|
static double |
ZOOMOUTFACTOR
Default zoom out factor.
|
Constructor and Description |
---|
MapContext() |
MapContext(FLayers fLayers,
ViewPort vp)
Creates a new map context with the layers and the drawing information
defined in the view port arguments.
|
MapContext(ViewPort vp)
Creates a new map context with the drawing information defined in the
view port argument, and without layers.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAreaUnit(java.lang.String name,
java.lang.String abbr,
boolean isLinear,
double trans2meter) |
void |
addAsCollectionListener(FLayers layers2)
Adds the
LayerEventListener of this map to the
collection of layers argument. |
boolean |
addAtomicEventListener(AtomicEventListener listener)
Adds a listener of atomic events to the internal
EventBuffer . |
static void |
addDistanceUnit(java.lang.String name,
java.lang.String abbr,
double trans2meter) |
void |
addErrorListener(ErrorListener listener)
Adds the specified error listener to receive error events from this
map.
|
void |
addLayerDrawingListener(LayerDrawingListener listener)
Adds the specified layer drawing listener to catch and handle drawing
events from layers of this map.
|
void |
addLayerError(java.lang.String stringProperty)
Registers the message of an error associated to this map.
|
void |
addLayerListener(LegendListener listener)
Deprecated.
use addLegendListener
|
void |
addLegendListener(LegendListener listener)
Adds the specified legend listener (if didn't exist) to receive legend
events from this map.
|
void |
addSelectionListener(FLayer lyr)
Registers an event buffer as a listener for all layers as argument.
|
void |
addToTrackLayer(FLayer vectorial)
Adds a layer to the group of layers that are at a upper level in the
tree.
|
void |
beginAtomicEvent() |
void |
callLegendChanged()
Notifies to all legend listeners registered, that one legend has
changed.
|
void |
callNewErrorEvent(ErrorEvent e)
Notifies to all error listeners registered, that one error has been
produced.
|
void |
clearErrors()
Removes all error messages associated to this map.
|
MapContext |
cloneFMap()
Creates a new independent
MapContext instance, that has a
clone of the layers and the view port of this one. |
MapContext |
cloneToDraw()
Like cloneFMap(), but now doesn't clone the layers, rather
copies them.
|
void |
createIndex() |
MapContext |
createNewFMap(ViewPort vp)
Returns a new
MapContext instance with the information of
the vp argument, and the layers of this map. |
java.util.Iterator |
deepiterator() |
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
Cancellable cancel,
double scale)
Draws this map if its
ViewPort has an extent
defined:Selects only the layers that have to be drawn: #prepareDrawing(BufferedImage, Graphics2D, double). |
void |
draw(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
double scale)
Like
draw(BufferedImage, Graphics2D, Cancellable, double)
, but creating the task as cancellable.
|
void |
drawGraphics(java.awt.image.BufferedImage image,
java.awt.Graphics2D g,
Cancellable cancel,
double scale)
Deprecated.
|
void |
drawLabels(java.awt.image.BufferedImage b)
Draws the visible layers of this map according its view port, on the
image parameter.
|
void |
endAtomicEvent() |
boolean |
equals(java.lang.Object arg0)
Indicates whether some other object is "equal to" this map.
|
void |
fireLayerDrawingEvent(LayerDrawEvent e)
Fires a layer drawing event to all
LayerDrawingListener listeners registered,
distinguishing the kind of event. |
static java.lang.String[] |
getAreaAbbr() |
static java.lang.String[] |
getAreaNames() |
static double[] |
getAreaTrans2Meter() |
java.util.List |
getAtomicEventListeners() |
java.lang.String |
getClassName() |
static java.lang.String[] |
getDistanceAbbr() |
java.lang.String |
getDistanceName() |
static java.lang.String[] |
getDistanceNames() |
static int |
getDistancePosition(java.lang.String s) |
static double[] |
getDistanceTrans2Meter() |
static int |
getDrawFrameRate()
Returns the draw frame rate.
|
long |
getDrawVersion() |
java.util.List |
getErrorListeners() |
Envelope |
getFullEnvelope()
Returns the union of all extents of all layers of this map.
|
GraphicLayer |
getGraphicsLayer()
Returns the internal
GraphicLayer . |
VectorLayer |
getGraphicsLayer(java.lang.String name) |
java.util.Collection<VectorLayer> |
getGraphicsLayers() |
java.util.List |
getLayerDrawingListeners() |
FLayers |
getLayers()
Returns the hierarchy of
FLayers nodes stored in this
map. |
java.util.ArrayList |
getLayersError()
Gets the list with all error messages registered to this map.
|
java.util.Set<FLyrVect> |
getLayersToSnap() |
java.util.List |
getLegendListeners() |
MapContextDrawer |
getMapContextDrawer() |
FLayers |
getNewGroupLayer(FLayers parent)
Creates and returns a new group of layers that belongs to this
MapContext . |
static java.lang.String |
getOfLinear(int i) |
LayerOrderManager |
getOrderManager() |
IProjection |
getProjection()
Returns the current projection.
|
long |
getScaleToUseWhenEnvelopeCollapse() |
double |
getScaleView()
Returns the scale of the view in the screen.
|
static double |
getScreenDPI()
Returns the screen resolution (Dots Per Inch) as it was defined by the
user's preference, or by default as it is defined in the default
Toolkit.
|
Envelope |
getSelectionBounds() |
java.awt.Color |
getSelectionColor()
Gets the color used to represent the selections.
|
MapContext.MapTimeContext |
getTimeContext() |
ViewPort |
getViewPort()
Gets the
ViewPort associated to this map. |
boolean |
hasActiveLayers() |
boolean |
hasActiveVectorLayers() |
boolean |
hasLayers() |
boolean |
hasVectorLayers() |
void |
invalidate() |
boolean |
isPrintGraphicsLayer() |
java.util.Iterator<FLayer> |
iterator() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
print(java.awt.Graphics2D g,
double scale,
PrintAttributes properties)
Prints the layers of this map using the
Graphics2D
argument, that usually is the Graphics of the printer. |
void |
process(Visitor visitor) |
void |
processSelected(Visitor visitor) |
boolean |
removeAtomicEventListener(AtomicEventListener listener)
Removes a listener of atomic events from the internal
EventBuffer . |
void |
removeErrorListener(LegendListener listener)
Removes the specified error listener from this map.
|
void |
removeGraphicsLayer(java.lang.String name) |
void |
removeLayerDrawListener(LayerDrawingListener listener)
Removes the specified layer drawing listener from this map.
|
void |
removeLayerListener(LegendListener listener)
Removes the specified layer listener from this map.
|
void |
reportDriverExceptions(java.lang.String introductoryText,
java.util.List driverExceptions)
Reports to all driver error listeners registered of a bundle of driver
exceptions caused in the same map atomic transaction.
|
void |
reProject(ICoordTrans arg0)
Changes projection of the graphical information of this object.
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
select(Visitor visitor) |
void |
selectFromSelection() |
static void |
setDrawFrameRate(int theDrawFrameRate)
Sets the draw frame rate.
|
void |
setGraphicsLayer(GraphicLayer graphicLayer)
Sets a new
GraphicLayer to this map. |
void |
setGraphicsLayer(java.lang.String name,
FLyrVect layer) |
void |
setLayersToSnap(java.util.Set<FLyrVect> layers)
Adds the layers to the current "layersToSnap" without
replacing the current instance of "layersToSnap"
|
void |
setMapContextDrawer(MapContextDrawer drawer) |
void |
setMapContextDrawerClass(java.lang.Class mapContextDrawerClass) |
void |
setOrderManager(LayerOrderManager lom) |
void |
setPrintGraphicsLayer(boolean b) |
void |
setProjection(IProjection proj)
Sets the new projection.
|
void |
setScaleToUseWhenEnvelopeCollapse(long scale) |
void |
setScaleView(double scale)
Sets the new extent of the view, calculated using the scale argument.
|
void |
setSelectionColor(java.awt.Color selectionColor)
Sets the color used to represent the selections.
|
void |
setViewPort(ViewPort viewPort)
Sets a
ViewPort with the drawing information of this
map. |
void |
update(Observable observable,
java.lang.Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
protected void |
updateDrawVersion() |
void |
zoomToEnvelope(Envelope env)
Sets the given extent to the
ViewPort and updates the
view with the new zoom. |
dispose, dispose
public static final double[] CHANGEM
public static java.util.ArrayList AREANAMES
public static java.util.ArrayList AREAABBR
public static java.util.ArrayList AREATRANS2METER
public static java.util.ArrayList DISTANCENAMES
public static java.util.ArrayList DISTANCEABBR
public static java.util.ArrayList DISTANCETRANS2METER
public static final java.awt.Color DEFAULT_SELECTION_COLOR
public static final double[] CHANGE
Defines the value which a unit of a distance measurement must be divided to obtain its equivalent in centimeters.
Conversion values of distance measurements:
MapContext.CHANGE[0]
: kilometer
MapContext.CHANGE[1]
: meter
MapContext.CHANGE[2]
: centimeter
MapContext.CHANGE[3]
: millimeter
MapContext.CHANGE[4]
: international statute mile
MapContext.CHANGE[5]
: yard
MapContext.CHANGE[6]
: foot
MapContext.CHANGE[7]
: inch
MapContext.CHANGE[8]
: grade
1 international statute mile / MapContext.CHANGE[4] = X centimeters
1 kilometer / MapContext.CHANGE[0] = X centimeters
1 grade / MapContext.CHANGE[8] = X centimeters
MapContext.CHANGE[8]
MapContext.CHANGE[8]
represents the centimeters
of a straight line between two points on the Earth surface that are 1
grade far each other of the center of the Earth. This value has been
calculated using a radius approximated of
REarth=6.37846082678100774672e6 meters, according these
equations:
D = 2 * (sin (1)) * REarth
MapContext.CHANGE[8] = 1 / D
Now we only must invert that value to obtain
MapContext.CHANGE[8]
.
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
Default zoom in factor.
Doing a zoom in operation, decreases the focal distance and increases the eyesight angle to the surface. This allows view an smaller area but with the items bigger.
public static double ZOOMOUTFACTOR
Default zoom out factor.
Doing a zoom out operation, increases the focal distance and decreases the eyesight angle to the surface. This allows view a bigger area but with the items smaller.
public MapContext(ViewPort vp)
Creates a new map context with the drawing information defined in the view port argument, and without layers.
vp
- information for drawing the layers of this map in the available
rectangular area according a projectionpublic MapContext()
public MapContext(FLayers fLayers, ViewPort vp)
Creates a new map context with the layers and the drawing information defined in the view port arguments.
fLayers
- the initial hierarchy of nodes of layers that this map
will havevp
- information for drawing the layers of this map in the available
rectangular area according a projectionpublic static int getDrawFrameRate()
Returns the draw frame rate.
Draw frame rate is the number of repaints of this MapControl
instance that timer invokes per second.
MapControl
instance that
timer invokes per second#applyFrameRate()
,
setDrawFrameRate(int)
public static void setDrawFrameRate(int theDrawFrameRate)
Sets the draw frame rate.
Draw frame rate is the number of repaints of this MapControl
instance that timer invokes per second.
theDrawFrameRate
- number of repaints of this MapControl
instance that timer invokes per second#applyFrameRate()
,
getDrawFrameRate()
public static void addAreaUnit(java.lang.String name, java.lang.String abbr, boolean isLinear, double trans2meter)
public static java.lang.String[] getAreaNames()
public static java.lang.String[] getAreaAbbr()
public static double[] getAreaTrans2Meter()
public static java.lang.String getOfLinear(int i)
public static void addDistanceUnit(java.lang.String name, java.lang.String abbr, double trans2meter)
public static java.lang.String[] getDistanceNames()
public java.lang.String getDistanceName()
public static java.lang.String[] getDistanceAbbr()
public static double[] getDistanceTrans2Meter()
public static int getDistancePosition(java.lang.String s)
public java.awt.Color getSelectionColor()
Gets the color used to represent the selections.
public void setSelectionColor(java.awt.Color selectionColor)
Sets the color used to represent the selections.
selectionColor
- color used to represent the selectionspublic void reportDriverExceptions(java.lang.String introductoryText, java.util.List driverExceptions)
Reports to all driver error listeners registered of a bundle of driver exceptions caused in the same map atomic transaction.
introductoryText
- introductory text specified by developer. If
null
, use ""driverExceptions
- list with a bundle of driver exceptions caught
during an atomic eventaddErrorListener(ErrorListener)
,
removeErrorListener(LegendListener)
public void addLayerListener(LegendListener listener)
Adds the specified legend listener (if didn't exist) to receive legend events from this map.
listener
- the legend listenerremoveLayerListener(LegendListener)
,
callLegendChanged()
public void addLegendListener(LegendListener listener)
Adds the specified legend listener (if didn't exist) to receive legend events from this map.
listener
- the legend listenerremoveLayerListener(LegendListener)
,
callLegendChanged()
public java.util.List getLegendListeners()
public void addLayerDrawingListener(LayerDrawingListener listener)
Adds the specified layer drawing listener to catch and handle drawing events from layers of this map.
listener
- the listener to addremoveLayerDrawListener(LayerDrawingListener)
,
fireLayerDrawingEvent(LayerDrawEvent)
public java.util.List getLayerDrawingListeners()
public void removeLayerDrawListener(LayerDrawingListener listener)
Removes the specified layer drawing listener from this map.
listener
- the listener to removeaddLayerDrawingListener(LayerDrawingListener)
,
fireLayerDrawingEvent(LayerDrawEvent)
public void addErrorListener(ErrorListener listener)
Adds the specified error listener to receive error events from this map.
listener
- the listener to addremoveErrorListener(LegendListener)
,
reportDriverExceptions(String, List)
public java.util.List getErrorListeners()
public void removeErrorListener(LegendListener listener)
Removes the specified error listener from this map.
listener
- the listener to removeaddErrorListener(ErrorListener)
,
reportDriverExceptions(String, List)
public void callLegendChanged()
public void fireLayerDrawingEvent(LayerDrawEvent e)
Fires a layer drawing event to all
LayerDrawingListener
listeners registered,
distinguishing the kind of event.
e
- the eventaddLayerDrawingListener(LayerDrawingListener)
,
removeLayerDrawListener(LayerDrawingListener)
public void callNewErrorEvent(ErrorEvent e)
Notifies to all error listeners registered, that one error has been produced.
e
- the event with information of the erroraddErrorListener(ErrorListener)
,
removeErrorListener(LegendListener)
,
reportDriverExceptions(String, List)
public void removeLayerListener(LegendListener listener)
Removes the specified layer listener from this map.
listener
- the listener to removeaddLayerListener(LegendListener)
,
callLegendChanged()
public FLayers getLayers()
Returns the hierarchy of FLayers
nodes stored in this
map.
public void drawLabels(java.awt.image.BufferedImage b)
Draws the visible layers of this map according its view port, on the image parameter.
b
- image with an accessible buffer of image datapublic void invalidate()
#redraw()
public void print(java.awt.Graphics2D g, double scale, PrintAttributes properties) throws ReadException, MapContextException
Prints the layers of this map using the Graphics2D
argument, that usually is the Graphics
of the printer.
g
- for rendering 2-dimensional shapes, text and images on the
Java(tm) platformscale
- the scale of the view. Must be between
FLayer.getMinScale() and FLayer.getMaxScale().properties
- a set with the settings to be applied to a whole print
job and to all the documents in the print jobMapContextException
- if there is an error getting the instance of
MapContextDrawerReadDriverException
- if fails reading with driver.ReadException
FLayer.draw(BufferedImage, Graphics2D, ViewPort, Cancellable,
double)
public MapContext createNewFMap(ViewPort vp)
Returns a new MapContext
instance with the information of
the vp
argument, and the layers of this map.
vp
- information for drawing the layers of this map in the available
rectangular area according a projectionMapContext
instance projected by
vp
public MapContext cloneFMap()
Creates a new independent MapContext
instance, that has a
clone of the layers and the view port of this one.
The new map will have the same data source drivers to avoid waste memory, and work faster.
MapContext
instanceXMLException
- if fails cloning the view port or a layerFLayer.cloneLayer()
,
ViewPort#cloneViewPort()
public MapContext cloneToDraw()
public void addToTrackLayer(FLayer vectorial)
Adds a layer to the group of layers that are at a upper level in the tree.
vectorial
- the layer to addpublic double getScaleView()
Returns the scale of the view in the screen.
-1
if there is no image
0
if there is no extent defined for the image
#setScaleView(long)
,
ViewPort.getAdjustedExtent()
,
IProjection.getScale(double, double, double, double)
public void setScaleView(double scale)
Sets the new extent of the view, calculated using the scale argument.
Doesn't updates the scale if there isn't information about the dimension of the image or the adjusted extent.
scale
- the new scale for the viewViewPort.setProjection(IProjection)
,
getScaleView()
public static double getScreenDPI()
Returns the screen resolution (Dots Per Inch) as it was defined by the user's preference, or by default as it is defined in the default Toolkit.
Be care, use ViewPort#getDPI to ensure are using the corrects DPI.public void process(Visitor visitor)
org.gvsig.fmap.mapcontext.rendering.strategies.Strategy#process(com.iver.cit.gvsig.fmap.FeatureSelectorVisitor)
public void processSelected(Visitor visitor)
org.gvsig.fmap.mapcontext.rendering.strategies.Strategy#processSelected(com.iver.cit.gvsig.fmap.FeatureVisitor)
public void select(Visitor visitor)
org.gvsig.fmap.mapcontext.rendering.strategies.Strategy#select(com.iver.cit.gvsig.fmap.FeatureSelectorVisitor,
VectorialSubSet)
public void selectFromSelection()
org.gvsig.fmap.mapcontext.rendering.strategies.Strategy#selectFromSelection()
public void createIndex()
org.gvsig.fmap.mapcontext.rendering.strategies.Strategy#createIndex()
public IProjection getProjection()
Projected
Returns the current projection.
getProjection
in interface Projected
Projected.getProjection()
,
ViewPort.getProjection()
,
setProjection(IProjection)
,
reProject(ICoordTrans)
public void setProjection(IProjection proj)
Sets the new projection.
proj
- the new projectiongetProjection()
,
ViewPort.setProjection(IProjection)
,
reProject(ICoordTrans)
public void reProject(ICoordTrans arg0)
Projected
Changes projection of the graphical information of this object.
reProject
in interface Projected
arg0
- transformation coordinates for obtaining the new projectionProjected.reProject(org.cresques.cts.ICoordTrans)
public Envelope getSelectionBounds() throws BaseException
BaseException
public void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g, Cancellable cancel, double scale) throws ReadException, MapContextException
Draws this map if its ViewPort
has an extent
defined:
LayerDrawEvent.GRAPHICLAYER_BEFORE_DRAW
.
LayerDrawEvent.GRAPHICLAYER_AFTER_DRAW
.
image
- buffer used sometimes instead g
to accelerate
the draw. For example, if two points are as closed that can't be
distinguished, draws only one.g
- for rendering 2-dimensional shapes, text and images on the
Java(tm) platformcancel
- shared object that determines if this layer can continue
being drawnscale
- the scale of the view. Must be between
FLayer.getMinScale() and FLayer.getMaxScale().MapContextException
- if there is an error getting the instance of
MapContextDrawerReadDriverException
- if fails reading with the driver.ReadException
public void drawGraphics(java.awt.image.BufferedImage image, java.awt.Graphics2D g, Cancellable cancel, double scale) throws ReadException
draw(BufferedImage, Graphics2D, Cancellable, double)
instead
Draws only the internal graphic layer using the information of the
ViewPort
of this map.
image
- image used to accelerate the screen drawg
- for rendering 2-dimensional shapes, text and images on the
Java(tm) platformcancel
- shared object that determines if this layer can continue
being drawnscale
- value that represents the scaleReadDriverException
- if fails reading with the driver.ReadException
FLayer.draw(BufferedImage, Graphics2D, ViewPort, Cancellable,
double)
public void draw(java.awt.image.BufferedImage image, java.awt.Graphics2D g, double scale) throws ReadException, MapContextException
Like draw(BufferedImage, Graphics2D, Cancellable, double) , but creating the task as cancellable.
image
- buffer used sometimes instead g
to accelerate
the draw. For example, if two points are as closed that can't be
distinguished, draws only one.g
- for rendering 2-dimensional shapes, text and images on the
Java(tm) platformscale
- the scale of the view. Must be between
FLayer.getMinScale() and FLayer.getMaxScale().MapContextException
- if there is an error getting the instance of
MapContextDrawerReadDriverException
- if the driver fails reading.ReadException
draw(BufferedImage, Graphics2D, Cancellable, double)
public ViewPort getViewPort()
Gets the ViewPort
associated to this map.
setViewPort(ViewPort)
public void setViewPort(ViewPort viewPort)
Sets a ViewPort
with the drawing information of this
map.
If there was a previous view port, removes its
EventBuffer
and adds the new one.
viewPort
- the viewPortgetViewPort()
public void zoomToEnvelope(Envelope env)
Sets the given extent to the ViewPort
and updates the
view with the new zoom.
extent
- the extent of the new zoompublic Envelope getFullEnvelope() throws ReadException
Returns the union of all extents of all layers of this map.
ReadDriverException
- if the driver fails reading.ReadException
FLayers.getFullEnvelope()
public boolean addAtomicEventListener(AtomicEventListener listener)
Adds a listener of atomic events to the internal
EventBuffer
.
listener
- the new listenertrue
if has added the listener successfullyremoveAtomicEventListener(AtomicEventListener)
,
EventBuffer.addAtomicEventListener(AtomicEventListener)
public java.util.List getAtomicEventListeners()
public boolean removeAtomicEventListener(AtomicEventListener listener)
Removes a listener of atomic events from the internal
EventBuffer
.
listener
- the listener to removeaddAtomicEventListener(AtomicEventListener)
,
EventBuffer.removeAtomicEventListener(AtomicEventListener)
public void beginAtomicEvent()
EventBuffer.beginAtomicEvent()
,
endAtomicEvent()
public void endAtomicEvent()
EventBuffer.endAtomicEvent()
,
beginAtomicEvent()
public void addAsCollectionListener(FLayers layers2)
Adds the LayerEventListener
of this map to the
collection of layers argument.
a
- collection of layerspublic VectorLayer getGraphicsLayer(java.lang.String name)
public java.util.Collection<VectorLayer> getGraphicsLayers()
public void setGraphicsLayer(java.lang.String name, FLyrVect layer)
public void removeGraphicsLayer(java.lang.String name)
public GraphicLayer getGraphicsLayer()
Returns the internal GraphicLayer
.
setGraphicsLayer(GraphicLayer)
public void setGraphicsLayer(GraphicLayer graphicLayer)
Sets a new GraphicLayer
to this map.
graphicLayer
- the new graphic layergetGraphicsLayer()
public boolean equals(java.lang.Object arg0)
Indicates whether some other object is "equal to" this map.
Returns true
if success one of this options:
equals
in class java.lang.Object
obj
- the reference object with which to compare.true
if this object is the same as the
arg0
argument; otherwise false
.Object.equals(Object)
public void addLayerError(java.lang.String stringProperty)
Registers the message of an error associated to this map.
stringProperty
- the error messagegetLayersError()
,
clearErrors()
public java.util.ArrayList getLayersError()
Gets the list with all error messages registered to this map.
addLayerError(String)
,
clearErrors()
public void clearErrors()
Removes all error messages associated to this map.
addLayerError(String)
,
getLayersError()
public FLayers getNewGroupLayer(FLayers parent)
Creates and returns a new group of layers that belongs to this
MapContext
.
parent
- layer node in this MapContexte
that will be
the parent of the new nodepublic java.lang.String getClassName()
public java.util.Set<FLyrVect> getLayersToSnap()
public void setLayersToSnap(java.util.Set<FLyrVect> layers)
layers
- public void update(Observable observable, java.lang.Object notification)
Observer
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
public long getDrawVersion()
protected void updateDrawVersion()
public MapContextDrawer getMapContextDrawer() throws ReadException, MapContextException
ReadException
MapContextException
public void setMapContextDrawerClass(java.lang.Class mapContextDrawerClass) throws MapContextException
MapContextException
public void setMapContextDrawer(MapContextDrawer drawer)
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
protected void doDispose() throws BaseException
AbstractDisposable
AbstractDisposable.dispose()
method, to be
implemented by child classes.doDispose
in class AbstractDisposable
BaseException
AbstractDisposable.dispose()
public void addSelectionListener(FLayer lyr)
Registers an event buffer as a listener for all layers as argument.
Each FLayer
of this map must have an event buffer for all
kind of specific listeners of that layer. This method distinguish between Classifiable
,
AlphanumericData
, and FLayers
layers, and for each one, registers, for their specific listeners, the
eventBuffer
as a listener.
the
- layer or layerspublic void setOrderManager(LayerOrderManager lom)
public LayerOrderManager getOrderManager()
public boolean hasVectorLayers()
public boolean hasActiveVectorLayers()
public boolean hasActiveLayers()
public boolean hasLayers()
public java.util.Iterator<FLayer> iterator()
iterator
in interface java.lang.Iterable<FLayer>
public java.util.Iterator deepiterator()
public MapContext.MapTimeContext getTimeContext()
public long getScaleToUseWhenEnvelopeCollapse()
public void setScaleToUseWhenEnvelopeCollapse(long scale)
public void setPrintGraphicsLayer(boolean b)
public boolean isPrintGraphicsLayer()