public class NFEManipulableFeatureLayerRenderer extends NFEFeatureLayerRenderer implements ManipulableLayer
TRANS_NONE, TRANS_PULL, TRANS_TRANSLATE
METHOD_MODEL_OBJECT_ADDED, METHOD_MODEL_OBJECT_REMOVED, METHOD_MODEL_OBJECTS_ADDED, METHOD_MODEL_OBJECTS_REMOVED, METHOD_PROPERTY_CHANGED
PROPERTY_NAME, PROPERTY_PROVIDERID, PROPERTY_SRID, PROPERTY_VISIBLE
Constructor and Description |
---|
NFEManipulableFeatureLayerRenderer(MapCanvas canvas, NFEModel model, long featLayerId)
Allocates a new manipulable feature layer renderer
|
Modifier and Type | Method and Description |
---|---|
void |
cancelManipulation(long manId)
Cancels the given manipulation and releases all the resources related to it
|
boolean |
finishManipulation(long manId, java.awt.geom.Point2D dataPoint)
finishes the manipulation identified by the given id.
|
int |
getApplicableTransformation(GeoObject geoObj, java.util.Collection<GeoObject> manGeoObjGroup, JGeometrySegmentPoint snapPoint)
Gets manipulation available for the given GeoObject and its current snap point.
|
double[] |
getHandlePoints(GeoObject geoObj)
Gets the ordinates of the points from which a GeoObject can be manipulated
|
java.util.Collection<GeoObject> |
getManipulableGeoObjects()
Gets the layer's GeoObjects that can be manipulated
|
ManipulationPreview |
getPreview(long manId)
Gets a preview for a manipulation
|
JGeometrySegmentPoint |
getSnapPoint(GeoObject geoObj, java.awt.geom.Point2D dataPoint, double tolerance)
Gets the closer GeoObject's snap point to the given point using the tolerance specified
|
boolean |
manipulate(long manId, java.awt.geom.Point2D dataPoint)
Updates the state of a manipulation with the last point.
|
long |
startManipulation(GeoObject geoObj, java.util.Collection<GeoObject> manGeoObjGroup, JGeometrySegmentPoint snapPoint, int transformation)
Starts a manipulation session.
|
clearSelection, createPreview, deleteSelection, getFeatureLayer, getModel, getSelectedFeatures, isShowFlow, modelObjectAdded, modelObjectPropertyChanged, modelObjectRemoved, modelObjectsAdded, modelObjectsRemoved, select, selectFeatures, setFeatureSelection, setSelection, setShowFlow, synchronizeWithModel
addContextualMenuHandler, addSelectionListener, clear, clearHover, getDataMBR, getFullExtent, getGeoObject, getHover, getImageOpacityAlpha, getObject, getObjects, getSelection, getSelection, getSnapPoint, getTolerance, handleEvent, hitTest, hitTest, isHover, isSelected, mapRegionChanged, numHovered, numSelected, refresh, refresh, removeContextualMenuHandler, removeSelectionListener, render, setHover, setImageOpacityAlpha, stateChanged, unselect, update
added, addPropertyChangeListener, addPropertyChangeListener, fromXMLElement, getCanvas, getIcon, getName, getProperties, getProperty, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getProviderID, getSRID, isVisible, removed, removePropertyChangeListener, removePropertyChangeListener, repaint, setCanvas, setName, setProperty, setProviderID, setSRID, setVisible, toXMLElement
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
refresh
added, fromXMLElement, getCanvas, getIcon, getName, getProviderID, getSRID, isVisible, removed, repaint, setCanvas, setName, setProviderID, setSRID, setVisible, toXMLElement
public NFEManipulableFeatureLayerRenderer(MapCanvas canvas, NFEModel model, long featLayerId)
canvas
- the MapCanvas where the layer will be renderedmodel
- the feature layer's modelfeatLayerId
- the feature layer IDpublic java.util.Collection<GeoObject> getManipulableGeoObjects()
ManipulableLayer
getManipulableGeoObjects
in interface ManipulableLayer
public double[] getHandlePoints(GeoObject geoObj)
ManipulableLayer
getHandlePoints
in interface ManipulableLayer
geoObj
- a GeoObjectpublic JGeometrySegmentPoint getSnapPoint(GeoObject geoObj, java.awt.geom.Point2D dataPoint, double tolerance)
ManipulableLayer
getSnapPoint
in interface ManipulableLayer
geoObj
- a GeoObjecttolerance
- a tolarence in model's coordinate systempublic int getApplicableTransformation(GeoObject geoObj, java.util.Collection<GeoObject> manGeoObjGroup, JGeometrySegmentPoint snapPoint)
ManipulableLayer
getApplicableTransformation
in interface ManipulableLayer
geoObj
- a GeoObjectmanGeoObjGroup
- a collection containing more GeoObjects to be manipulated. It can be nullsnapPoint
- a segment point relative to the GeoObject's geometrypublic long startManipulation(GeoObject geoObj, java.util.Collection<GeoObject> manGeoObjGroup, JGeometrySegmentPoint snapPoint, int transformation)
ManipulableLayer
startManipulation
in interface ManipulableLayer
geoObj
- the target GeoObject to be manipulatedmanGeoObjGroup
- a group of GeoObjects to be manipulatedsnapPoint
- a segment point relative to the GeoObject's geometrytransformation
- the type of manipulation to be performedpublic boolean finishManipulation(long manId, java.awt.geom.Point2D dataPoint)
ManipulableLayer
finishManipulation
in interface ManipulableLayer
manId
- the manipulation session iddataPoint
- the last point for the manipulation in model's coordinate systempublic boolean manipulate(long manId, java.awt.geom.Point2D dataPoint)
ManipulableLayer
manipulate
in interface ManipulableLayer
manId
- a manipulation session iddataPoint
- the last user point (it may be a mouse point) in model's coordinate systempublic void cancelManipulation(long manId)
ManipulableLayer
cancelManipulation
in interface ManipulableLayer
manId
- a manipulation session idpublic ManipulationPreview getPreview(long manId)
ManipulableLayer
getPreview
in interface ManipulableLayer
manId
- a manipulation session id