Class TLspShapeListEditor
java.lang.Object
com.luciad.view.lightspeed.editor.ALspEditor
com.luciad.view.lightspeed.editor.TLspShapeListEditor
- All Implemented Interfaces:
ILspEditor
Editor wrapper for editing shapes that are contained in a shape list.
The individual shapes should be editable by the delegate editor.
An example of an editor that can edit
ILcd2DEditablePointList
objects as well as
ILcdShapeList
containing ILcd2DEditablePointList
shapes is:
ILspEditor editor = new TLspShapeListEditor(new TLsp2DPointListEditor());This editor has creation support for shape lists containing exactly one shape.
- 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
ConstructorDescriptionTLspShapeListEditor
(ILspEditor aDelegateEditor) Creates a new shape list editor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canEdit
(TLspEditContext aContext) Determines whether or not thegeometry inside the given context
can be edited by this editor.boolean
canPerformOperation
(TLspEditOperation aOperation, TLspEditContext aContext) Determines whether or not the editor knows how to apply the given edit operation to the supplied geometry.edit
(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Applies an interaction obtained from a handle to the object being edited.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.getEditHandles
(TLspEditContext aContext) Returns a set of handles for editing the given object.Methods inherited from class com.luciad.view.lightspeed.editor.ALspEditor
canCopyGeometry, copyGeometrySFCT, fireUndoableHappened
-
Constructor Details
-
TLspShapeListEditor
Creates a new shape list editor.- Parameters:
aDelegateEditor
- the delegate editor used to edit the shapes of the shape list objects
-
-
Method Details
-
canEdit
Determines whether or not thegeometry inside the given context
can be edited by this editor. Override this method to provide a custom implementation. The default implementation determines whether the given object is cloneable. This editor can only edit cloneable objects. Returnstrue
if the given object is an instance ofILcdShapeList
and if the given geometry is cloneable.- 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.
-
canPerformOperation
Determines whether or not the editor knows how to apply the given edit operation to the supplied geometry. By default this method returnstrue
if the model reference of the edit operation is equal to that of the edited object. If the object is not a shapelist, this method delegates to the delegate editor. Otherwise, the method returnstrue
if the model reference of the edit operation is equal to that of the edited object and if the given operation contains a validSHAPE_IDENTIFIER
or if the edit operation is a move operation.False
otherwise.- Specified by:
canPerformOperation
in interfaceILspEditor
- Overrides:
canPerformOperation
in classALspEditor
- Parameters:
aOperation
- the operation to be appliedaContext
- the edit context- Returns:
true
if the above conditions are met.
-
edit
public TLspEditOperationResult edit(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Applies an interaction obtained from a handle to the object being edited.Note: Only override this method if you want to bypass the undo/redo support provided by this abstract class. For most use cases, it is preferred to override
Applies the given edit operation on the shape list or delegates to the delegate editor. If the operation contains aeditImpl
instead.SHAPE_IDENTIFIER
user property, then the operation will only be applied on that specific shape. If the operation is a move operation (without a shape identifier), then the move operation is applied to all subshapes of the shape list editor.- Specified by:
edit
in interfaceILspEditor
- Overrides:
edit
in classALspEditor
- Parameters:
aOperation
- describes the edit that should occur. This is usually generated by the handles. It is up to the concrete editor to determine how to handle this event.aInteractionStatus
- the interaction statusaContext
- the edit context @return the result of the edit operation- Returns:
- information about the result of the operation
- See Also:
-
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. This method delegates to the delegate editor if the shape is not a shapelist. Otherwise, if the operation contains aSHAPE_IDENTIFIER
user property, then the operation will only be applied on that specific shape. If the operation is a move operation (without a shape identifier), then the move operation is applied to all subshapes of the shape list editor.- Specified by:
editImpl
in classALspEditor
- Parameters:
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- the interaction statusaContext
- the edit context- Returns:
FAILED
if the given object is not a shape list, or the conditions described above are not met.SUCCESS
otherwise. If the delegate editor requires handle invalidation, this will also be made clear in the result.
-
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. This method delegates to the delegate editor if the shape is not a shapelist. Otherwise, it returns null unless the shapelist contains exactly one shape. In this case, this method returns the handle generated by the delegate editor. The handle is augmented with a user property containingSHAPE_IDENTIFIER
as a key, and the sub-shape for which it should be applied as a reference.- Parameters:
aContext
- provides context information such as the layer for which the object is being edited.- Returns:
- null if the shapelist does not contain exactly one shape, or the handle generated by
the delegate editor, augmented with a
SHAPE_IDENTIFIER
identifying the shape for which the handle is relevant in the subshape. - 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. This method always delegates to the delegate editor. If the object is a shape list, each handle is augmented with a user property containingSHAPE_IDENTIFIER
as a key, and the sub-shape for which it should be applied as a reference. The only exception in this process is theALspObjectTranslationHandle
, which is not augmented with this property. This is because object touch handles work on domain objects and not on sub-shapes.- Parameters:
aContext
- provides context information such as the layer for which the object is being edited.- Returns:
- the handles generated by the delegate editor, augmented with a
SHAPE_IDENTIFIER
identifying the shape for which the handle is relevant in the subshape. - See Also:
-