public class TLsp3DPointListEditor extends ALspEditor
ILcd3DEditablePointList
objects in an
ILspView
.
Note that the discussion of the editing behaviour below focuses on how a 3D point list is edited
in a 3D view. In a 2D view, editing a 3D point list works the same as when using a
TLsp2DPointListEditor
.
MOVE
operations, with
an XY constraint, and a POINT_INDEX
property.MOVE
operations, with
a Z constraint, and a and a POINT_INDEX
property. MOVE
operations, with
an XY constraint, without any additional properties.TLspEditOperation
, generated by an edit handle (see description
of handles above), this editor performs different edit operations on the associated 3D point
list 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:
![]() |
![]() |
![]() |
![]() |
|||
Setting the XY location of the first point | Setting the height of the first point | Setting the XY location of the second point | Setting the height of the second point |
Modifier and Type | Class and Description |
---|---|
static class |
TLsp3DPointListEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its
edit handles.
|
Constructor and Description |
---|
TLsp3DPointListEditor()
Creates a new
TLsp3DPointListEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
|
protected ALspEditHandle |
createInsertPointHandle(ILcd2DEditablePointList aPointList,
TLspEditContext aContext)
Creates an edit handle that allows the user to insert points into the given point list.
|
protected ALspEditHandle |
createObjectTranslationHandle(ILcd3DEditablePointList aPointList,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given point list horizontally
(i.e. parallel to the terrain).
|
protected ALspEditHandle |
createPointHeightTranslationHandle(ILcd3DEditablePointList aPointList,
int aPointIndex,
TLspEditContext aContext)
Creates a point height handle.
|
protected ALspEditHandle |
createPointPositionHandle(ILcd3DEditablePointList aPointList,
int aPointIndex,
TLspEditContext aContext)
Creates a point position handle.
|
protected ALspEditHandle |
createRemovePointHandle(ILcd2DEditablePointList aPointList,
int aIndex,
TLspEditContext aContext)
Creates a point removal handle for the point with index
aIndex of the given point
list. |
protected TLspEditOperationResult |
editImpl(TLspEditOperation aOperation,
ELspInteractionStatus aInteractionStatus,
TLspEditContext aContext)
Called by the
edit method to edit the given object based on the given
edit operation . |
ALspEditHandle |
getCreateHandle(TLspEditContext aContext)
Returns a handle that is used to create the given object.
|
List<ALspEditHandle> |
getEditHandles(TLspEditContext aContext)
Returns a set of handles for editing the given object.
|
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
public TLsp3DPointListEditor()
TLsp3DPointListEditor
. This
constructor does not initialize any state.public boolean canEdit(TLspEditContext aContext)
canEdit
in interface ILspEditor
canEdit
in class ALspEditor
aContext
- provides context information to the editortrue
if the above conditions are met, false
otherwise.protected TLspEditOperationResult editImpl(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext)
edit
method to edit the given object based on the given
edit operation
.
Note that this method does not need to lock the model of the object, this already happens in the
edit
method.
By default, this editor can handle the following operations:
If any of the operations contains the POINT_INDEX
property, with an integer value, then this editor will only perform the operation
on that particular point, otherwise it will perform it on the entire point list.editImpl
in class ALspEditor
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- aContext
- the edit contextSUCCESS
if the above conditions are met,
FAILED
otherwise. The invalidation
hint will be set if a point was added or removed.public List<ALspEditHandle> getEditHandles(TLspEditContext aContext)
edit
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.
Note that for the point handles, it delegates multiple times to those methods with different
indices. By default this method returns a list that is twice the size, plus one, of the size
of the pointlist.aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createInsertPointHandle(ILcd2DEditablePointList aPointList, TLspEditContext aContext)
aPointList
- the point list for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected ALspEditHandle createRemovePointHandle(ILcd2DEditablePointList aPointList, int aIndex, TLspEditContext aContext)
aIndex
of the given point
list. A POINT_INDEX
user property with the
given index as value is set on the handle.aPointList
- the point list for which the handle is returnedaIndex
- the index of the point in the point list, for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected ALspEditHandle createPointHeightTranslationHandle(ILcd3DEditablePointList aPointList, int aPointIndex, TLspEditContext aContext)
null
to disable creation of point height
handles.
By default this method returns a TLspObjectHeightTranslationHandle
.
A POINT_INDEX
user property with the given index as value is
set on the handle.aPointList
- the pointlist for which to create a point height handleaPointIndex
- the index of the point for which to create a point height handleaContext
- edit context informationnull
if this handle should not
be created.protected ALspEditHandle createPointPositionHandle(ILcd3DEditablePointList aPointList, int aPointIndex, TLspEditContext aContext)
TLspPointTranslationHandle
, with a user property containing the index of the point. Override this method to change the behavior of point position handles,
or make it return null
to disable creation of point position handles.aPointList
- the pointlist for which to create a point position handleaPointIndex
- the index of the point for which to create a point position handleaContext
- edit context informationnull
if this
handle should not be created.protected ALspEditHandle createObjectTranslationHandle(ILcd3DEditablePointList aPointList, TLspEditContext aContext)
Note that by default this method returns a different handle depending on whether the view is a
2D- or a 3D view: in the 2D case, a TLspObjectTranslationHandle
is returned,
otherwise a TLspProjectedObjectTranslationHandle
is returned.
aPointList
- the point list for which the handle is createdaContext
- the current contextnull
when no handle is neededpublic ALspEditHandle getCreateHandle(TLspEditContext aContext)
ALspCreateHandle
which is a specialized handle implementation used for creating an object.
By default, this method returns an ALspCreateHandle
capable of creating an ILcd3DEditablePointList
, as described in the class javadoc.aContext
- provides context information such as the layer for which the object
is being creatednull
if creation should not be allowed.ALspCreateHandle
,
TLspCreateController