Class NFEFeatureLayerRenderer
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
-
- oracle.spatial.network.nfe.vis.mapcanvas.render.NFERenderer<NFEFeatureElementGeoObject>
-
- oracle.spatial.network.nfe.vis.mapcanvas.render.NFEFeatureLayerRenderer
-
- All Implemented Interfaces:
java.util.EventListener,javax.swing.event.ChangeListener,NFEModelListener,BehavioralLayer,FeatureSelectableLayer,SelectionEditableLayer,GeoObjectLayer,HoverableLayer,Layer,SelectableLayer,PropertySupport
- Direct Known Subclasses:
NFEManipulableFeatureLayerRenderer
public class NFEFeatureLayerRenderer extends NFERenderer<NFEFeatureElementGeoObject> implements NFEModelListener, FeatureSelectableLayer, SelectionEditableLayer
MapCanvas Layer implementation for rendering an NFE feature layer. It is automatically subscribed for listening its network's and feature layer's events to reflect the state and show the same elements with the same properties. Additionally to the basic selection feature provided by the basic NFERenderer, it allows selecting features as a whole (all the feature's feature elements are selected)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class oracle.spatial.network.nfe.vis.mapcanvas.render.NFERenderer
NFERenderer.Tier, NFERenderer.TierRenderingThread
-
-
Field Summary
-
Fields inherited from class oracle.spatial.network.nfe.vis.mapcanvas.render.NFERenderer
animatedStroke, boundaryColor, contextualMenuHandlerList, editable, geoObjects, hoverBorderColor, hoverColor, hoverManager, hoverStroke, imageOpacityAlpha, lastDataWindow, lastViewportTransform, nontargetAnimatedStroke, refreshRegionQueue, selectionManager, simpleStroke, textDefaultColor, textDefaultFont, tiers
-
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
-
Fields inherited from interface oracle.spatial.network.nfe.model.event.NFEModelListener
METHOD_MODEL_OBJECT_ADDED, METHOD_MODEL_OBJECT_REMOVED, METHOD_MODEL_OBJECTS_ADDED, METHOD_MODEL_OBJECTS_REMOVED, METHOD_PROPERTY_CHANGED
-
-
Constructor Summary
Constructors Constructor Description NFEFeatureLayerRenderer(MapCanvas canvas, NFEModel model, long featLayerId)Allocates a new feature layer renderer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanbelongsToTier(NFEFeatureElementGeoObject geoObj, java.lang.String tierName)Tells whether the GeoObject is rendered by the given tierbooleanclearSelection()Clears all selected objectsManipulationPreviewcreatePreview(java.util.Collection<Manipulation<NFENetworkElement>> manipulations)Creates a preview for the given manipulations to network elementsvoiddeleteSelection()Deletes the elements currently selectedNFEFeatureLayergetFeatureLayer()Gets the rendered feature layerprotected java.util.Collection<NFEFeatureElementGeoObject>getGeoObjects(java.awt.geom.Area area)Gets all the GeoObjects interacting with the given areaprotected java.util.Collection<NFEFeatureElementGeoObject>getGeoObjects(java.awt.geom.Point2D point, int granularity)Gets all the GeoObjects interacting with the given pointprotected java.util.Collection<NFEFeatureElementGeoObject>getGeoObjects(java.awt.geom.Rectangle2D rect)Gets all the GeoObjects interacting with the given rectangleprotected oracle.sdovis.style.StylegetGeoObjectStyle(NFEFeatureElementGeoObject geoObj)Gets the style used for rendering the GeoObjectNFEModelgetModel()Gets the NFE modeljava.util.Collection<NFEFeature>getSelectedFeatures()Gets the currently selected featuresbooleanisShowFlow()Tells whether the line features flow is shownprotected booleanisVisible(NFEFeatureElementGeoObject geoObj)Tells whether the GeoObject is visiblevoidmodelObjectAdded(NFEModelObjectEvent event)Invoked when a model object has been addedvoidmodelObjectPropertyChanged(NFEModelObjectPropertyChangedEvent event)Invoked when a model object's property has been changedvoidmodelObjectRemoved(NFEModelObjectEvent event)Invoked when a model object has been removedvoidmodelObjectsAdded(NFEModelObjectsEvent event)Invoked when one or more model objects have been addedvoidmodelObjectsRemoved(NFEModelObjectsEvent event)Invoked when one or more model objects have been removedbooleanselect(java.util.List<GeoObject> objs)Adds the provided objects to the selection listvoidselectFeatures(java.util.Collection<java.lang.Long> featureIds)Selects a group of features.voidsetFeatureSelection(java.util.Collection<java.lang.Long> featureIds)Sets the given features as selected.booleansetSelection(java.util.List<GeoObject> selectedGeoObjects)Clears selection before setting the provided objects as selectedvoidsetShowFlow(boolean showFlow)Sets whether the line features flow should be shownvoidsynchronizeWithModel()Updates the state to reflect the feature layer's state and refreshes the view-
Methods inherited from class oracle.spatial.network.nfe.vis.mapcanvas.render.NFERenderer
addContextualMenuHandler, addSelectionListener, clear, clearHover, containsTag, containsTag, findTier, getDataMBR, getFullExtent, getGeoObject, getHover, getImageOpacityAlpha, getObject, getObjects, getScreenTolerance, getSelection, getSelection, getSnapPoint, getTolerance, handleEvent, hitTest, hitTest, isHover, isSelected, mapRegionChanged, numHovered, numSelected, refresh, refresh, refreshAsync, refreshAsync, removeContextualMenuHandler, removeSelectionListener, render, renderGeoObject, renderGeoObject, renderGeoObjects, renderGeoObjLabel, renderHoveredObject, renderHoveredObjects, renderHoveredPoint, renderHoveredShape, renderSelectedObjects, renderTier, renderTiers, setHover, setImageOpacityAlpha, sortTiers, stateChanged, unselect, update
-
Methods inherited from class oracle.spatial.network.nfe.vis.maps.layer.BasicLayer
added, addPropertyChangeListener, addPropertyChangeListener, fromXMLElement, getCanvas, getIcon, getName, getProperties, getProperty, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getProviderID, getSRID, handleTheEvent, isMyEvent, isVisible, propagateEvent, removed, removePropertyChangeListener, removePropertyChangeListener, repaint, setCanvas, setMyCursor, setName, setProperty, setProviderID, setSRID, setVisible, toXMLElement
-
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.mapcanvas.behavior.BehavioralLayer
refresh
-
Methods inherited from interface oracle.spatial.network.nfe.vis.maps.core.Layer
added, fromXMLElement, getCanvas, getIcon, getName, getProviderID, getSRID, isVisible, removed, repaint, setCanvas, setName, setProviderID, setSRID, setVisible, toXMLElement
-
Methods inherited from interface oracle.spatial.network.nfe.vis.maps.util.PropertySupport
addPropertyChangeListener, addPropertyChangeListener, getProperties, getProperty, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener, setProperty
-
-
-
-
Method Detail
-
getFeatureLayer
public NFEFeatureLayer getFeatureLayer()
Gets the rendered feature layer- Returns:
- a feature layer instance
-
getModel
public NFEModel getModel()
Gets the NFE model- Returns:
- an NFE model instance
-
isShowFlow
public boolean isShowFlow()
Tells whether the line features flow is shown- Returns:
- true if the flow is shown
-
setShowFlow
public void setShowFlow(boolean showFlow)
Sets whether the line features flow should be shown- Parameters:
showFlow- true if the flow is shown
-
synchronizeWithModel
public void synchronizeWithModel()
Updates the state to reflect the feature layer's state and refreshes the view
-
getGeoObjects
protected java.util.Collection<NFEFeatureElementGeoObject> getGeoObjects(java.awt.geom.Point2D point, int granularity)
Description copied from class:NFERendererGets all the GeoObjects interacting with the given point- Specified by:
getGeoObjectsin classNFERenderer<NFEFeatureElementGeoObject>- Parameters:
point- a spatial point in screen coordinate system- Returns:
- a collection containing all the GeoObjects interacting with the point
-
getGeoObjects
protected java.util.Collection<NFEFeatureElementGeoObject> getGeoObjects(java.awt.geom.Rectangle2D rect)
Description copied from class:NFERendererGets all the GeoObjects interacting with the given rectangle- Specified by:
getGeoObjectsin classNFERenderer<NFEFeatureElementGeoObject>- Parameters:
rect- a rectangle in screen coordinate system- Returns:
- a collection containing all the GeoObjects interacting with the rectangle
-
getGeoObjects
protected java.util.Collection<NFEFeatureElementGeoObject> getGeoObjects(java.awt.geom.Area area)
Description copied from class:NFERendererGets all the GeoObjects interacting with the given area- Specified by:
getGeoObjectsin classNFERenderer<NFEFeatureElementGeoObject>- Parameters:
area- an area in screen coordinate system- Returns:
- a collection containing all the GeoObjects interacting with the area
-
getGeoObjectStyle
protected oracle.sdovis.style.Style getGeoObjectStyle(NFEFeatureElementGeoObject geoObj)
Description copied from class:NFERendererGets the style used for rendering the GeoObject- Specified by:
getGeoObjectStylein classNFERenderer<NFEFeatureElementGeoObject>- Parameters:
geoObj- a GeoObject- Returns:
- the GeoObject's style
-
belongsToTier
protected boolean belongsToTier(NFEFeatureElementGeoObject geoObj, java.lang.String tierName)
Description copied from class:NFERendererTells whether the GeoObject is rendered by the given tier- Specified by:
belongsToTierin classNFERenderer<NFEFeatureElementGeoObject>- Parameters:
geoObj- a layer's GeoObjecttierName- a tier name- Returns:
- true if the GeoObject is rendered by (belongs to) the given tier
-
isVisible
protected boolean isVisible(NFEFeatureElementGeoObject geoObj)
Description copied from class:NFERendererTells whether the GeoObject is visible- Specified by:
isVisiblein classNFERenderer<NFEFeatureElementGeoObject>- Parameters:
geoObj- a layer's GeoObject- Returns:
- true if the GeoObject is visible
-
modelObjectAdded
public void modelObjectAdded(NFEModelObjectEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object has been added- Specified by:
modelObjectAddedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model object that has been added
-
modelObjectsAdded
public void modelObjectsAdded(NFEModelObjectsEvent event)
Description copied from interface:NFEModelListenerInvoked when one or more model objects have been added- Specified by:
modelObjectsAddedin interfaceNFEModelListener- Parameters:
event- contains a collection of references to the model objects that have been added
-
modelObjectRemoved
public void modelObjectRemoved(NFEModelObjectEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object has been removed- Specified by:
modelObjectRemovedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model object that has been removed
-
modelObjectsRemoved
public void modelObjectsRemoved(NFEModelObjectsEvent event)
Description copied from interface:NFEModelListenerInvoked when one or more model objects have been removed- Specified by:
modelObjectsRemovedin interfaceNFEModelListener- Parameters:
event- contains a collection of references to the model objects that have been removed
-
modelObjectPropertyChanged
public void modelObjectPropertyChanged(NFEModelObjectPropertyChangedEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object's property has been changed- Specified by:
modelObjectPropertyChangedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model objects which property has been changed and the name and previous value of the changed property
-
selectFeatures
public void selectFeatures(java.util.Collection<java.lang.Long> featureIds)
Description copied from interface:FeatureSelectableLayerSelects a group of features. If there were selected features selected, they are still selected.- Specified by:
selectFeaturesin interfaceFeatureSelectableLayer- Parameters:
featureIds- a collection containing the IDs of the features to be selected
-
setFeatureSelection
public void setFeatureSelection(java.util.Collection<java.lang.Long> featureIds)
Description copied from interface:FeatureSelectableLayerSets the given features as selected. Previously selected features are unselected- Specified by:
setFeatureSelectionin interfaceFeatureSelectableLayer- Parameters:
featureIds- a collection of feature IDs to be selected
-
getSelectedFeatures
public java.util.Collection<NFEFeature> getSelectedFeatures()
Description copied from interface:FeatureSelectableLayerGets the currently selected features- Specified by:
getSelectedFeaturesin interfaceFeatureSelectableLayer- Returns:
- a collection of features
-
setSelection
public boolean setSelection(java.util.List<GeoObject> selectedGeoObjects)
Description copied from interface:SelectableLayerClears selection before setting the provided objects as selected- Specified by:
setSelectionin interfaceSelectableLayer- Overrides:
setSelectionin classNFERenderer<NFEFeatureElementGeoObject>- Returns:
-
select
public boolean select(java.util.List<GeoObject> objs)
Description copied from interface:SelectableLayerAdds the provided objects to the selection list- Specified by:
selectin interfaceSelectableLayer- Overrides:
selectin classNFERenderer<NFEFeatureElementGeoObject>- Returns:
-
clearSelection
public boolean clearSelection()
Description copied from interface:SelectableLayerClears all selected objects- Specified by:
clearSelectionin interfaceSelectableLayer- Overrides:
clearSelectionin classNFERenderer<NFEFeatureElementGeoObject>- Returns:
- true if changes where made
-
createPreview
public ManipulationPreview createPreview(java.util.Collection<Manipulation<NFENetworkElement>> manipulations)
Creates a preview for the given manipulations to network elements- Parameters:
manipulations- a collection of network element manipulations- Returns:
- a manipulation preview
-
deleteSelection
public void deleteSelection()
Description copied from interface:SelectionEditableLayerDeletes the elements currently selected- Specified by:
deleteSelectionin interfaceSelectionEditableLayer
-
-