Class TLspPointEditor

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

public class TLspPointEditor extends ALspEditor
Enables visual editing of ILcd2DEditablePoint and ILcd3DEditablePoint objects in an ILspView.

Handles

The point editor defines the following edit handles for a point object:
  • Location handle: allows the user to change the XY location of the point. For 3D points in a 3D view, this handle is painted on the terrain. This handle generates MOVE operations, with an XY constraint, and without properties.
  • Height handle: (only for 3D points in a 3D view) allows the user to change the height (above the terrain) of the 3D point. This handle generates MOVE operations, with a Z constraint, and without properties.

The following figure illustrates these handles for both the 2D point case (left) and the 3D point case (right): the red dots represent the point handles and the blue dot represents the height handle for a 3D point.

Edit handles for point 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 point 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:
  • Location handle: Modifies the location of the point.

    Editing the XY location of a 2D/3D point object.
    (left) editing the location of a 2D point (right) editing the location of a 3d point

  • Height handle: Modifies the height of the point.

    Changing the height of a 3D point object.

Creation

The creation process of a 2D point object (and 3D points in a 2D view) consists of one step:
  1. initialize the XY position of the point
For 3D points in a 3D view, another step is added to initialize the height (above the terrain) of the point:
  1. a second step initializes the height of the 3D point
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 point.
Initializing the height of a 3D point.
Setting the XY location of the point. (only for 3D points in a 3D view) Initializing the height of a 3D point.
Since:
2012.0
  • Constructor Details

    • TLspPointEditor

      public TLspPointEditor()
      Creates a new TLspPointEditor. This constructor does not initialize any state.
  • Method Details

    • canEdit

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

      protected ALspEditHandle createLocationHandle(ILcd2DEditablePoint aPoint, TLspEditContext aContext)
      Creates a handle to modify the point's location. This handle generates MOVE operations, with an XY constraint, and without properties.

      By default this method returns a TLspPointTranslationHandle for 3D points, when visualized in a 3D view. Otherwise a TLspObjectTranslationHandle is returned.

      Parameters:
      aPoint - the point to be edited
      aContext - the given context
      Returns:
      an edit handle or null if no handle is needed
    • createHeightHandle

      protected ALspEditHandle createHeightHandle(ILcd3DEditablePoint aPoint, TLspEditContext aContext)
      Creates a handle to modify the point's height. This handle generates MOVE operations, with an XY constraint, and without properties.
      Parameters:
      aPoint - the point to be edited
      aContext - the given context
      Returns:
      an edit handle or null if no handle is needed
    • 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:

      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.
    • 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.
      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:
    • 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 ILcd2DEditablePoint, 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: