Class TLspLabelEditor

java.lang.Object
com.luciad.view.lightspeed.editor.label.TLspLabelEditor
All Implemented Interfaces:
ILspEditor

public class TLspLabelEditor extends Object implements ILspEditor
Enables visual editing of labels in an ILspView.

Handles

The label editor defines one label handle for each label. These label handles generate MOVE_LABEL operations, with a MOVE_LABEL.getPropertyKey() property and a TLspLabelMoveDescriptor as value.

Editing

Based on the 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.

Creation

This editor does not support creation.
Since:
2012.0
  • Constructor Details

    • TLspLabelEditor

      public TLspLabelEditor()
      Creates a new TLspLabelEditor 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 ,and false otherwise.
      See Also:
    • setStickyOnEdit

      public void setStickyOnEdit(boolean aStickyOnEdit)
      When true, this editor sets the labels to sticky during editing. By default this value is true.
      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

      public void setLabelEditFilter(ALspLabelEditFilter aLabelEditFilter)
      Sets the label edit filter used to determine which labels should be editable.
      Parameters:
      aLabelEditFilter - a label edit filter
    • getLabelEditFilter

      public ALspLabelEditFilter 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

      public ALspEditHandle getCreateHandle(TLspEditContext aContext)
      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 of ALspCreateHandle which is a specialized handle implementation used for creating an object.

      Specified by:
      getCreateHandle in interface ILspEditor
      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

      public List<ALspEditHandle> getEditHandles(TLspEditContext aContext)
      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 the edit method. As a way to communicate with this method, handles will copy their properties to the edit operation properties.

      Specified by:
      getEditHandles in interface ILspEditor
      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 interface ILspEditor
      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 status
      aContext - the edit context
      Returns:
      information about the result of the operation
    • canEdit

      public boolean canEdit(TLspEditContext aContext)
      Description copied from interface: ILspEditor
      Determines whether or not the specified object can be edited by this editor.
      Specified by:
      canEdit in interface ILspEditor
      Parameters:
      aContext - provides context information to the editor
      Returns:
      true if the editor can modify the object.
    • canPerformOperation

      public boolean canPerformOperation(TLspEditOperation aOperation, TLspEditContext aContext)
      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 interface ILspEditor
      Parameters:
      aOperation - the operation to be applied
      aContext - the edit context
      Returns:
      whether or not the editor can apply the given operation