public class TLspGeoBufferEditor extends ALspEditor
ILcd2DEditableGeoBuffer
and
TLcdLonLatBuffer
objects in an ILspView
.
MOVE
operations, with
a POINT_INDEX
property.PROPERTY_CHANGE
operations, with ""width"" as property name, and a Double
as
value.MOVE
operations,
without any additional properties.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:
![]() |
![]() |
|
Adding points to the buffer | Initializing the width |
Modifier and Type | Class and Description |
---|---|
static class |
TLspGeoBufferEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its edit
handles.
|
Constructor and Description |
---|
TLspGeoBufferEditor()
Creates a new
TLspGeoBufferEditor . |
TLspGeoBufferEditor(TLsp2DPointListEditor 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 TLcdLonLatBuffer or an
instance of ILcd2DEditableGeoBuffer . |
protected ALspEditHandle |
createBufferOutlineHandle(Object aObject,
TLspEditContext aContext)
Creates an edit handle that allows the user to adjust the width of the given buffer by
modifying its outline.
|
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.
|
ELspCreationMode |
getCreationMode()
Returns how the delegate point list editor behaves during creation.
|
List<ALspEditHandle> |
getEditHandles(TLspEditContext aContext)
Returns a set of handles for editing the given object.
|
void |
setCreationMode(ELspCreationMode aCreationMode)
Returns how the delegate point list editor behaves during creation.
|
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
public TLspGeoBufferEditor()
TLspGeoBufferEditor
. This constructor initializes a default
TLsp2DPointListEditor
to be used as a delegate when editing and creating points in a geobuffer.public TLspGeoBufferEditor(TLsp2DPointListEditor aCustomPointListEditorDelegate)
TLspGeoBufferEditor
. This constructor uses the given
TLsp2DPointListEditor
as a delegate when editing and creating points inside a geobuffer.aCustomPointListEditorDelegate
- the delegate point list editor to be used for
creating and editing points in this pointlist.public boolean canEdit(TLspEditContext aContext)
true
if super
returns true
and the given object
is an instance of TLcdLonLatBuffer
or an
instance of ILcd2DEditableGeoBuffer
.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 createBufferOutlineHandle
method. It is added for convenience, so it
can easily be overridden. Further, it returns the same list of handles as
TLsp2DPointListEditor
.aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createBufferOutlineHandle(Object aObject, TLspEditContext aContext)
aObject
- the buffer object for which the handle is created,
this can be of type TLcdLonLatBuffer
or TLcdLonLatGeoBuffer
aContext
- 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 ILcd2DEditableGeoBuffer
or a TLcdLonLatBuffer
, 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
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
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 the operation type is TLspEditOperationType.PROPERTY_CHANGE
,
and the name of the changed property is "width"
, the width of the buffer is
modified.editImpl
in class ALspEditor
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 ELspCreationMode getCreationMode()
public void setCreationMode(ELspCreationMode aCreationMode)
aCreationMode
- the creation mode to be set on the delegate point list editor