Class NFESelectionTool
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
-
- oracle.spatial.network.nfe.vis.maps.tools.BasicTool
-
- oracle.spatial.network.nfe.vis.mapcanvas.tool.NFETool
-
- oracle.spatial.network.nfe.vis.mapcanvas.tool.NFESelectionTool
-
- All Implemented Interfaces:
Layer
,Tool
,PropertySupport
- Direct Known Subclasses:
NFEFeatureElementSelectionTool
public abstract class NFESelectionTool extends NFETool
Base class for all the tools which perform selection. An implementation must specify which layers are selectable and the selection priority of the GeoObjects.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
MAX_SELECTABLE_PRIORITY
protected static int
MIN_SELECTABLE_PRIORITY
protected static int
NO_SELECTABLE_PRIORITY
-
Fields inherited from class oracle.spatial.network.nfe.vis.mapcanvas.tool.NFETool
invalidStateCursor, readyStateCursor
-
Fields inherited from class oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
canvas, 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 NFESelectionTool(MapCanvas canvas, NFEModel model)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears all contents of this layer.protected abstract void
deleteSelection()
Notifies all the layers to delete its current selected GeoObjectsprotected abstract int
getSelectableGeoObjectPriority(GeoObject geoObj, java.awt.geom.Point2D srsMousePoint)
Gets the GeoObject priority to be selected.protected abstract java.util.Collection<Layer>
getSelectableLayers()
Gets all the layers containing GeoObjects that may be selected by the toolprotected GeoObject
getSelectableObject(java.util.Collection<Layer> selLayers, java.awt.event.MouseEvent mouseEvent)
Gets the GeoObject to be selected given the selectable layers and the mouse event informationprotected void
hover(GeoObject geoObj, java.awt.event.MouseEvent mouseEvent)
Notifies the GeoObject's layer that the GeoObject is being hoveredboolean
isMultiSelect()
Tells whether the tool allows multiple selection or notprotected boolean
keyPressed(java.awt.event.KeyEvent keyEvent)
Called when a key pressed event is registeredprotected boolean
keyReleased(java.awt.event.KeyEvent keyEvent)
Called when a key released event is registeredprotected boolean
mouseClicked(java.awt.event.MouseEvent mouseEvent)
Called when a mouse clicked event is registeredprotected boolean
mouseMoved(java.awt.event.MouseEvent mouseEvent)
Called when a mouse moved event is registeredprotected void
select(GeoObject geoObj, java.awt.event.MouseEvent mouseEvent)
Notifies the GeoObject's layer that the object is being selectedvoid
setMultiSelect(boolean multiSelect)
Sets whether the tool allows multiple selection or not-
Methods inherited from class oracle.spatial.network.nfe.vis.mapcanvas.tool.NFETool
getModel, getTolerance, handleEvent, isAllowedScreenPoint, isEnabled, mouseDragged, mouseExited, mousePressed, mouseReleased, setEnabled, toDataCRS, toScreenCRS
-
Methods inherited from class oracle.spatial.network.nfe.vis.maps.tools.BasicTool
isInAction
-
Methods inherited from class oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
added, addPropertyChangeListener, addPropertyChangeListener, fromXMLElement, getCanvas, getDataMBR, getFullExtent, getIcon, getName, getProperties, getProperty, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getProviderID, getSRID, handleTheEvent, hitTest, hitTest, isMyEvent, isVisible, mapRegionChanged, propagateEvent, removed, removePropertyChangeListener, removePropertyChangeListener, render, repaint, setCanvas, setMyCursor, setName, setProperty, setProviderID, setSRID, setVisible, toXMLElement, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface oracle.spatial.network.nfe.vis.maps.core.Layer
added, fromXMLElement, getCanvas, getDataMBR, getFullExtent, getIcon, getName, getProviderID, getSRID, hitTest, hitTest, isVisible, mapRegionChanged, removed, render, repaint, setCanvas, setName, setProviderID, setSRID, setVisible, toXMLElement, update
-
Methods inherited from interface oracle.spatial.network.nfe.vis.maps.util.PropertySupport
addPropertyChangeListener, addPropertyChangeListener, getProperties, getProperty, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener, setProperty
-
-
-
-
Field Detail
-
MAX_SELECTABLE_PRIORITY
protected static final int MAX_SELECTABLE_PRIORITY
- See Also:
- Constant Field Values
-
MIN_SELECTABLE_PRIORITY
protected static final int MIN_SELECTABLE_PRIORITY
- See Also:
- Constant Field Values
-
NO_SELECTABLE_PRIORITY
protected static final int NO_SELECTABLE_PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isMultiSelect
public boolean isMultiSelect()
Tells whether the tool allows multiple selection or not- Returns:
- true if the tool allows multiple selection
-
setMultiSelect
public void setMultiSelect(boolean multiSelect)
Sets whether the tool allows multiple selection or not- Parameters:
multiSelect
- true if the tool allows multiple selection
-
mouseMoved
protected boolean mouseMoved(java.awt.event.MouseEvent mouseEvent)
Description copied from class:NFETool
Called when a mouse moved event is registered- Overrides:
mouseMoved
in classNFETool
- Parameters:
mouseEvent
- a mouse event event- Returns:
- true if the event should be propagated
-
mouseClicked
protected boolean mouseClicked(java.awt.event.MouseEvent mouseEvent)
Description copied from class:NFETool
Called when a mouse clicked event is registered- Overrides:
mouseClicked
in classNFETool
- Parameters:
mouseEvent
- a mouse event- Returns:
- true if the event should be propagated
-
keyPressed
protected boolean keyPressed(java.awt.event.KeyEvent keyEvent)
Description copied from class:NFETool
Called when a key pressed event is registered- Overrides:
keyPressed
in classNFETool
- Parameters:
keyEvent
- a key event- Returns:
- true if the event should be propagated
-
keyReleased
protected boolean keyReleased(java.awt.event.KeyEvent keyEvent)
Description copied from class:NFETool
Called when a key released event is registered- Overrides:
keyReleased
in classNFETool
- Parameters:
keyEvent
- a key event- Returns:
- true if the event should be propagated
-
getSelectableObject
protected GeoObject getSelectableObject(java.util.Collection<Layer> selLayers, java.awt.event.MouseEvent mouseEvent)
Gets the GeoObject to be selected given the selectable layers and the mouse event information- Parameters:
selLayers
- a collection of layers containing GeoObjects eligible for selectionmouseEvent
- a mouse event- Returns:
- a GeoObject to be selected or null if none was eligible
-
hover
protected void hover(GeoObject geoObj, java.awt.event.MouseEvent mouseEvent)
Notifies the GeoObject's layer that the GeoObject is being hovered- Parameters:
geoObj
- a GeoObject being hoveredmouseEvent
- a mouse event
-
select
protected void select(GeoObject geoObj, java.awt.event.MouseEvent mouseEvent)
Notifies the GeoObject's layer that the object is being selected- Parameters:
geoObj
- a GeoObject being selectedmouseEvent
- a mouse event
-
clear
public void clear()
Description copied from interface:Layer
Clears all contents of this layer.- Specified by:
clear
in interfaceLayer
- Overrides:
clear
in classBasicLayer
-
getSelectableGeoObjectPriority
protected abstract int getSelectableGeoObjectPriority(GeoObject geoObj, java.awt.geom.Point2D srsMousePoint)
Gets the GeoObject priority to be selected. Selection priority is needed as more than one element may be interacting with the mouse point when selecting.- Parameters:
geoObj
- a selectable GeoObjectsrsMousePoint
- the mouse point in model's coordinate system- Returns:
-
getSelectableLayers
protected abstract java.util.Collection<Layer> getSelectableLayers()
Gets all the layers containing GeoObjects that may be selected by the tool- Returns:
- a collection of layers
-
deleteSelection
protected abstract void deleteSelection()
Notifies all the layers to delete its current selected GeoObjects
-
-