Class TLspGeoBufferEditor

java.lang.Object
com.luciad.view.lightspeed.editor.ALspEditor
com.luciad.view.lightspeed.editor.TLspGeoBufferEditor
All Implemented Interfaces:
ILspEditor

public class TLspGeoBufferEditor extends ALspEditor
Enables visual editing of ILcd2DEditableGeoBuffer and TLcdLonLatBuffer objects in an ILspView.

Handles

The buffer editor defines the following edit handles for a buffer object:
  • Point handles: allows the user to edit the base shape of the buffer object. The user can change the points of the base shape by dragging the handles. This handle generates MOVE operations, with a POINT_INDEX property.
  • Outline handle: allows the user to change the width of the buffer by dragging the outline. this handle generates PROPERTY_CHANGE operations, with ""width"" as property name, and a Double as value.
  • Object translation handle: allows the user to translate the buffer object. This handle generates MOVE operations, without any additional properties.

The following figure illustrates all the handles: the red dots represent the point handles, the shape itself (green color) can be used to activate the object translation handle and the outline (blue) of the buffer can be used to activate the outline handle.

Edit handles for buffer objects.

Editing

Based on the TLspEditOperation, generated by an edit handle (see description of handles above), this editor performs different edit operations on the associated buffer 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:
  • Point handles: Allows to edit the base shape of the buffer object.

    Editing a point of a buffer object.
  • Outline handle: Allows to edit the width of the buffer by dragging its outline.

    Changing the width of a buffer object.

  • Object translation handle: the editor translates the entire buffer.

    Translating a buffer object.

Creation

The creation process of a buffer object consists of 2 steps:
  1. Add new points to the buffer
  2. After adding all points to the buffer, initialize the width of the buffer

The figures below illustrate the creation process. Relevant changes that are new in each step are marked in red:

Setting the center point.
Initializing the width of the buffer.
Adding points to the buffer Initializing the width
Since:
2012.0
  • Constructor Details

    • TLspGeoBufferEditor

      public TLspGeoBufferEditor()
      Creates a new TLspGeoBufferEditor. This constructor initializes a default TLsp2DPointListEditor to be used as a delegate when editing and creating points in a geobuffer.
    • TLspGeoBufferEditor

      public TLspGeoBufferEditor(TLsp2DPointListEditor aCustomPointListEditorDelegate)
      Creates a new TLspGeoBufferEditor. This constructor uses the given TLsp2DPointListEditor as a delegate when editing and creating points inside a geobuffer.
      Parameters:
      aCustomPointListEditorDelegate - the delegate point list editor to be used for creating and editing points in this pointlist.
  • Method Details

    • canEdit

      public boolean canEdit(TLspEditContext aContext)
      Returns true if super returns true and the given object is an instance of TLcdLonLatBuffer or an instance of ILcd2DEditableGeoBuffer.
      Specified by:
      canEdit in interface ILspEditor
      Overrides:
      canEdit in class ALspEditor
      Parameters:
      aContext - provides context information to the editor
      Returns:
      true if the above conditions are met, false otherwise.
    • getEditHandles

      public List<ALspEditHandle> getEditHandles(TLspEditContext aContext)
      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. By default this method delegates to the createBufferOutlineHandle method. It is added for convenience, so it can easily be overridden. Further, it returns the same list of handles as TLsp2DPointListEditor.

      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:
    • createBufferOutlineHandle

      protected ALspEditHandle createBufferOutlineHandle(Object aObject, TLspEditContext aContext)
      Creates an edit handle that allows the user to adjust the width of the given buffer by modifying its outline.
      Parameters:
      aObject - the buffer object for which the handle is created, this can be of type TLcdLonLatBuffer or TLcdLonLatGeoBuffer
      aContext - the current context
      Returns:
      an edit handle or null when no handle is needed
    • getCreateHandle

      public ALspEditHandle getCreateHandle(TLspEditContext aContext)
      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.

      By default, this method returns an ALspCreateHandle capable of creating an ILcd2DEditableGeoBuffer or a TLcdLonLatBuffer, as described in the class javadoc.

      Parameters:
      aContext - provides context information such as the layer for which the object is being created
      Returns:
      an edit handle, or null if creation should not be allowed.
      See Also:
    • editImpl

      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.

      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 POINT_INDEX property, with an integer value, then this editor will only perform the operation on that particular point, otherwise it will perform it on the entire point list.

      If the operation type is TLspEditOperationType.PROPERTY_CHANGE, and the name of the changed property is "width", the width of the buffer is modified.

      Specified by:
      editImpl in class ALspEditor
      Parameters:
      aOperation - the event that contains the information on how to edit the object
      aInteractionStatus - the interaction status
      aContext - the edit context
      Returns:
      SUCCESS if the above conditions are met, FAILED otherwise. The invalidation hint will be set if a point was added or removed.
    • getCreationMode

      public ELspCreationMode getCreationMode()
      Returns how the delegate point list editor behaves during creation.
      Returns:
      the creation mode of the delegate point list editor
    • setCreationMode

      public void setCreationMode(ELspCreationMode aCreationMode)
      Returns how the delegate point list editor behaves during creation.
      Parameters:
      aCreationMode - the creation mode to be set on the delegate point list editor