public class TLspArcBandEditor extends ALspEditor
ILcd2DEditableArcBand
objects in an
ILspView
.
MOVE
operations, with a
HANDLE_IDENTIFIER
user property with MIN_RADIUS_START_CORNER
as value.MOVE
operations, with a
HANDLE_IDENTIFIER
user property with MAX_RADIUS_START_CORNER
as value.MOVE
operations, with a
HANDLE_IDENTIFIER
user property with MIN_RADIUS_END_CORNER
as value.MOVE
operations, with a
HANDLE_IDENTIFIER
user property with MAX_RADIUS_END_CORNER
as value.PROPERTY_CHANGE
operations,
with ""maxRadius""
as property name, and a Double
as value.PROPERTY_CHANGE
operations,
with ""minRadius""
as property name, and a Double
as value.MOVE
operations, with a HANDLE_IDENTIFIER
property with
CENTER_POINT
as value.
MOVE
operations.
TLspEditOperation
, generated by an edit handle (see description
of handles above), this editor performs different edit operations on the associated arc band 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 center point | Initializing minimum radius and start angle | Initializing maximum radius and arc angle |
Modifier and Type | Class and Description |
---|---|
static class |
TLspArcBandEditor.HandleIdentifier
Describes a control point of an arc-by-3-points shape.
|
static class |
TLspArcBandEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its
edit handles.
|
Constructor and Description |
---|
TLspArcBandEditor()
Creates a new
TLspArcBandEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
|
protected ALspEditHandle |
createCenterHandle(ILcd2DEditableArcBand aArcBand,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given arc by translating
its center point.
|
protected ALspEditHandle |
createMaxRadiusEndCornerHandle(ILcd2DEditableArcBand aArcBand,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the arc band by translating its
MAX_RADIUS_END_CORNER point. |
protected ALspEditHandle |
createMaxRadiusHandle(ILcd2DEditableArcBand aArcBand,
TLspEditContext aContext)
Creates an edit handle that allow the user to edit the max radius property of the arc band.
|
protected ALspEditHandle |
createMaxRadiusStartCornerHandle(ILcd2DEditableArcBand aArcBand,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the arc band by translating its
MAX_RADIUS_START_CORNER point. |
protected ALspEditHandle |
createMinRadiusEndCornerHandle(ILcd2DEditableArcBand aArcBand,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the arc band by translating its
MIN_RADIUS_END_CORNER point. |
protected ALspEditHandle |
createMinRadiusHandle(ILcd2DEditableArcBand aArcBand,
TLspEditContext aContext)
Creates an edit handle that allow the user to edit the min radius property of the arc band.
|
protected ALspEditHandle |
createMinRadiusStartCornerHandle(ILcd2DEditableArcBand aArcBand,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the arc band by translating its
MIN_RADIUS_START_CORNER point. |
protected ALspEditHandle |
createObjectTranslationHandle(ILcd2DEditableArcBand aArcBand,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given shape.
|
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 TLspArcBandEditor()
TLspArcBandEditor
. 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 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(ILcd2DEditableArcBand aArcBand, TLspEditContext aContext)
TLspObjectTranslationHandle
.aArcBand
- the shape for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected ALspEditHandle createCenterHandle(ILcd2DEditableArcBand aArcBand, TLspEditContext aContext)
TLspPointTranslationHandle
with a HANDLE_IDENTIFIER
user
property with CENTER_POINT
as value.aArcBand
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createMinRadiusStartCornerHandle(ILcd2DEditableArcBand aArcBand, TLspEditContext aContext)
MIN_RADIUS_START_CORNER
point. By default
this method returns a TLspPointTranslationHandle
with a
HANDLE_IDENTIFIER
user property with
MIN_RADIUS_START_CORNER
as value.aArcBand
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createMaxRadiusStartCornerHandle(ILcd2DEditableArcBand aArcBand, TLspEditContext aContext)
MAX_RADIUS_START_CORNER
point. By default
this method returns a TLspPointTranslationHandle
with a
HANDLE_IDENTIFIER
user property with
MAX_RADIUS_START_CORNER
as value.aArcBand
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createMinRadiusEndCornerHandle(ILcd2DEditableArcBand aArcBand, TLspEditContext aContext)
MIN_RADIUS_END_CORNER
point. By default
this method returns a TLspPointTranslationHandle
with a
HANDLE_IDENTIFIER
user property with
MIN_RADIUS_END_CORNER
as value.aArcBand
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createMaxRadiusEndCornerHandle(ILcd2DEditableArcBand aArcBand, TLspEditContext aContext)
MAX_RADIUS_END_CORNER
point. By default
this method returns a TLspPointTranslationHandle
with a
HANDLE_IDENTIFIER
user property with
MAX_RADIUS_END_CORNER
as value.aArcBand
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createMaxRadiusHandle(ILcd2DEditableArcBand aArcBand, TLspEditContext aContext)
ALspOutlineResizeHandle
that represents the outer arc of the arcband.aArcBand
- the arc for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createMinRadiusHandle(ILcd2DEditableArcBand aArcBand, TLspEditContext aContext)
ALspOutlineResizeHandle
that represents the inner arc of the arcband.aArcBand
- 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 ILcd2DEditableArcBand
, 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 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 move operations contains the HANDLE_IDENTIFIER
property, then this editor will only perform the operation on the respective corner point,
otherwise it will perform it on the entire arc.
If the operation type is PROPERTY_CHANGE
,
and the name of the changed property is ""maxRadius""
, the
max radius of the
arcband is modified. If the name is ""minRadius""
, the
min radius of the
arcband is modified.editImpl
in class ALspEditor
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- the interaction statusaContext
- the edit context