public class TLspLabelEditor extends Object implements ILspEditor
ILspView
.
MOVE_LABEL
operations, with a MOVE_LABEL.getPropertyKey()
property and a TLspLabelMoveDescriptor
as value.
TLspEditOperation
, 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
.
Constructor and Description |
---|
TLspLabelEditor()
Creates a new
TLspLabelEditor where rotation is not
cleared when editing a label. |
Modifier and Type | Method and Description |
---|---|
boolean |
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.
|
TLspEditOperationResult |
edit(TLspEditOperation aOperation,
ELspInteractionStatus aInteractionStatus,
TLspEditContext aContext)
Applies an interaction obtained from a handle to the object being edited.
|
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.
|
ALspLabelEditFilter |
getLabelEditFilter()
Returns the label edit filter used to determine which labels should be editable.
|
boolean |
isClearRotation()
Returns if the rotation is cleared, that is, set to 0, when editing a label.
|
boolean |
isStickyOnEdit()
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)
When
true , this editor sets the labels to
sticky
during editing. |
public TLspLabelEditor()
TLspLabelEditor
where rotation is not
cleared when editing a label.public boolean isClearRotation()
setClearRotation(boolean)
public void setClearRotation(boolean aClearRotation)
aClearRotation
- true
to clear the label rotation during editing ,and
false
otherwise.isClearRotation()
public void setStickyOnEdit(boolean aStickyOnEdit)
aStickyOnEdit
- true
to make labels sticky during editing.public boolean isStickyOnEdit()
public void setLabelEditFilter(ALspLabelEditFilter aLabelEditFilter)
aLabelEditFilter
- a label edit filterpublic ALspLabelEditFilter getLabelEditFilter()
public ALspEditHandle getCreateHandle(TLspEditContext aContext)
ILspEditor
ALspCreateHandle
which is a specialized handle implementation used for creating an object.getCreateHandle
in interface ILspEditor
aContext
- provides context information such as the layer for which the object
is being creatednull
if it should not be possible to create the object.ALspCreateHandle
,
TLspCreateController
public List<ALspEditHandle> getEditHandles(TLspEditContext aContext)
ILspEditor
edit
method. As a way to communicate with this method,
handles will copy their properties to the edit operation properties.getEditHandles
in interface ILspEditor
aContext
- provides context information such as the layer for which the object
is being editedTLspEditController
public TLspEditOperationResult edit(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext)
ILspEditor
edit
in interface ILspEditor
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 contextpublic boolean canEdit(TLspEditContext aContext)
ILspEditor
canEdit
in interface ILspEditor
aContext
- provides context information to the editortrue
if the editor can modify the object.public boolean canPerformOperation(TLspEditOperation aOperation, TLspEditContext aContext)
ILspEditor
canPerformOperation
in interface ILspEditor
aOperation
- the operation to be appliedaContext
- the edit context