Class TLspPointEditor
java.lang.Object
com.luciad.view.lightspeed.editor.ALspEditor
com.luciad.view.lightspeed.editor.TLspPointEditor
- All Implemented Interfaces:
ILspEditor
Enables visual editing of
ILcd2DEditablePoint
and
ILcd3DEditablePoint
objects in an
ILspView
.
Handles
The point editor defines the following edit handles for a point object:- Location handle: allows the user to change the XY location of the point. For 3D
points in a 3D view, this handle is painted on the terrain. This handle generates
MOVE
operations, with an XY constraint, and without properties. - Height handle: (only for 3D points in a 3D view) allows the user to change
the height (above the terrain) of the 3D point. This handle generates
MOVE
operations, with a Z constraint, and without properties.
Editing
Based on theTLspEditOperation
, generated by an edit handle (see description
of handles above), this editor performs different edit operations on the associated point object.
The images below illustrate the effect of the different handles. In each image the
gray color represents the previous state of the object and the red color represents the edited object:
-
Location handle: Modifies the location of the point.
(left) editing the location of a 2D point (right) editing the location of a 3d point
-
Height handle: Modifies the height of the point.
Creation
The creation process of a 2D point object (and 3D points in a 2D view) consists of one step:- initialize the XY position of the point
- a second step initializes the height of the 3D point
Setting the XY location of the point. | (only for 3D points in a 3D view) Initializing the height of a 3D point. |
- Since:
- 2012.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canEdit
(TLspEditContext aContext) protected ALspEditHandle
createHeightHandle
(ILcd3DEditablePoint aPoint, TLspEditContext aContext) Creates a handle to modify the point's height.protected ALspEditHandle
createLocationHandle
(ILcd2DEditablePoint aPoint, TLspEditContext aContext) Creates a handle to modify the point's location.protected TLspEditOperationResult
editImpl
(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Called by theedit
method to edit the given object based on the givenedit operation
.getCreateHandle
(TLspEditContext aContext) Returns a handle that is used to create the given object.getEditHandles
(TLspEditContext aContext) Returns a set of handles for editing the given object.Methods inherited from class com.luciad.view.lightspeed.editor.ALspEditor
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
-
Constructor Details
-
TLspPointEditor
public TLspPointEditor()Creates a newTLspPointEditor
. This constructor does not initialize any state.
-
-
Method Details
-
canEdit
- Specified by:
canEdit
in interfaceILspEditor
- Overrides:
canEdit
in classALspEditor
- Parameters:
aContext
- provides context information to the editor- Returns:
true
if the above conditions are met,false
otherwise.
-
createLocationHandle
Creates a handle to modify the point's location. This handle generatesMOVE
operations, with an XY constraint, and without properties. By default this method returns aTLspPointTranslationHandle
for 3D points, when visualized in a 3D view. Otherwise aTLspObjectTranslationHandle
is returned.- Parameters:
aPoint
- the point to be editedaContext
- the given context- Returns:
- an edit handle or
null
if no handle is needed
-
createHeightHandle
Creates a handle to modify the point's height. This handle generatesMOVE
operations, with an XY constraint, and without properties.- Parameters:
aPoint
- the point to be editedaContext
- the given context- Returns:
- an edit handle or
null
if no handle is needed
-
editImpl
protected TLspEditOperationResult editImpl(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Called by theedit
method to edit the given object based on the givenedit operation
. Note that this method does not need to lock the model of the object, this already happens in theedit
method. By default, this editor can handle the following operations:- Specified by:
editImpl
in classALspEditor
- Parameters:
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- the interaction statusaContext
- the edit context- Returns:
- The result of the operation: Whether or not there was success, and whether or not the current handles of the object should be invalidated.
-
getEditHandles
Returns a set of handles for editing the given object. These handles will be able to generate edit operations, that are passed to theedit
method. As a way to communicate with this method, handles will copy their properties to the edit operation properties. By default this method delegates to the following methods: It returns a list containing the handles returned by those methods. These methods are added for convenience, so they can easily be overridden.- Parameters:
aContext
- provides context information such as the layer for which the object is being edited- Returns:
- the edit handles to edit the given object, or an empty list if it should not be possible to edit the given object.
- See Also:
-
getCreateHandle
Returns a handle that is used to create the given object. The returned handle is used by the controller to initialize the other of the object. Typically the returned handle is an instance ofALspCreateHandle
which is a specialized handle implementation used for creating an object. By default, this method returns anALspCreateHandle
capable of creating anILcd2DEditablePoint
, as described in the class javadoc.- Parameters:
aContext
- provides context information such as the layer for which the object is being created- Returns:
- an edit handle, or
null
if creation should not be allowed. - See Also:
-