Class BasicLayer
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
-
- All Implemented Interfaces:
Layer
,PropertySupport
- Direct Known Subclasses:
AbstractDataSetLayer
,BasicTool
,MapNavLayer
,NFERenderer
,PointerLocationLayer
,ProgressIndicatorLayer
,ScaleBarLayer
,SimpleBGLayer
public class BasicLayer extends java.lang.Object implements Layer
A basic layer that serves as a default implementation of the Layer interface. For simple types of concrete layers, it is easier to extend BasicLayer then override only interface methods that are different from default behavior.
-
-
Field Summary
Fields Modifier and Type Field Description protected MapCanvas
canvas
protected PropertySupportObject
properties
-
Fields inherited from interface oracle.spatial.network.nfe.vis.maps.core.Layer
PROPERTY_NAME, PROPERTY_PROVIDERID, PROPERTY_SRID, PROPERTY_VISIBLE
-
-
Constructor Summary
Constructors Constructor Description BasicLayer(MapCanvas canvas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
added(java.lang.Object source)
The function called when the layer is added to either a MapCanvas or an EditSession (typically both, MapCanvas first, EditSession later)void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
void
clear()
Clears all contents of this layer.void
fromXMLElement(org.w3c.dom.Element element)
Loads the content from an XML representationMapCanvas
getCanvas()
Gets the map canvas that this layer is displayed on.java.awt.geom.Rectangle2D
getDataMBR()
Always return null here.java.awt.geom.Rectangle2D
getFullExtent()
javax.swing.Icon
getIcon()
java.lang.String
getName()
Gets the name of the layer.java.util.Properties
getProperties()
java.lang.String
getProperty(java.lang.String key)
java.lang.String
getProperty(java.lang.String key, java.lang.String defaultValue)
java.beans.PropertyChangeListener[]
getPropertyChangeListeners()
java.beans.PropertyChangeListener[]
getPropertyChangeListeners(java.lang.String propertyName)
java.lang.String
getProviderID()
Returns the provider IDint
getSRID()
Gets the SRID of the Layer, 0 if it doesn't have an associated SRIDboolean
handleEvent(java.util.EventObject evt)
The main method that performs event handling for this tool.protected void
handleTheEvent(java.util.EventObject evt)
java.util.List<GeoObject>
hitTest(int x, int y, int granularity)
Performs a hit test for the given mouse location (x,y).java.util.List<GeoObject>
hitTest(java.awt.geom.Rectangle2D box, int granularity)
Performs a hit test for the given rectangle.protected boolean
isMyEvent(java.util.EventObject evt)
boolean
isVisible()
Checks whether this layer is currently visible.void
mapRegionChanged(MapRegionEvent e)
When the associated canvas's map region is changed, this method is called to notify the layer of the change.protected boolean
propagateEvent(java.util.EventObject evt)
void
removed(java.lang.Object source)
The function called when the layer is removed from either a MapCanvas or an EditSession (typically both, MapCanvas first, EditSession later)void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
long
render(java.awt.Graphics2D g)
Renders the layer contents to the given Graphics.void
repaint()
Tells the layer to repaint itself immediately.void
setCanvas(MapCanvas canvas)
Sets the map canvas on which this layer is displayed.protected void
setMyCursor(int x, int y)
void
setName(java.lang.String name)
Sets the name for this layer.java.lang.String
setProperty(java.lang.String key, java.lang.String value)
void
setProviderID(java.lang.String providerID)
Sets the provider IDvoid
setSRID(int srid)
Sets the SRID of the Layervoid
setVisible(boolean v)
Sets the visibility of this layer.org.w3c.dom.Element
toXMLElement()
Returns an XML representation of the layervoid
update(long elapsedTime)
updates the contents data model or structure.
-
-
-
Field Detail
-
canvas
protected MapCanvas canvas
-
properties
protected PropertySupportObject properties
-
-
Constructor Detail
-
BasicLayer
public BasicLayer(MapCanvas canvas)
-
-
Method Detail
-
getProperties
public java.util.Properties getProperties()
- Specified by:
getProperties
in interfacePropertySupport
-
toXMLElement
public org.w3c.dom.Element toXMLElement()
Description copied from interface:Layer
Returns an XML representation of the layer- Specified by:
toXMLElement
in interfaceLayer
- Returns:
-
fromXMLElement
public void fromXMLElement(org.w3c.dom.Element element)
Description copied from interface:Layer
Loads the content from an XML representation- Specified by:
fromXMLElement
in interfaceLayer
-
getName
public java.lang.String getName()
Description copied from interface:Layer
Gets the name of the layer.
-
setName
public void setName(java.lang.String name)
Sets the name for this layer.
-
isVisible
public boolean isVisible()
Description copied from interface:Layer
Checks whether this layer is currently visible.
-
setVisible
public void setVisible(boolean v)
Description copied from interface:Layer
Sets the visibility of this layer.- Specified by:
setVisible
in interfaceLayer
-
getProperty
public java.lang.String getProperty(java.lang.String key)
- Specified by:
getProperty
in interfacePropertySupport
-
getProperty
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
- Specified by:
getProperty
in interfacePropertySupport
-
setProperty
public java.lang.String setProperty(java.lang.String key, java.lang.String value)
- Specified by:
setProperty
in interfacePropertySupport
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListener
in interfacePropertySupport
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListener
in interfacePropertySupport
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
- Specified by:
getPropertyChangeListeners
in interfacePropertySupport
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
- Specified by:
getPropertyChangeListeners
in interfacePropertySupport
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListener
in interfacePropertySupport
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListener
in interfacePropertySupport
-
clear
public void clear()
Description copied from interface:Layer
Clears all contents of this layer.
-
getCanvas
public MapCanvas getCanvas()
Description copied from interface:Layer
Gets the map canvas that this layer is displayed on.
-
setCanvas
public void setCanvas(MapCanvas canvas)
Description copied from interface:Layer
Sets the map canvas on which this layer is displayed.
-
handleEvent
public boolean handleEvent(java.util.EventObject evt)
Description copied from interface:Layer
The main method that performs event handling for this tool. Returns whether the event should be propagated to other layers down stream (further down the layer stack) after the event has been handled.- Specified by:
handleEvent
in interfaceLayer
-
handleTheEvent
protected void handleTheEvent(java.util.EventObject evt)
-
setMyCursor
protected void setMyCursor(int x, int y)
-
isMyEvent
protected boolean isMyEvent(java.util.EventObject evt)
-
propagateEvent
protected boolean propagateEvent(java.util.EventObject evt)
-
hitTest
public java.util.List<GeoObject> hitTest(int x, int y, int granularity)
Description copied from interface:Layer
Performs a hit test for the given mouse location (x,y). All the geo-objects that pass the hit test will be returned.
-
hitTest
public java.util.List<GeoObject> hitTest(java.awt.geom.Rectangle2D box, int granularity)
Description copied from interface:Layer
Performs a hit test for the given rectangle. All the geo-objects that are either inside or intersect the rectangle will be returned.
-
render
public long render(java.awt.Graphics2D g)
Description copied from interface:Layer
Renders the layer contents to the given Graphics.
-
mapRegionChanged
public void mapRegionChanged(MapRegionEvent e)
Description copied from interface:Layer
When the associated canvas's map region is changed, this method is called to notify the layer of the change. Note that either a device window change (as a result of resizing the application window) or a data window change can cause this method to be invoked. Query the canvas' MapRegion object to get the changed values. Inside a mapRegionChanged() implementation, the layer typically needs to update its data contents accordingly.- Specified by:
mapRegionChanged
in interfaceLayer
-
update
public void update(long elapsedTime)
Description copied from interface:Layer
updates the contents data model or structure.
-
repaint
public void repaint()
Description copied from interface:Layer
Tells the layer to repaint itself immediately. Typically called when a layer's rendering uses a buffered image, and that image might be in an inconsistent state or should be updated.
-
getSRID
public int getSRID()
Description copied from interface:Layer
Gets the SRID of the Layer, 0 if it doesn't have an associated SRID
-
setSRID
public void setSRID(int srid)
Description copied from interface:Layer
Sets the SRID of the Layer
-
getDataMBR
public java.awt.geom.Rectangle2D getDataMBR()
Always return null here.- Specified by:
getDataMBR
in interfaceLayer
-
getFullExtent
public java.awt.geom.Rectangle2D getFullExtent()
- Specified by:
getFullExtent
in interfaceLayer
-
added
public void added(java.lang.Object source)
Description copied from interface:Layer
The function called when the layer is added to either a MapCanvas or an EditSession (typically both, MapCanvas first, EditSession later)
-
removed
public void removed(java.lang.Object source)
Description copied from interface:Layer
The function called when the layer is removed from either a MapCanvas or an EditSession (typically both, MapCanvas first, EditSession later)
-
getProviderID
public java.lang.String getProviderID()
Description copied from interface:Layer
Returns the provider ID- Specified by:
getProviderID
in interfaceLayer
- Returns:
-
setProviderID
public void setProviderID(java.lang.String providerID)
Description copied from interface:Layer
Sets the provider ID- Specified by:
setProviderID
in interfaceLayer
-
-