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 intMAX_SELECTABLE_PRIORITYprotected static intMIN_SELECTABLE_PRIORITYprotected static intNO_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 voidclear()Clears all contents of this layer.protected abstract voiddeleteSelection()Notifies all the layers to delete its current selected GeoObjectsprotected abstract intgetSelectableGeoObjectPriority(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 GeoObjectgetSelectableObject(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 voidhover(GeoObject geoObj, java.awt.event.MouseEvent mouseEvent)Notifies the GeoObject's layer that the GeoObject is being hoveredbooleanisMultiSelect()Tells whether the tool allows multiple selection or notprotected booleankeyPressed(java.awt.event.KeyEvent keyEvent)Called when a key pressed event is registeredprotected booleankeyReleased(java.awt.event.KeyEvent keyEvent)Called when a key released event is registeredprotected booleanmouseClicked(java.awt.event.MouseEvent mouseEvent)Called when a mouse clicked event is registeredprotected booleanmouseMoved(java.awt.event.MouseEvent mouseEvent)Called when a mouse moved event is registeredprotected voidselect(GeoObject geoObj, java.awt.event.MouseEvent mouseEvent)Notifies the GeoObject's layer that the object is being selectedvoidsetMultiSelect(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:NFEToolCalled when a mouse moved event is registered- Overrides:
mouseMovedin 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:NFEToolCalled when a mouse clicked event is registered- Overrides:
mouseClickedin 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:NFEToolCalled when a key pressed event is registered- Overrides:
keyPressedin 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:NFEToolCalled when a key released event is registered- Overrides:
keyReleasedin 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:LayerClears all contents of this layer.- Specified by:
clearin interfaceLayer- Overrides:
clearin 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
-
-