Class TLspComplexPolygonEditor
java.lang.Object
com.luciad.view.lightspeed.editor.ALspEditor
com.luciad.view.lightspeed.editor.TLspComplexPolygonEditor
- All Implemented Interfaces:
ILspEditor
Enables visual editing of
ILcdEditableComplexPolygon
objects
in an ILspView
.
Handles
The complex polygon editor defines the following edit handles for a complex polygon:- Polygon handles: allows the user to edit the sub-polygons.
- Object translation handle: allows the user to translate the entire complex polygon.
This handle generates
MOVE
operations, with without any additional properties.
Editing
Based on theTLspEditOperation
, 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
.
Creation
The creation process of a complex polygon object consists of the creation of several polygons, seeTLsp2DPointListEditor
. 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.- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines keys used by the enclosing editor implementation to store properties in its edit handles. -
Constructor Summary
ConstructorDescriptionCreates a newTLspComplexPolygonEditor
.TLspComplexPolygonEditor
(TLsp2DPointListEditor aCustomPointListEditorDelegate) Creates a newTLspComplexPolygonEditor
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canEdit
(TLspEditContext aContext) Returnstrue
ifsuper
returnstrue
and the given object is an instance ofILcdEditableComplexPolygon
.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 theedit
method to edit the given object based on the givenedit operation
.getCreateHandle
(TLspEditContext aContext) Returns a handle that is used to create the given object.Returns how the delegate point list editor behaves during creation.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.Methods inherited from class com.luciad.view.lightspeed.editor.ALspEditor
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
-
Constructor Details
-
TLspComplexPolygonEditor
public TLspComplexPolygonEditor()Creates a newTLspComplexPolygonEditor
. This constructor initializes a defaultTLsp2DPointListEditor
to be used as a delegate when editing and creating polygons inside a complex polygon. -
TLspComplexPolygonEditor
Creates a newTLspComplexPolygonEditor
. This constructor uses the givenTLsp2DPointListEditor
as a delegate when editing and creating polygons inside a complex polygon.- Parameters:
aCustomPointListEditorDelegate
- the delegate point list editor to be used for creating and editing polygons inside this pointlist.
-
-
Method Details
-
canEdit
Returnstrue
ifsuper
returnstrue
and the given object is an instance ofILcdEditableComplexPolygon
.- Specified by:
canEdit
in interfaceILspEditor
- Overrides:
canEdit
in classALspEditor
- Parameters:
aContext
- provides context information to the editor- Returns:
true
if the above conditions are met,false
otherwise.
-
getCreateHandle
Returns a handle that is used to create the given object. The returned handle is used by the controller to initialize the other of the object. Typically the returned handle is an instance ofALspCreateHandle
which is a specialized handle implementation used for creating an object. By default, this method returns anALspCreateHandle
capable of creating anILcdEditableComplexPolygon
, as described in the class javadoc.- Parameters:
aContext
- provides context information such as the layer for which the object is being created- Returns:
- an edit handle, or
null
if creation should not be allowed. - See Also:
-
getEditHandles
Returns a set of handles for editing the given object. These handles will be able to generate edit operations, that are passed to theedit
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 thecreateObjectTranslationHandle
method. It is added for convenience, so it can easily be overridden. Further, this method adds handles for every polygon in the complex polygon.- Parameters:
aContext
- provides context information such as the layer for which the object is being edited- Returns:
- the edit handles to edit the given object, or an empty list if it should not be possible to edit the given object.
- See Also:
-
createObjectTranslationHandle
protected ALspEditHandle createObjectTranslationHandle(ILcdComplexPolygon aComplexPolygon, TLspEditContext aContext) Creates an edit handle that allows the user to translate the given shape. By default this is aTLspObjectTranslationHandle
.- Parameters:
aComplexPolygon
- the shape for which the handle is createdaContext
- the current context- Returns:
- an edit handle or
null
if no handle is needed
-
editImpl
protected TLspEditOperationResult editImpl(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Called by theedit
method to edit the given object based on the givenedit operation
. Note that this method does not need to lock the model of the object, this already happens in theedit
method. By default, this editor can handle the following operations: ThePOLYGON_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 aMOVE
operation, the entire complex polygon is moved. If any of the operations contains thePOINT_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.- Specified by:
editImpl
in classALspEditor
- Parameters:
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
-aContext
- the edit context- Returns:
SUCCESS
if the above conditions are met,FAILED
otherwise. The invalidation hint will be set if a point was added or removed.
-
getCreationMode
Returns how the delegate point list editor behaves during creation.- Returns:
- the creation mode of the delegate point list editor
-
setCreationMode
Returns how the delegate point list editor behaves during creation.- Parameters:
aCreationMode
- the creation mode to be set on the delegate point list editor
-