public class TLspArcBy3PointsEditor extends ALspEditor
ILcd2DEditableCircularArcBy3Points
objects in an ILspView
.
MOVE
operations, with a HANDLE_IDENTIFIER
property with
START_POINT
as value.
MOVE
operations, with a HANDLE_IDENTIFIER
property with
INTERMEDIATE_POINT
as value.
MOVE
operations, with a HANDLE_IDENTIFIER
property with
END_POINT
as value.
MOVE
operations, with a HANDLE_IDENTIFIER
property with
CENTER_POINT
as value.
MOVE
operations,
without any additional properties.
TLspEditOperation
, generated by an edit handle (see description
of handles above), this editor performs different edit operations on the associated arc object.
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:
![]() |
![]() |
![]() |
||
Setting the start point | Setting the end point | Setting the intermediate point |
Modifier and Type | Class and Description |
---|---|
static class |
TLspArcBy3PointsEditor.HandleIdentifier
Describes a control point of an arc-by-3-points shape.
|
static class |
TLspArcBy3PointsEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its
edit handles.
|
Constructor and Description |
---|
TLspArcBy3PointsEditor()
Creates a new
TLspArcBy3PointsEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
Returns
true if super returns true and the given object is an
instance of ILcd2DEditableCircularArcBy3Points . |
protected ALspEditHandle |
createCenterHandle(ILcd2DEditableCircularArcBy3Points aArc,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given arc by translating
its center point.
|
protected ALspEditHandle |
createEndPointHandle(ILcd2DEditableCircularArcBy3Points aArc,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the given arc by translating
its end point.
|
protected ALspEditHandle |
createIntermediatePointHandle(ILcd2DEditableCircularArcBy3Points aArc,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the given arc by translating
an intermediate point.
|
protected ALspEditHandle |
createObjectTranslationHandle(ILcd2DEditableCircularArcBy3Points aArc,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given shape.
|
protected ALspEditHandle |
createStartPointHandle(ILcd2DEditableCircularArcBy3Points aArc,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the given arc by translating
its start point.
|
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.
|
List<ALspEditHandle> |
getEditHandles(TLspEditContext aContext)
Returns a set of handles for editing the given object.
|
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
public TLspArcBy3PointsEditor()
TLspArcBy3PointsEditor
. This constructor does not initialize any state.public boolean canEdit(TLspEditContext aContext)
true
if super
returns true
and the given object is an
instance of ILcd2DEditableCircularArcBy3Points
.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 following methods:
It returns a list containing the handles returned by those methods. These methods are
added for convenience, so they can easily be overridden.aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createObjectTranslationHandle(ILcd2DEditableCircularArcBy3Points aArc, TLspEditContext aContext)
TLspObjectTranslationHandle
.aArc
- the shape for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected ALspEditHandle createCenterHandle(ILcd2DEditableCircularArcBy3Points aArc, TLspEditContext aContext)
TLspPointTranslationHandle
with a HANDLE_IDENTIFIER
user
property with CENTER_POINT
as value.aArc
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createStartPointHandle(ILcd2DEditableCircularArcBy3Points aArc, TLspEditContext aContext)
TLspPointTranslationHandle
with a HANDLE_IDENTIFIER
user
property with START_POINT
as value.aArc
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createIntermediatePointHandle(ILcd2DEditableCircularArcBy3Points aArc, TLspEditContext aContext)
TLspPointTranslationHandle
with a HANDLE_IDENTIFIER
user
property with INTERMEDIATE_POINT
as value.aArc
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createEndPointHandle(ILcd2DEditableCircularArcBy3Points aArc, TLspEditContext aContext)
TLspPointTranslationHandle
with a HANDLE_IDENTIFIER
user
property with END_POINT
as value.aArc
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededpublic 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 ILcd2DEditableCircularArcBy3Points
, 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
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:
If any of the operations contains the HANDLE_IDENTIFIER
property, with a HandleIdentifier
as value, then this editor will only
perform the operation on that particular point, otherwise it will perform it on the entire object.editImpl
in class ALspEditor
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- the interaction statusaContext
- the edit context