public class TLspComplexPolygonEditor extends ALspEditor
ILcdEditableComplexPolygon
objects
in an ILspView
.
MOVE
operations, with without any additional properties.TLspEditOperation
, generated by an edit handle (see description
of handles above), this editor performs different edit operations on the associated complex polygon
object. This editor only unwraps the polygons contained by the ILcdEditableComplexPolygon
object that is being edited and delegates editing for those polygons to the TLsp2DPointListEditor
.
TLsp2DPointListEditor
. A single polygon
can be finished with a right-click, after which a new polygon can be created. The entire
creation process is stopped when a double-click event is encountered.Modifier and Type | Class and Description |
---|---|
static class |
TLspComplexPolygonEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its
edit handles.
|
Constructor and Description |
---|
TLspComplexPolygonEditor()
Creates a new
TLspComplexPolygonEditor . |
TLspComplexPolygonEditor(TLsp2DPointListEditor aCustomPointListEditorDelegate)
Creates a new
TLspComplexPolygonEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
Returns
true if super returns true and the given object is an
instance of ILcdEditableComplexPolygon . |
protected ALspEditHandle |
createObjectTranslationHandle(ILcdComplexPolygon aComplexPolygon,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given shape.
|
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 TLspComplexPolygonEditor()
TLspComplexPolygonEditor
. This constructor initializes a default
TLsp2DPointListEditor
to be used as a delegate when editing and creating polygons inside a complex polygon.public TLspComplexPolygonEditor(TLsp2DPointListEditor aCustomPointListEditorDelegate)
TLspComplexPolygonEditor
. This constructor uses the given
TLsp2DPointListEditor
as a delegate when editing and creating polygons inside a complex polygon.aCustomPointListEditorDelegate
- the delegate point list editor to be used for
creating and editing polygons inside this pointlist.public boolean canEdit(TLspEditContext aContext)
true
if super
returns true
and the given object is an
instance of ILcdEditableComplexPolygon
.canEdit
in interface ILspEditor
canEdit
in class ALspEditor
aContext
- provides context information to the editortrue
if the above conditions are met, false
otherwise.public 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 ILcdEditableComplexPolygon
, 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
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 createObjectTranslationHandle
method. It is added for convenience, so it
can easily be overridden. Further, this method adds handles for every polygon
in the complex polygon.aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createObjectTranslationHandle(ILcdComplexPolygon aComplexPolygon, TLspEditContext aContext)
TLspObjectTranslationHandle
.aComplexPolygon
- the shape for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected 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:
The POLYGON_IDENTIFIER
property is used to identify
the sub polygon on which to apply the operation. If no polygon is specified, and the edit
operation is a MOVE
operation, the entire complex
polygon is moved.
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 ELspCreationMode getCreationMode()
public void setCreationMode(ELspCreationMode aCreationMode)
aCreationMode
- the creation mode to be set on the delegate point list editor