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
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 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
Modifier and TypeClassDescriptionstatic enum
Defines the various values used by theCURVE_CONNECT
property key.static enum
Defines keys used by the enclosing editor implementation to store properties in its edit handles. -
Constructor Summary
ConstructorDescriptionCreates 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 TypeMethodDescriptionvoid
addCurveEditor
(ALspEditor aEditor) Adds an editor as one of the editors used for the individual curves.boolean
canEdit
(TLspEditContext aContext) Returnstrue
ifsuper
returnstrue
and the given object is an instance ofILcdEditableCompositeCurve
.protected ALspEditHandle
createObjectTranslationHandle
(ILcdEditableCompositeCurve aCurve, 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 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.void
setCreationMode
(ELspCreationMode aCreationMode) Sets how the default delegate editors curve behaves during creation.void
setCurveConnectorProvider
(ILcdCurveConnectorProvider aCurveConnectorProvider) Sets the curve connector provider, used to ensure that the composite curve being edited stays nicely connected.void
setCurveCreateEditorModel
(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. TheaddCurveEditor
method 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
Returnstrue
ifsuper
returnstrue
and the given object is an instance ofILcdEditableCompositeCurve
.- 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 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
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, 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
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:TLspEditOperationType.MOVE
TLspEditOperationType.INSERT_POINT
TLspEditOperationType.REMOVE_POINT
TLspEditOperationType.INSERT_SUBSHAPE
TLspEditOperationType.REMOVE_SUBSHAPE
CURVE_IDENTIFIER
property, with anILcdCurve
as value, this editor will delegate to the editor for that curve. Otherwise, in case of theMOVE
operation, the whole curve is translated.- 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:
- 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
-