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
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines keys used by the enclosing editor implementation to store properties in its edit handles. -
Constructor Summary
ConstructorsConstructorDescriptionTLspShapeListEditor(ILspEditor aDelegateEditor) Creates a new shape list editor. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanEdit(TLspEditContext aContext) Determines whether or not thegeometry inside the given contextcan be edited by this editor.booleancanPerformOperation(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 TLspEditOperationResulteditImpl(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Called by theeditmethod 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 contextcan 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. Returnstrueif the given object is an instance ofILcdShapeListand if the given geometry is cloneable.- Specified by:
canEditin interfaceILspEditor- Overrides:
canEditin classALspEditor- Parameters:
aContext- provides context information to the editor- Returns:
trueif the above conditions are met,falseotherwise.
-
canPerformOperation
Determines whether or not the editor knows how to apply the given edit operation to the supplied geometry. By default this method returnstrueif 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 returnstrueif the model reference of the edit operation is equal to that of the edited object and if the given operation contains a validSHAPE_IDENTIFIERor if the edit operation is a move operation.Falseotherwise.- Specified by:
canPerformOperationin interfaceILspEditor- Overrides:
canPerformOperationin classALspEditor- Parameters:
aOperation- the operation to be appliedaContext- the edit context- Returns:
trueif 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 aeditImplinstead.SHAPE_IDENTIFIERuser 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:
editin interfaceILspEditor- Overrides:
editin 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 theeditmethod 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 theeditmethod. This method delegates to the delegate editor if the shape is not a shapelist. Otherwise, if the operation contains aSHAPE_IDENTIFIERuser 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:
editImplin classALspEditor- Parameters:
aOperation- the event that contains the information on how to edit the objectaInteractionStatus- the interaction statusaContext- the edit context- Returns:
FAILEDif the given object is not a shape list, or the conditions described above are not met.SUCCESSotherwise. 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 ofALspCreateHandlewhich 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_IDENTIFIERas 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_IDENTIFIERidentifying 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 theeditmethod. 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_IDENTIFIERas 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_IDENTIFIERidentifying the shape for which the handle is relevant in the subshape. - See Also:
-