public class TLspBoundsEditor extends ALspEditor
ILcd2DEditableBounds
and ILcd3DEditableBounds
objects in an ILspView
.
MOVE
operations, with a
POINT_IDNETIFIER
property, with NORTH_EAST
, NORTH_WEST
, SOUTH_EAST
or SOUTH_WEST
as
value.MOVE
operations, without any additional properties.MOVE
operations,
with a OPERATION_IDENTIFIER
property, with
HEIGHT
as value.MOVE
operations,
with a OPERATION_IDENTIFIER
property, with
MINIMUM_HEIGHT
as value.MOVE
operations, with a OPERATION_IDENTIFIER
property,
with MAXIMUM_HEIGHT
as value.TLspEditOperation
, generated by an edit handle (see
description of handles above), this editor performs different edit operations on the associated
bounds 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:
![]() |
![]() |
![]() |
![]() |
|||
Adding points to the buffer | Initializing the width | (3D only) Initializing the depth | (3D only) Initializing the height |
Modifier and Type | Class and Description |
---|---|
static class |
TLspBoundsEditor.HandleIdentifier
Describes a control point of a bounds.
|
static class |
TLspBoundsEditor.PropertyKeys
Defines keys used by the enclosing editor implementation to properties in its edit handles.
|
Constructor and Description |
---|
TLspBoundsEditor()
Creates a new
TLspBoundsEditor . |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(TLspEditContext aContext)
|
protected ALspEditHandle |
createBoundsResizeHandle(ILcd2DEditableBounds aBounds,
TLspEditContext aContext,
TLspBoundsEditor.HandleIdentifier aPointID)
Creates a handle that allows the user to resize the given bounds object by translating one of
its corner points.
|
protected ALspEditHandle |
createHeightTranslationHandle(ILcd3DEditableBounds aBounds,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the height above the terrain of the given
3D bounds by dragging the bounds up/down.
|
protected ALspEditHandle |
createMaximumHeightHandle(ILcd3DEditableBounds aBounds,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the depth of the given 3D bounds by
dragging it up/down.
|
protected ALspEditHandle |
createMinimumHeightHandle(ILcd3DEditableBounds aBounds,
TLspEditContext aContext)
Creates an edit handle that allows the user to edit the Z-value of the given 3D bounds'
location by dragging it up/down.
|
protected ALspEditHandle |
createObjectTranslationHandle(ILcd2DEditableBounds aBounds,
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.
|
List<ALspEditHandle> |
getEditHandles(TLspEditContext aContext)
Returns a set of handles for editing the given object.
|
canCopyGeometry, canPerformOperation, copyGeometrySFCT, edit, fireUndoableHappened
public TLspBoundsEditor()
TLspBoundsEditor
. 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: createMaximumHeightHandle
createMinimumHeightHandle
createHeightTranslationHandle
createBoundsResizeHandle
createObjectTranslationHandle
createBoundsResizeHandle
is called 4 times, one time for each corner of the bounds. This
method only delegate to the first three methods is the object is an ILcd3DEditableBounds
and if the current view world transformation is a TLspViewXYZWorldTransformation3D
.aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
protected ALspEditHandle createMinimumHeightHandle(ILcd3DEditableBounds aBounds, TLspEditContext aContext)
The handle is painted at the location of the focus point
of the given bounds. The handle's height above the terrain is always equal to
aBounds.getLocation().getZ()
.
null
since in a 2D view,
the height translation handle is not useful. This method is only called when the bounds is
a ILcd3DEditableBounds
.
By default this method returns a handle with a OPERATION_IDENTIFIER
user property, with MINIMUM_HEIGHT
as value.aBounds
- the bounds for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createHeightTranslationHandle(ILcd3DEditableBounds aBounds, TLspEditContext aContext)
null
since in a 2D view,
the height translation handle is not useful. This method is only called when the bounds is
a ILcd3DEditableBounds
.
By default this method returns a handle with a OPERATION_IDENTIFIER
user property, with HEIGHT
as value.aBounds
- the bounds for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createMaximumHeightHandle(ILcd3DEditableBounds aBounds, TLspEditContext aContext)
The handle is painted at the location of the focus point of the given
bounds. The handle's height above the terrain is always equal to
aBounds.getLocation().getZ() + aBounds.getDepth()
.
null
since in a 2D view,
the height translation handle is not useful. This method is only called when the bounds is
a ILcd3DEditableBounds
.
By default this method returns a handle with a OPERATION_IDENTIFIER
user property, with MAXIMUM_HEIGHT
as value.aBounds
- the bounds for which the handle is createdaContext
- the current contextnull
when no handle is neededprotected ALspEditHandle createObjectTranslationHandle(ILcd2DEditableBounds aBounds, TLspEditContext aContext)
TLspObjectTranslationHandle
.aBounds
- the shape for which the handle is createdaContext
- the current contextnull
if no handle is neededprotected ALspEditHandle createBoundsResizeHandle(ILcd2DEditableBounds aBounds, TLspEditContext aContext, TLspBoundsEditor.HandleIdentifier aPointID)
aBounds
- the bounds object for which the handle is createdaContext
- the current contextaPointID
- corner of the bounds for which to create a handlenull
when no resize 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 ILcd2DEditableBounds
, 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. If any of the operations contains the OPERATION_IDENTIFIER
property, with a HandleIdentifier
as value, then
this editor will only perform that particular operation. Otherwise it will move 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