public class TLspVariableGeoBufferEditor extends ALspEditor
ILcd3DEditableVariableGeoBuffer
objects in an ILspView
.
PROPERTY_CHANGE
operations, with
""width"" as property name, with a POINT_INDEX
property and a Double
as value. In 3D, it is also possible to edit the heights
below and above of a single buffer point. In that case ""heightBelow"" or
""heightAbove"" is used as property name.PROPERTY_CHANGE
operations,
with ""width"" as property name, without a POINT_INDEX
property, and a Double
as value. In 3D it is also possible to edit the heights below
and above. In that case ""heightBelow"" or ""heightAbove""
is used as property name.TLspEditOperation
, generated by an edit handle (see description of
handles above), this editor performs different edit operations on the associated 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 |
TLspVariableGeoBufferEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its edit
handles.
|
Constructor and Description |
---|
TLspVariableGeoBufferEditor()
Creates a new
TLspVariableGeoBufferEditor . |
TLspVariableGeoBufferEditor(TLsp3DPointListEditor aCustomPointListEditorDelegate)
Creates a new
TLspGeoBufferEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
Returns
true if super returns true and the given object
is an instance of ILcd2DEditableVariableGeoBuffer . |
protected ALspEditHandle |
createObjectTranslationHandle(ILcd2DEditableVariableGeoBuffer aBuffer,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given buffer horizontally
(i.e. parallel to the terrain).
|
protected ALspEditHandle |
createOutlineWidthHandle(ILcdVariableGeoBuffer aBuffer,
TLspEditContext aContext)
Creates a handle to edit the width of all points of the buffer.
|
protected ALspEditHandle |
createPointHeightAboveHandle(ILcdVariableGeoBuffer aBuffer,
int aPointIndex,
TLspEditContext aContext)
Creates a handle to edit the height above property of a point of the buffer.
|
protected ALspEditHandle |
createPointHeightBelowHandle(ILcdVariableGeoBuffer aBuffer,
int aPointIndex,
TLspEditContext aContext)
Creates a handle to edit the height below property of a point of the buffer.
|
protected ALspEditHandle |
createPointWidthHandle(ILcdVariableGeoBuffer aBuffer,
int aPointIndex,
TLspEditContext aContext)
Creates a handle to edit the width property of a point of the buffer.
|
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 TLspVariableGeoBufferEditor()
TLspVariableGeoBufferEditor
. This constructor
initializes a default TLsp3DPointListEditor
to be used as a
delegate when editing and creating points in a variable geo buffer.public TLspVariableGeoBufferEditor(TLsp3DPointListEditor aCustomPointListEditorDelegate)
TLspGeoBufferEditor
. This constructor uses
the given TLsp3DPointListEditor
as a delegate when editing and
creating the base shape of a variable geo buffer.aCustomPointListEditorDelegate
- the delegate point list editor to be used for creating
and editing points the the base shape of the variable geo
buffer.public boolean canEdit(TLspEditContext aContext)
true
if super
returns true
and the given object
is an instance of ILcd2DEditableVariableGeoBuffer
.canEdit
in interface ILspEditor
canEdit
in class ALspEditor
aContext
- provides context information to the editortrue
if the above conditions are met, false
otherwise.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: createPointHeightBelowHandle
createPointHeightAboveHandle
createPointWidthHandle
createOutlineWidthHandle
createObjectTranslationHandle
TLsp3DPointListEditor
.aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createObjectTranslationHandle(ILcd2DEditableVariableGeoBuffer aBuffer, 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.
aBuffer
- the buffer for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createPointWidthHandle(ILcdVariableGeoBuffer aBuffer, int aPointIndex, TLspEditContext aContext)
null
to disable creation of
these handles.aBuffer
- the buffer for which to create a width point handle.aPointIndex
- the index of the point for which to create a handle.aContext
- context information.null
if this handle should not be created.protected ALspEditHandle createPointHeightBelowHandle(ILcdVariableGeoBuffer aBuffer, int aPointIndex, TLspEditContext aContext)
null
to disable
creation of these handles. By default this method only returns a handle when the view is a
3D view, and when the buffer object is a ILcd3DEditableVariableGeoBuffer
.aBuffer
- the buffer for which to create a height below point handle.aPointIndex
- the index of the point for which to create a handle.aContext
- context information.null
if this handle should not be created.protected ALspEditHandle createPointHeightAboveHandle(ILcdVariableGeoBuffer aBuffer, int aPointIndex, TLspEditContext aContext)
null
to disable
creation of these handles. By default this method only returns a handle when the view is a
3D view, and when the buffer object is a ILcd3DEditableVariableGeoBuffer
.aBuffer
- the buffer for which to create a height above point handle.aPointIndex
- the index of the point for which to create a handle.aContext
- context information.null
if this handle should not be created.protected ALspEditHandle createOutlineWidthHandle(ILcdVariableGeoBuffer aBuffer, TLspEditContext aContext)
null
to disable creation of these
handles.aBuffer
- the buffer for which to create a handle.aContext
- context information.null
if
this handle should not be created.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: TLspEditOperationType.MOVE
TLspEditOperationType.INSERT_POINT
TLspEditOperationType.REMOVE_POINT
TLspEditOperationType.PROPERTY_CHANGE
PROPERTY_CHANGE
operation is used, the
following property names are supported: ""width""
:
The width of the buffer is modified. Depending on the presence of a POINT_INDEX
property, the width is modified at
one of the axis points, or the entire buffer width is modified.""heightBelow""
: The height below property of the buffer is modified.
Depending on the presence of a POINT_INDEX
property, the height below property is modified at one of the axis points, or the
height below property is modified for all axis points in the buffer.""heightAbove""
: The height above property of the buffer is modified.
Depending on the presence of a POINT_INDEX
property, the height above property is modified at one of the axis points, or the
height above property is modified for all axis points in the buffer.1.0
, the width of each
point remains unchanged. When the new value is 2.0
, the width is doubled for every
point. If the width (or height below or height above) property is changed for a single
axis point, the new value represents the new width. 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
- the interaction statusaContext
- the edit contextpublic 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 ILcd3DEditableVariableGeoBuffer
, as described in the class javadoc.aContext
- provides context information such as the layer for which the object
is being creatednull
if it should not be possible to create the object.ALspCreateHandle
,
TLspCreateController