Class TLspLabelEditor
java.lang.Object
com.luciad.view.lightspeed.editor.label.TLspLabelEditor
- All Implemented Interfaces:
ILspEditor
Enables visual editing of labels in an
ILspView
.
Handles
The label editor defines one label handle for each label. These label handles generateMOVE_LABEL
operations, with a MOVE_LABEL.getPropertyKey()
property and a TLspLabelMoveDescriptor
as value.
Editing
Based on theTLspEditOperation
, generated by an edit handle (see description
of handles above), this editor moves the associated label. It converts the location of a label to
a TLspStampLabelLocation
. Labels will still be defined relative to their anchor point.
For this label editor to work, the used layers should implement
ILspInteractivePaintableLayer
and painters
should implement ILspStampLocationLabelPainter
.
Creation
This editor does not support creation.- Since:
- 2012.0
-
Constructor Summary
ConstructorDescriptionCreates a newTLspLabelEditor
where rotation is not cleared when editing a label. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canEdit
(TLspEditContext aContext) Determines whether or not the specified object can be edited by this editor.boolean
canPerformOperation
(TLspEditOperation aOperation, TLspEditContext aContext) Determines whether or not the editor knows how to apply the given edit operation to the supplied geometry.edit
(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Applies an interaction obtained from a handle to the object being edited.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.Returns the label edit filter used to determine which labels should be editable.boolean
Returns if the rotation is cleared, that is, set to 0, when editing a label.boolean
Returns if labels are set to sticky during editing.void
setClearRotation
(boolean aClearRotation) Sets if the rotation of a label is cleared during editing.void
setLabelEditFilter
(ALspLabelEditFilter aLabelEditFilter) Sets the label edit filter used to determine which labels should be editable.void
setStickyOnEdit
(boolean aStickyOnEdit) Whentrue
, this editor sets the labels to sticky during editing.
-
Constructor Details
-
TLspLabelEditor
public TLspLabelEditor()Creates a newTLspLabelEditor
where rotation is not cleared when editing a label.
-
-
Method Details
-
isClearRotation
public boolean isClearRotation()Returns if the rotation is cleared, that is, set to 0, when editing a label.- Returns:
- if the rotation is cleared.
- See Also:
-
setClearRotation
public void setClearRotation(boolean aClearRotation) Sets if the rotation of a label is cleared during editing.- Parameters:
aClearRotation
-true
to clear the label rotation during editing ,andfalse
otherwise.- See Also:
-
setStickyOnEdit
public void setStickyOnEdit(boolean aStickyOnEdit) - Parameters:
aStickyOnEdit
-true
to make labels sticky during editing.
-
isStickyOnEdit
public boolean isStickyOnEdit()Returns if labels are set to sticky during editing.- Returns:
- if labels are set to sticky during editing.
-
setLabelEditFilter
Sets the label edit filter used to determine which labels should be editable.- Parameters:
aLabelEditFilter
- a label edit filter
-
getLabelEditFilter
Returns the label edit filter used to determine which labels should be editable.- Returns:
- the label edit filter used to determine which labels should be editable.
-
getCreateHandle
Description copied from interface:ILspEditor
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.- Specified by:
getCreateHandle
in interfaceILspEditor
- Parameters:
aContext
- provides context information such as the layer for which the object is being created- Returns:
- an edit handle that is used to initialize the state of the object being
created, or
null
if it should not be possible to create the object. - See Also:
-
getEditHandles
Description copied from interface:ILspEditor
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.- Specified by:
getEditHandles
in interfaceILspEditor
- 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:
-
edit
public TLspEditOperationResult edit(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Description copied from interface:ILspEditor
Applies an interaction obtained from a handle to the object being edited.- Specified by:
edit
in interfaceILspEditor
- Parameters:
aOperation
- describes the edit that should occur. This is usually generated by the handles. It is up to the concrete editor to determine how to handle this event.aInteractionStatus
- the interaction statusaContext
- the edit context- Returns:
- information about the result of the operation
-
canEdit
Description copied from interface:ILspEditor
Determines whether or not the specified object can be edited by this editor.- Specified by:
canEdit
in interfaceILspEditor
- Parameters:
aContext
- provides context information to the editor- Returns:
true
if the editor can modify the object.
-
canPerformOperation
Description copied from interface:ILspEditor
Determines whether or not the editor knows how to apply the given edit operation to the supplied geometry.- Specified by:
canPerformOperation
in interfaceILspEditor
- Parameters:
aOperation
- the operation to be appliedaContext
- the edit context- Returns:
- whether or not the editor can apply the given operation
-