public class TLspDomeEditor extends ALspEditor
ILcd3DEditableDome
objects in an
ILspView
.
PROPERTY_CHANGE
operations, with ""radius"" as property and a
Double
as value.MOVE
operations, with a HANDLE_IDENTIFIER
property with
CENTER_POINT
as value.MOVE
operations, without any additional properties.MOVE
operations,
with a Z constraint, and a HANDLE_IDENTIFIER
property
with HEIGHT_POINT
as value.TLspEditOperation
, generated by an edit handle (see description
of handles above), this editor performs different edit operations on the associated dome 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 the radius. | (3D only) Initializing the height. |
Modifier and Type | Class and Description |
---|---|
static class |
TLspDomeEditor.HandleIdentifier
Describes the type of an edit handle created by the enclosing editor implementation.
|
static class |
TLspDomeEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to store properties in its
edit handles.
|
Constructor and Description |
---|
TLspDomeEditor()
Creates a new
TLspDomeEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
|
protected ALspEditHandle |
createCenterHandle(ILcd3DEditableDome aDome,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given dome in 2D
by dragging it.
|
protected ALspEditHandle |
createHeightTranslationHandle(ILcd3DEditableDome aDome,
TLspEditContext aContext)
Creates an edit handle that allows the user to alter the height above the terrain of the
given dome by dragging it up/down.
|
protected ALspEditHandle |
createObjectTranslationHandle(ILcd3DEditableDome aDome,
TLspEditContext aContext)
Creates an edit handle that allows the user to translate the given shape.
|
protected ALspEditHandle |
createRadiusHandle(ILcd3DEditableDome aDome,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the radius of the given dome
by dragging it.
|
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 TLspDomeEditor()
TLspDomeEditor
. 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.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 property, and this identifier
is RADIUS
, then the radius of the dome will be modified.editImpl
in class ALspEditor
aOperation
- the event that contains the information on how to edit the objectaInteractionStatus
- the interaction statusaContext
- the edit contextpublic 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 ILcd3DEditableDome
, 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 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 createRadiusHandle(ILcd3DEditableDome aDome, TLspEditContext aContext)
By default this method returns a handle with a HANDLE_IDENTIFIER
property with HEIGHT_POINT
as value.
aDome
- the dome for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected ALspEditHandle createCenterHandle(ILcd3DEditableDome aDome, TLspEditContext aContext)
TLspPointTranslationHandle
with a HANDLE_IDENTIFIER
property with
CENTER_POINT
as value.aDome
- the dome for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected ALspEditHandle createHeightTranslationHandle(ILcd3DEditableDome aDome, TLspEditContext aContext)
By default this method returns a TLspObjectHeightTranslationHandle
with a HANDLE_IDENTIFIER
property with
HEIGHT_POINT
as value.
Note that by default this method only returns a height translation handle when the current view
is a 3D view. If this is not the case, this method returns null
since in a 2D view,
the height translation handle is not useful.
aDome
- the dome for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected ALspEditHandle createObjectTranslationHandle(ILcd3DEditableDome aDome, TLspEditContext aContext)
By default, in a 3D view, this handle is visualized as a circle (i.e. a projected version of
the dome) on the terrain. The returned handle is a TLspProjectedObjectTranslationHandle
.
By default, in a 2D view, the handle becomes a regular object translation handle. The returned
handle is a TLspObjectTranslationHandle
.
aDome
- the shape for which the handle is createdaContext
- the current contextnull
if no handle is needed