public class TLspLonLatHeightBufferEditor extends TLsp3DPointListEditor
TLcdLonLatHeightBuffer
objects in an
ILspView
.
Note that the discussion of the editing behaviour below focuses on how a LLH buffer is edited in
a 3D view. In a 2D view, editing a LLH buffer works essentially the same as when using a
TLspGeoBufferEditor
with the exception of how the buffer
width is changed. For the LLH buffer editor, in 2D the width is changed by using the buffer
resize handles (instead of the buffer's outline). Note that when doing this, the height of the
LLH buffer is also changed in such a way that the width/height ratio stays constant.
Note also that the TLspLLHBufferEditor
is an extension of the TLsp3DPointListEditor
and that it uses all of the handles generated by the parent class. Therefore, these handles are
left out in the discussion above and the reader is referred to the class documentation of
MOVE
operations, with a HANDLE_IDENTIFIER
property,
with RESIZE
as value.
TLsp3DPointListEditor
), the blue dots represent
the buffer resize handles and the green buffer shape (drawn on the terrain) represents the
object translation handle (in the case of a 3D view):
TLspEditOperation
, generated by an edit handle (see description
of handles above), this editor performs different edit operations on the associated LLH buffer
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 buffer's first axis point | Setting the height of the buffer's first axis point | Setting the XY location of the buffer's second axis point | Setting the height of the buffer's second axis point |
Modifier and Type | Class and Description |
---|---|
static class |
TLspLonLatHeightBufferEditor.HandleIdentifier
Describes the type of an edit handle created by the enclosing editor implementation.
|
static class |
TLspLonLatHeightBufferEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its
edit handles.
|
static class |
TLspLonLatHeightBufferEditor.ResizeHandleLocation
Enumeration listing possible locations for the buffer's resize handles.
|
Constructor and Description |
---|
TLspLonLatHeightBufferEditor()
Creates a new
TLspLonLatHeightBufferEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
|
protected ALspEditHandle |
createBufferResizeHandle(TLcdLonLatHeightBuffer aBuffer,
TLspEditContext aContext,
TLspLonLatHeightBufferEditor.ResizeHandleLocation aHandleLocation)
Creates an edit handle on the given location that allows the user to resize the given
buffer's width and height.
|
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.
|
createInsertPointHandle, createObjectTranslationHandle, createPointHeightTranslationHandle, createPointPositionHandle, createRemovePointHandle
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
public TLspLonLatHeightBufferEditor()
TLspLonLatHeightBufferEditor
. This constructor does not initialize any state.public boolean canEdit(TLspEditContext aContext)
canEdit
in interface ILspEditor
canEdit
in class TLsp3DPointListEditor
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.
If any of the operations contains the HANDLE_IDENTIFIER
property, with a HandleIdentifier
as value, and this identifier is
RESIZE
, then the buffer with and height are modified.editImpl
in class TLsp3DPointListEditor
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- the interaction statusaContext
- 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.
Additionally This method creates returns resize handles on all four corners of the
front face of the buffer.getEditHandles
in interface ILspEditor
getEditHandles
in class TLsp3DPointListEditor
aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createBufferResizeHandle(TLcdLonLatHeightBuffer aBuffer, TLspEditContext aContext, TLspLonLatHeightBufferEditor.ResizeHandleLocation aHandleLocation)
aBuffer
- the buffer for which the handle is createdaContext
- the current contextaHandleLocation
- the handle locationnull
if no handle is neededpublic ALspEditHandle getCreateHandle(TLspEditContext aContext)
TLsp3DPointListEditor
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.getCreateHandle
in interface ILspEditor
getCreateHandle
in class TLsp3DPointListEditor
aContext
- provides context information such as the layer for which the object
is being creatednull
if creation should not be allowed.ALspCreateHandle
,
TLspCreateController