Class TLspArcByBulgeEditor
java.lang.Object
com.luciad.view.lightspeed.editor.ALspEditor
com.luciad.view.lightspeed.editor.TLspArcByBulgeEditor
- All Implemented Interfaces:
ILspEditor
Enables visual editing of
ILcd2DEditableCircularArcByBulge
objects in an ILspView
.
Handles
The arc-by-bulge editor defines the following edit handles for an arc object:- Start and endpoint handles: allows the user to edit the start and end point of the
arc. The user can change the position of these points by dragging the handle. These handles
generate
MOVE
operations, with aHANDLE_IDENTIFIER
property andSTART_POINT
orEND_POINT
as value. - Bulge point handle: allows the user to change the bulge factor of the arc-by-bulge.
The user can change the position of the bulge factor by dragging the handle. This handle
generates
MOVE
operations, with aHANDLE_IDENTIFIER
property andBULGE_POINT
as value. - Center point handle: allows the user to translate the center of the arc. The
user can change the position of the center point by dragging the handle. This handle
generates
MOVE
operations, with aHANDLE_IDENTIFIER
property withCENTER
as value. - Object translation handle: allows the user to translate the arc object. This handle
generates
MOVE
operations, 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 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:
-
Start or end point handle:
NOTE: the end point handle is not illustrated in these images, but its functionality is similar to the start point handle. -
Bulge point handle:
-
Center point handle:
-
Object translation handle: the editor translates the entire arc. Note that the behaviour
for this handle is identical to the behaviour of the center point handle, with the exception of
how the handle is activated
Creation
The creation process of an arc-by-bulge object consists of the following steps:- the first step sets the start point of the arc-by-bulge
- the second step sets the end point of the arc-by-bulge
- the third step initializes the bulge factor of the arc-by-bulge
Setting the start point | Setting the end point | Initializing the bulge factor |
- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Describes a control point of an arc-by-bulge shape.static enum
Defines keys used by the enclosing editor implementation to store properties in its edit handles. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canEdit
(TLspEditContext aContext) Returnstrue
ifsuper
returnstrue
and the given object is an instance ofILcd2DEditableCircularArcByBulge
.protected ALspEditHandle
createBulgeHandle
(ILcd2DEditableCircularArcByBulge aArc, TLspEditContext aContext) Creates an edit handle that allows the user to edit the given arc by translating its bulge point.protected ALspEditHandle
createCenterHandle
(ILcd2DEditableCircularArcByBulge aArc, TLspEditContext aContext) Creates an edit handle that allows the user to translate the given arc by dragging its center point.protected ALspEditHandle
createEndHandle
(ILcd2DEditableCircularArcByBulge aArc, TLspEditContext aContext) Creates an edit handle that allows the user to edit the given arc by translating its end point.protected ALspEditHandle
Creates an edit handle that allows the user to translate the given shape.protected ALspEditHandle
createStartHandle
(ILcd2DEditableCircularArcByBulge 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 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.getEditHandles
(TLspEditContext aContext) Returns a set of handles for editing the given object.Methods inherited from class com.luciad.view.lightspeed.editor.ALspEditor
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
-
Constructor Details
-
TLspArcByBulgeEditor
public TLspArcByBulgeEditor()Creates a newTLspArcByBulgeEditor
. This constructor does not initialize any state.
-
-
Method Details
-
canEdit
Returnstrue
ifsuper
returnstrue
and the given object is an instance ofILcd2DEditableCircularArcByBulge
.- 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.
-
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 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.- 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(ILcd2DEditableCircularArcByBulge aArc, TLspEditContext aContext) Creates an edit handle that allows the user to translate the given shape. By default this is aTLspObjectTranslationHandle
.- Parameters:
aArc
- the shape for which the handle is createdaContext
- the current context- Returns:
- an edit handle or
null
if no handle is needed
-
createCenterHandle
protected ALspEditHandle createCenterHandle(ILcd2DEditableCircularArcByBulge aArc, TLspEditContext aContext) Creates an edit handle that allows the user to translate the given arc by dragging its center point.- Parameters:
aArc
- the arc for which the handle is createdaContext
- the current context- Returns:
- an edit handle or
null
when no handle is needed
-
createBulgeHandle
protected ALspEditHandle createBulgeHandle(ILcd2DEditableCircularArcByBulge aArc, TLspEditContext aContext) Creates an edit handle that allows the user to edit the given arc by translating its bulge point. By default this method returns aTLspPointTranslationHandle
with aHANDLE_IDENTIFIER
user property withBULGE_POINT
as value.- Parameters:
aArc
- the arc for which the handle is createdaContext
- the current context- Returns:
- an edit handle or
null
when no handle is needed
-
createEndHandle
protected ALspEditHandle createEndHandle(ILcd2DEditableCircularArcByBulge aArc, TLspEditContext aContext) Creates an edit handle that allows the user to edit the given arc by translating its end point. By default this method returns aTLspPointTranslationHandle
with aHANDLE_IDENTIFIER
user property withEND_POINT
as value.- Parameters:
aArc
- the arc for which the handle is createdaContext
- the current context- Returns:
- an edit handle or
null
when no handle is needed
-
createStartHandle
protected ALspEditHandle createStartHandle(ILcd2DEditableCircularArcByBulge aArc, TLspEditContext aContext) Creates an edit handle that allows the user to edit the given arc by translating its start point. By default this method returns aTLspPointTranslationHandle
with aHANDLE_IDENTIFIER
user property withSTART_POINT
as value.- Parameters:
aArc
- the arc for which the handle is createdaContext
- the current context- Returns:
- an edit handle or
null
when no handle is needed
-
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 anILcd2DEditableCircularArcByBulge
, 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:
-
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: If any of the operations contains theHANDLE_IDENTIFIER
property, with aHandleIdentifier
as value, then this editor will only perform the operation on that particular point, otherwise it will perform it on the entire object.- 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.
-