Class TLspCompositeCurveEditor
java.lang.Object
com.luciad.view.lightspeed.editor.ALspEditor
com.luciad.view.lightspeed.editor.TLspCompositeCurveEditor
- All Implemented Interfaces:
ILspEditor
Enables visual editing of
ILcdEditableCompositeCurve objects
in an ILspView.
Handles
The composite curve editor defines the following edit handles for a composite curve object:- Curve handles: allows the user to edit the sub-curves.
- Object translation handle: allows the user to translate the composite curve object.
This handle generates
MOVEoperations, 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 composite curve
object. Operations generated by the curve handles are delegated to the curve editors.
Creation
The creation process of a composite curve object consists of the creation of several curves. The next curve to be added during creation is determined by theALspCreateEditorModel
set using the setCurveCreateEditorModel method or the respective
constructor.
Composite curve connectivity is maintained through the ILcdCurveConnector mechanism.- Since:
- 2012.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the various values used by theCURVE_CONNECTproperty key.static enumDefines keys used by the enclosing editor implementation to store properties in its edit handles. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a composite curve editor with a default curve create model.TLspCompositeCurveEditor(ALspCreateEditorModel<ILcdCurve> aCurveCreateEditorModel) Creates a composite curve editor with the given curve create model. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCurveEditor(ALspEditor aEditor) Adds an editor as one of the editors used for the individual curves.booleancanEdit(TLspEditContext aContext) Returnstrueifsuperreturnstrueand the given object is an instance ofILcdEditableCompositeCurve.protected ALspEditHandlecreateObjectTranslationHandle(ILcdEditableCompositeCurve aCurve, TLspEditContext aContext) Creates an edit handle that allows the user to translate the given shape.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.Returns how the default delegate curve editors behave during creation.Gets the curve connector provider, used to ensure that the composite curve being edited stays nicely connected.Gets the create model that is used to create new instances of the curves in a composite curve.getEditHandles(TLspEditContext aContext) Returns a set of handles for editing the given object.voidsetCreationMode(ELspCreationMode aCreationMode) Sets how the default delegate editors curve behaves during creation.voidsetCurveConnectorProvider(ILcdCurveConnectorProvider aCurveConnectorProvider) Sets the curve connector provider, used to ensure that the composite curve being edited stays nicely connected.voidsetCurveCreateEditorModel(ALspCreateEditorModel<ILcdCurve> aCurveCreateEditorModel) Sets the create model that is used to create new instances of the curves in a composite curve.Methods inherited from class com.luciad.view.lightspeed.editor.ALspEditor
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
-
Constructor Details
-
TLspCompositeCurveEditor
Creates a composite curve editor with the given curve create model. The editor will have support for 2D point lists and arcs. TheaddCurveEditormethod can be used to add support for other curve types.- Parameters:
aCurveCreateEditorModel- curve creation model used to create a new curve
-
TLspCompositeCurveEditor
public TLspCompositeCurveEditor()Creates a composite curve editor with a default curve create model. The editor will have support for 2D point lists and arcs. TheaddCurveEditor(ALspEditor)method can be used to add support for other curve type8s.- See Also:
-
-
Method Details
-
addCurveEditor
Adds an editor as one of the editors used for the individual curves.- Parameters:
aEditor- the editor to be added to the list of individual curve editors
-
getCurveConnectorProvider
Gets the curve connector provider, used to ensure that the composite curve being edited stays nicely connected. The default curve connector provider isTLcdDefaultCurveConnectorProvider.- Returns:
- the set curve connector provider
-
setCurveConnectorProvider
Sets the curve connector provider, used to ensure that the composite curve being edited stays nicely connected.- Parameters:
aCurveConnectorProvider- the new curve connector provider
-
getCurveCreateEditorModel
Gets the create model that is used to create new instances of the curves in a composite curve. The default curve create model set is an instance ofTLspCreateCurveEditorModel.- Returns:
- the curve create model
-
setCurveCreateEditorModel
Sets the create model that is used to create new instances of the curves in a composite curve.- Parameters:
aCurveCreateEditorModel- the new curve create model
-
canEdit
Returnstrueifsuperreturnstrueand the given object is an instance ofILcdEditableCompositeCurve.- Specified by:
canEditin interfaceILspEditor- Overrides:
canEditin classALspEditor- Parameters:
aContext- provides context information to the editor- Returns:
trueif the above conditions are met,falseotherwise.
-
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. By default, this method returns anALspCreateHandlecapable of creating anILcdEditableCompositeCurve, 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
nullif 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 theeditmethod. As a way to communicate with this method, handles will copy their properties to the edit operation properties. By default this method delegates to thecreateObjectTranslationHandlemethod. It is added for convenience, so it can easily be overridden. Further, it delegates to the editors added usingaddCurveEditor.- 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(ILcdEditableCompositeCurve aCurve, TLspEditContext aContext) Creates an edit handle that allows the user to translate the given shape. By default this is aTLspObjectTranslationHandle.- Parameters:
aCurve- the shape for which the handle is createdaContext- the current context- Returns:
- an edit handle or
nullif no handle is needed
-
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. By default, this editor can handle the following operations:TLspEditOperationType.MOVETLspEditOperationType.INSERT_POINTTLspEditOperationType.REMOVE_POINTTLspEditOperationType.INSERT_SUBSHAPETLspEditOperationType.REMOVE_SUBSHAPE
CURVE_IDENTIFIERproperty, with anILcdCurveas value, this editor will delegate to the editor for that curve. Otherwise, in case of theMOVEoperation, the whole curve is translated.- 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:
- The result of the operation: Whether or not there was success, and whether or not the current handles of the object should be invalidated.
-
getCreationMode
Returns how the default delegate curve editors behave during creation.- Returns:
- the creation mode of the default delegate curve editors
-
setCreationMode
Sets how the default delegate editors curve behaves during creation. Other editors added byaddCurveEditor(ALspEditor)will not be affected.- Parameters:
aCreationMode- the creation mode to be set on the default delegate curve editors
-