public class TLspSurfaceEditor extends ALspEditor
ILcdEditableSurface
objects in an
ILspView
.
MOVE
operations, with a xy constraint, without any additional properties.
TLspEditOperation
, generated by an edit handle (see description
of handles above), this editor performs different edit operations on the associated surface.
The images below illustrate the effect of the different handles. In each image the
gray color represents the previous state of the object and the red color represents the edited object:
Constructor and Description |
---|
TLspSurfaceEditor()
Creates a new
TLspSurfaceEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
|
protected ALspEditHandle |
createObjectTranslationHandle(ILcdEditableSurface aSurface,
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()
Get the Creation Mode behavior for creating point list surfaces.
|
ILcdCurveConnectorProvider |
getCurveConnectorProvider()
Gets the curve connector provider, used to ensure that the surface's rings
being edited stay nicely connected.
|
List<ALspEditHandle> |
getEditHandles(TLspEditContext aContext)
Returns a set of handles for editing the given object.
|
void |
setCreationMode(ELspCreationMode aCreationMode)
Set the Creation Mode behavior for creating point list surfaces.
|
void |
setCurveConnectorProvider(ILcdCurveConnectorProvider aCurveConnectorProvider)
Sets the curve connector provider, used to ensure that the surface's rings
being edited stay nicely connected.
|
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
public TLspSurfaceEditor()
TLspSurfaceEditor
. This constructor does not initialize any state.public boolean canEdit(TLspEditContext aContext)
canEdit
in interface ILspEditor
canEdit
in class ALspEditor
aContext
- provides context information to the editortrue
if the above conditions are met, false
otherwise.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. This method returns either a list with a single handle,
or an empty list.aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createObjectTranslationHandle(ILcdEditableSurface aSurface, TLspEditContext aContext)
TLspObjectTranslationHandle
.aSurface
- the shape for which the handle is createdaContext
- the current contextnull
if no handle is neededpublic ALspEditHandle getCreateHandle(TLspEditContext aContext)
ALspCreateHandle
which is a specialized handle implementation used for creating an object.
If the surface contains a supported outer ring and no inner rings, this method delegates to the appropriate ring
editor. Otherwise, the method returns null
.aContext
- provides context information such as the layer for which the object
is being creatednull
ALspCreateHandle
,
TLspCreateController
protected 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:
editImpl
in class ALspEditor
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- the interaction statusaContext
- the edit contextpublic ILcdCurveConnectorProvider getCurveConnectorProvider()
TLcdDefaultCurveConnectorProvider
.public void setCurveConnectorProvider(ILcdCurveConnectorProvider aCurveConnectorProvider)
aCurveConnectorProvider
- the new curve connector providerpublic ELspCreationMode getCreationMode()
public void setCreationMode(ELspCreationMode aCreationMode)
aCreationMode
- the Creation Mode