Class TLspVariableGeoBufferEditor

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

public class TLspVariableGeoBufferEditor extends ALspEditor
Enables visual editing of ILcd3DEditableVariableGeoBuffer objects in an ILspView.

Handles

The LLH buffer editor defines the following edit handles for a variable geo buffer object in addition to the 3D point list handles:
  • Point width/height handles: allows the user to edit the with of a single buffer point. This handle generates PROPERTY_CHANGE operations, with ""width"" as property name, with a POINT_INDEX property and a Double as value. In 3D, it is also possible to edit the heights below and above of a single buffer point. In that case ""heightBelow"" or ""heightAbove"" is used as property name.
  • Outline handle: allows the user to change all widths of all points of the buffer by dragging the outline. this handle generates PROPERTY_CHANGE operations, with ""width"" as property name, without a POINT_INDEX property, and a Double as value. In 3D it is also possible to edit the heights below and above. In that case ""heightBelow"" or ""heightAbove"" is used as property name.

The following figure illustrates all the handles: the red dots represent the point translation handles, the point height translation handles, and the point height below and height above handles. The red dots represent the point width handles. They can be used to modify the width of a single point. The shape itself (green color) can be used to activate the object translation handle and the outline (blue) of the (projected) buffer can be used to change the entire width of the buffer.

Edit handles for variable geo 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 width handle: Allows to edit the width of a single buffer point.

    Changing the point width of a buffer object.

  • Point height above/below handles: Allows to edit the height above/below of a single buffer point.

    Changing the height above property for a point of a buffer object.

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

    Changing the entire width of a buffer object.

The axis itself is edited by the delegate point list editor.

Creation

The creation process of a variable geo buffer object consists of a series of two distinct steps:
  1. the first step initializes the XY location of the next axis point.
  2. the second step initializes the height of that point.
This process continues until the user performs a finishing event (such as a double-click when using the mouse), which results in creation being finalized. The buffer's height and width are set to a default value.

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

Setting the XY location of the first point.
Setting the height of the first point.
Setting the XY location of the second point.
Setting the height of the second point.
Setting the XY location of the buffer's first axis point Setting the height of the buffer's first axis point Setting the XY location of the buffer's second axis point Setting the height of the buffer's second axis point
Since:
2012.1
  • Constructor Details

    • TLspVariableGeoBufferEditor

      public TLspVariableGeoBufferEditor()
      Creates a new TLspVariableGeoBufferEditor. This constructor initializes a default TLsp3DPointListEditor to be used as a delegate when editing and creating points in a variable geo buffer.
    • TLspVariableGeoBufferEditor

      public TLspVariableGeoBufferEditor(TLsp3DPointListEditor aCustomPointListEditorDelegate)
      Creates a new TLspGeoBufferEditor. This constructor uses the given TLsp3DPointListEditor as a delegate when editing and creating the base shape of a variable geo buffer.
      Parameters:
      aCustomPointListEditorDelegate - the delegate point list editor to be used for creating and editing points the the base shape of the variable geo buffer.
  • Method Details

    • canEdit

      public boolean canEdit(TLspEditContext aContext)
      Returns true if super returns true and the given object is an instance of ILcd2DEditableVariableGeoBuffer.
      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 following methods:

      It returns a list containing the handles returned by those methods. These methods are added for convenience, so they can easily be overridden. Further, it returns the same list of handles as TLsp3DPointListEditor.
      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:
    • createObjectTranslationHandle

      protected ALspEditHandle createObjectTranslationHandle(ILcd2DEditableVariableGeoBuffer aBuffer, TLspEditContext aContext)
      Creates an edit handle that allows the user to translate the given buffer horizontally (i.e. parallel to the terrain).

      Note that by default this method returns a different handle depending on whether the view is a 2D- or a 3D view: in the 2D case, a TLspObjectTranslationHandle is returned, otherwise a TLspProjectedObjectTranslationHandle is returned.

      Parameters:
      aBuffer - the buffer for which the handle is created
      aContext - the current context
      Returns:
      an edit handle or null when no handle is needed
    • createPointWidthHandle

      protected ALspEditHandle createPointWidthHandle(ILcdVariableGeoBuffer aBuffer, int aPointIndex, TLspEditContext aContext)
      Creates a handle to edit the width property of a point of the buffer. Override this method to change the behavior of the handle, or make it return null to disable creation of these handles.
      Parameters:
      aBuffer - the buffer for which to create a width point handle.
      aPointIndex - the index of the point for which to create a handle.
      aContext - context information.
      Returns:
      an edit handle to change the width property of a point of the baseshape, or null if this handle should not be created.
    • createPointHeightBelowHandle

      protected ALspEditHandle createPointHeightBelowHandle(ILcdVariableGeoBuffer aBuffer, int aPointIndex, TLspEditContext aContext)
      Creates a handle to edit the height below property of a point of the buffer. Override this method to change the behavior of the handle, or make it return null to disable creation of these handles.

      By default this method only returns a handle when the view is a 3D view, and when the buffer object is a ILcd3DEditableVariableGeoBuffer.

      Parameters:
      aBuffer - the buffer for which to create a height below point handle.
      aPointIndex - the index of the point for which to create a handle.
      aContext - context information.
      Returns:
      an edit handle to change the height below of a point of the baseshape, or null if this handle should not be created.
    • createPointHeightAboveHandle

      protected ALspEditHandle createPointHeightAboveHandle(ILcdVariableGeoBuffer aBuffer, int aPointIndex, TLspEditContext aContext)
      Creates a handle to edit the height above property of a point of the buffer. Override this method to change the behavior of the handle, or make it return null to disable creation of these handles.

      By default this method only returns a handle when the view is a 3D view, and when the buffer object is a ILcd3DEditableVariableGeoBuffer.

      Parameters:
      aBuffer - the buffer for which to create a height above point handle.
      aPointIndex - the index of the point for which to create a handle.
      aContext - context information.
      Returns:
      an edit handle to change the height above of a point of the baseshape, or null if this handle should not be created.
    • createOutlineWidthHandle

      protected ALspEditHandle createOutlineWidthHandle(ILcdVariableGeoBuffer aBuffer, TLspEditContext aContext)
      Creates a handle to edit the width of all points of the buffer. Override this method to change the behavior of the handle, or make it return null to disable creation of these handles.
      Parameters:
      aBuffer - the buffer for which to create a handle.
      aContext - context information.
      Returns:
      an edit handle to change the width of all points of the buffer, or null if this handle should not be created.
    • 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 the PROPERTY_CHANGE operation is used, the following property names are supported:

      • ""width"": The width of the buffer is modified. Depending on the presence of a POINT_INDEX property, the width is modified at one of the axis points, or the entire buffer width is modified.
      • ""heightBelow"": The height below property of the buffer is modified. Depending on the presence of a POINT_INDEX property, the height below property is modified at one of the axis points, or the height below property is modified for all axis points in the buffer.
      • ""heightAbove"": The height above property of the buffer is modified. Depending on the presence of a POINT_INDEX property, the height above property is modified at one of the axis points, or the height above property is modified for all axis points in the buffer.

      If the width (or height below or height above) property is changed for all axis points, the new value represents a relative change. I.e. when the new value is 1.0, the width of each point remains unchanged. When the new value is 2.0, the width is doubled for every point.

      If the width (or height below or height above) property is changed for a single axis point, the new value represents the new width.

      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.

      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:
      The result of the operation: Whether or not there was success, and whether or not the current handles of the object should be invalidated.
    • 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 ILcd3DEditableVariableGeoBuffer, 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 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: