public class MapContext extends AbstractDisposable implements Projected, Persistent, Observer, 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 class |
MapContext.RegisterPersistence |
Modifier and Type | Field and Description |
---|---|
static ArrayList |
AREAABBR |
static ArrayList |
AREANAMES |
static ArrayList |
AREATRANS2METER |
static double[] |
CHANGE
Deprecated.
use getDistanceTrans2Meter() * 100
|
static double[] |
CHANGEM
Deprecated.
use getDistanceTrans2Meter()
|
static int |
CONTAINS |
static int |
CROSSES |
static int |
DISJOINT |
static ArrayList |
DISTANCEABBR |
static ArrayList |
DISTANCENAMES |
static ArrayList |
DISTANCETRANS2METER |
static int |
EQUALS
Gets the name of all distance measurements supported by
MapContext . |
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(String name,
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(String name,
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(String stringProperty)
Registers the message of an error associated to this map.
|
void |
addLayerListener(LegendListener listener)
Adds the specified legend listener (if didn't exist) to receive legend
events from this map.
|
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. |
Iterator |
deepiterator() |
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
draw(BufferedImage image,
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(BufferedImage image,
Graphics2D g,
double scale)
Like
draw(BufferedImage, Graphics2D, Cancellable, double)
, but creating the task as cancellable.
|
void |
drawGraphics(BufferedImage image,
Graphics2D g,
Cancellable cancel,
double scale)
Deprecated.
|
void |
drawLabels(BufferedImage b)
Draws the visible layers of this map according its view port, on the
image parameter.
|
void |
endAtomicEvent() |
boolean |
equals(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 String[] |
getAreaAbbr() |
static String[] |
getAreaNames() |
static double[] |
getAreaTrans2Meter() |
String |
getClassName() |
static String[] |
getDistanceAbbr() |
String |
getDistanceName() |
static String[] |
getDistanceNames() |
static int |
getDistancePosition(String s) |
static double[] |
getDistanceTrans2Meter() |
static int |
getDrawFrameRate()
Returns the draw frame rate.
|
long |
getDrawVersion() |
Envelope |
getFullEnvelope()
Returns the union of all extents of all layers of this map.
|
GraphicLayer |
getGraphicsLayer()
Returns the internal
GraphicLayer . |
FLayers |
getLayers()
Returns the hierarchy of
FLayers nodes stored in this
map. |
ArrayList |
getLayersError()
Gets the list with all error messages registered to this map.
|
ArrayList |
getLayersToSnap() |
MapContextDrawer |
getMapContextDrawer() |
FLayers |
getNewGroupLayer(FLayers parent)
Creates and returns a new group of layers that belongs to this
MapContext . |
static String |
getOfLinear(int i) |
LayerOrderManager |
getOrderManager() |
IProjection |
getProjection()
Returns the current projection.
|
long |
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() |
static Color |
getSelectionColor()
Gets the color used to represent the selections.
|
ViewPort |
getViewPort()
Gets the
ViewPort associated to this map. |
boolean |
hasActiveLayers() |
boolean |
hasActiveVectorLayers() |
boolean |
hasLayers() |
boolean |
hasVectorLayers() |
void |
invalidate() |
Iterator<FLayer> |
iterator() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
print(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 |
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(String introductoryText,
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 dFR)
Sets the draw frame rate.
|
void |
setGraphicsLayer(GraphicLayer graphicLayer)
Sets a new
GraphicLayer to this map. |
void |
setLayersToSnap(ArrayList layersToSnap) |
void |
setMapContextDrawer(MapContextDrawer drawer) |
void |
setMapContextDrawerClass(Class mapContextDrawerClass) |
void |
setOrderManager(LayerOrderManager lom) |
void |
setProjection(IProjection proj)
Sets the new projection.
|
void |
setScaleView(long scale)
Sets the new extent of the view, calculated using the scale argument.
|
static void |
setSelectionColor(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,
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 extent)
Sets the given extent to the
ViewPort and updates the
view with the new zoom. |
dispose, dispose
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final double[] CHANGEM
Defines the value which a unit of a distance measurement must be divided to obtain its equivalent in meters.
Conversion values of distance measurements:
MapContext.CHANGEM[0]
: kilometer
MapContext.CHANGEM[1]
: meter
MapContext.CHANGEM[2]
: centimeter
MapContext.CHANGEM[3]
: millimeter
MapContext.CHANGEM[4]
: international statute mile
MapContext.CHANGEM[5]
: yard
MapContext.CHANGEM[6]
: foot
MapContext.CHANGEM[7]
: inch
MapContext.CHANGEM[8]
: grade
1 international statute mile / MapContext.CHANGEM[4] = X meters
1 kilometer / MapContext.CHANGEM[0] = X meters
1 grade / MapContext.CHANGEM[8] = X meters
MapContext.CHANGEM[8]
MapContext.CHANGEM[8]
represents the meters 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.CHANGEM[8] = 1 / D
Now we only must invert that value to obtain
MapContext.CHANGEM[8]
.
public static ArrayList AREANAMES
public static ArrayList AREAABBR
public static ArrayList AREATRANS2METER
public static ArrayList DISTANCENAMES
public static ArrayList DISTANCEABBR
public static ArrayList DISTANCETRANS2METER
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
Gets the name of all distance measurements supported by
MapContext
.
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 dFR)
Sets the draw frame rate.
Draw frame rate is the number of repaints of this MapControl
instance that timer invokes per second.
drawFrameRate
- number of repaints of this MapControl
instance that timer invokes per second#applyFrameRate()
,
getDrawFrameRate()
public static void addAreaUnit(String name, String abbr, boolean isLinear, double trans2meter)
public static String[] getAreaNames()
public static String[] getAreaAbbr()
public static double[] getAreaTrans2Meter()
public static String getOfLinear(int i)
public static String[] getDistanceNames()
public String getDistanceName()
public static String[] getDistanceAbbr()
public static double[] getDistanceTrans2Meter()
public static int getDistancePosition(String s)
public static Color getSelectionColor()
Gets the color used to represent the selections.
public static void setSelectionColor(Color selectionColor)
Sets the color used to represent the selections.
selectionColor
- color used to represent the selectionspublic void reportDriverExceptions(String introductoryText, 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 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 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 void removeErrorListener(LegendListener listener)
Removes the specified error listener from this map.
listener
- the listener to removeaddErrorListener(ErrorListener)
,
reportDriverExceptions(String, List)
public void callLegendChanged()
Notifies to all legend listeners registered, that one legend has changed.
This method must be called only if it's wanted to reflect a legend change.
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(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(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 long 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(long 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(BufferedImage image, 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(BufferedImage image, 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(BufferedImage image, 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 extent)
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 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 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(Object arg0)
Indicates whether some other object is "equal to" this map.
Returns true
if success one of this options:
equals
in class 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(String stringProperty)
Registers the message of an error associated to this map.
stringProperty
- the error messagegetLayersError()
,
clearErrors()
public 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 String getClassName()
public ArrayList getLayersToSnap()
public void setLayersToSnap(ArrayList layersToSnap)
public void update(Observable observable, 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(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 setOrderManager(LayerOrderManager lom)
public LayerOrderManager getOrderManager()
public boolean hasVectorLayers()
public boolean hasActiveVectorLayers()
public boolean hasActiveLayers()
public boolean hasLayers()
public Iterator deepiterator()