public class TLspCompositeCurveEditor extends ALspEditor
ILcdEditableCompositeCurve
objects
in an ILspView
.
MOVE
operations, with without any additional properties.TLspEditOperation
, 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.
ALspCreateEditorModel
set using the setCurveCreateEditorModel
method or the respective
constructor.
Composite curve connectivity is maintained through the ILcdCurveConnector
mechanism.ALspCreateEditorModel
,
ILcdCurveConnector
Modifier and Type | Class and Description |
---|---|
static class |
TLspCompositeCurveEditor.CurveConnectMode
Defines the various values used by the
CURVE_CONNECT property key. |
static class |
TLspCompositeCurveEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its edit handles.
|
Constructor and Description |
---|
TLspCompositeCurveEditor()
Creates 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.
|
Modifier and Type | Method and Description |
---|---|
void |
addCurveEditor(ALspEditor aEditor)
Adds an editor as one of the editors used for the individual curves.
|
boolean |
canEdit(TLspEditContext aContext)
Returns
true if super returns true and the given object is an
instance of ILcdEditableCompositeCurve . |
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 the
edit method to edit the given object based on the given
edit operation . |
ALspEditHandle |
getCreateHandle(TLspEditContext aContext)
Returns a handle that is used to create the given object.
|
ELspCreationMode |
getCreationMode()
Returns how the default delegate curve editors behave during creation.
|
ILcdCurveConnectorProvider |
getCurveConnectorProvider()
Gets the curve connector provider, used to ensure that the composite
curve being edited stays nicely connected.
|
ALspCreateEditorModel<ILcdCurve> |
getCurveCreateEditorModel()
Gets the create model that is used to create new instances of the
curves in a composite curve.
|
List<ALspEditHandle> |
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.
|
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
public TLspCompositeCurveEditor(ALspCreateEditorModel<ILcdCurve> aCurveCreateEditorModel)
addCurveEditor
method can be used to add support for other curve types.aCurveCreateEditorModel
- curve creation model used to create a new curvepublic TLspCompositeCurveEditor()
addCurveEditor(ALspEditor)
method can be used to add support for other curve type8s.TLspCreateCurveEditorModel
public void addCurveEditor(ALspEditor aEditor)
aEditor
- the editor to be added to the list of individual curve editorspublic ILcdCurveConnectorProvider getCurveConnectorProvider()
TLcdDefaultCurveConnectorProvider
.public void setCurveConnectorProvider(ILcdCurveConnectorProvider aCurveConnectorProvider)
aCurveConnectorProvider
- the new curve connector providerpublic ALspCreateEditorModel<ILcdCurve> getCurveCreateEditorModel()
TLspCreateCurveEditorModel
.public void setCurveCreateEditorModel(ALspCreateEditorModel<ILcdCurve> aCurveCreateEditorModel)
aCurveCreateEditorModel
- the new curve create modelpublic boolean canEdit(TLspEditContext aContext)
true
if super
returns true
and the given object is an
instance of ILcdEditableCompositeCurve
.canEdit
in interface ILspEditor
canEdit
in class ALspEditor
aContext
- provides context information to the editortrue
if the above conditions are met, false
otherwise.public ALspEditHandle getCreateHandle(TLspEditContext aContext)
ALspCreateHandle
which is a specialized handle implementation used for creating an object.
By default, this method returns an ALspCreateHandle
capable of creating an ILcdEditableCompositeCurve
, as described in the class javadoc.aContext
- provides context information such as the layer for which the object
is being creatednull
if creation should not be allowed.ALspCreateHandle
,
TLspCreateController
public List<ALspEditHandle> getEditHandles(TLspEditContext aContext)
edit
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 the createObjectTranslationHandle
method. It is added for convenience, so it
can easily be overridden. Further, it delegates to the editors added using
addCurveEditor
.aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createObjectTranslationHandle(ILcdEditableCompositeCurve aCurve, TLspEditContext aContext)
TLspObjectTranslationHandle
.aCurve
- the shape for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected TLspEditOperationResult editImpl(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext)
edit
method to edit the given object based on the given
edit operation
.
Note that this method does not need to lock the model of the object, this already happens in the
edit
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
an ILcdCurve
as value, this editor will delegate to the editor for
that curve. Otherwise, in case of the MOVE
operation, the whole curve is
translated.editImpl
in class ALspEditor
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- the interaction statusaContext
- the edit contextpublic ELspCreationMode getCreationMode()
public void setCreationMode(ELspCreationMode aCreationMode)
addCurveEditor(ALspEditor)
will not be affected.aCreationMode
- the creation mode to be set on the default delegate curve editors