public interface ManipulableLayer extends BehavioralLayer
Modifier and Type | Field and Description |
---|---|
static int |
TRANS_NONE
No transformation
|
static int |
TRANS_PULL
Pulling
|
static int |
TRANS_TRANSLATE
Translation
|
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.
|
refresh
static final int TRANS_NONE
static final int TRANS_TRANSLATE
static final int TRANS_PULL
java.util.Collection<GeoObject> getManipulableGeoObjects()
double[] getHandlePoints(GeoObject geoObj)
geoObj
- a GeoObjectJGeometrySegmentPoint getSnapPoint(GeoObject geoObj, java.awt.geom.Point2D dataPoint, double tolerance)
geoObj
- a GeoObjectpoint
- a point in model's coordinate systemtolerance
- a tolarence in model's coordinate systemint getApplicableTransformation(GeoObject geoObj, java.util.Collection<GeoObject> manGeoObjGroup, JGeometrySegmentPoint snapPoint)
geoObj
- a GeoObjectmanGeoObjGroup
- a collection containing more GeoObjects to be manipulated. It can be nullsnapPoint
- a segment point relative to the GeoObject's geometrylong startManipulation(GeoObject geoObj, java.util.Collection<GeoObject> manGeoObjGroup, JGeometrySegmentPoint snapPoint, int transformation)
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 performedboolean finishManipulation(long manId, java.awt.geom.Point2D dataPoint)
manId
- the manipulation session iddataPoint
- the last point for the manipulation in model's coordinate systemboolean manipulate(long manId, java.awt.geom.Point2D dataPoint)
manId
- a manipulation session iddataPoint
- the last user point (it may be a mouse point) in model's coordinate systemvoid cancelManipulation(long manId)
manId
- a manipulation session idManipulationPreview getPreview(long manId)
manId
- a manipulation session id