Class TLspSurfaceEditor

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

public class TLspSurfaceEditor extends ALspEditor
Enables visual editing of ILcdEditableSurface objects in an ILspView.

Handles

The surface editor defines the following edit handles for a surface:
  • Object translation handle: allows the user to translate the surface. This handle generates MOVE operations, with a xy constraint, without any additional properties.
For surfaces that consist of any of the following exterior rings:
  • ILcdCompositeCurve
  • ILcd2DPointList
  • ILcdCircle
  • ILcdCirlceBy3Points
  • ILcdArcBand
  • ILcdEllipse
The creation of handles is delegated to the default editor of that shape. Please refer to the specific editors for which handles are used for editing.

Note: This only applies to surfaces with no interior rings.

Editing

Based on the TLspEditOperation, generated by an edit handle (see description of handles above), this editor performs different edit operations on the associated surface. 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:
  • Object translation handle
    Translating a surface.

Creation

This editor does not support creation. For creation, refer to any of the more concrete editors available.
Since:
2012.0
  • Constructor Details

    • TLspSurfaceEditor

      public TLspSurfaceEditor()
      Creates a new TLspSurfaceEditor. 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 ILcdEditableSurface.
      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 createObjectTranslationHandle method. It is added for convenience, so it can easily be overridden. This method returns either a list with a single handle, or an empty list.

      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(ILcdEditableSurface aSurface, TLspEditContext aContext)
      Creates an edit handle that allows the user to translate the given shape. By default this is a TLspObjectTranslationHandle.
      Parameters:
      aSurface - the shape for which the handle is created
      aContext - the current context
      Returns:
      an edit handle or null if 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.

      If the surface contains a supported outer ring and no inner rings, this method delegates to the appropriate ring editor. Otherwise, the method returns null.

      Parameters:
      aContext - provides context information such as the layer for which the object is being created
      Returns:
      a create handle or null
      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:

      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.
    • getCurveConnectorProvider

      public ILcdCurveConnectorProvider getCurveConnectorProvider()
      Gets the curve connector provider, used to ensure that the surface's rings being edited stay nicely connected.

      The default curve connector provider is TLcdDefaultCurveConnectorProvider.

      Returns:
      the set curve connector provider
    • setCurveConnectorProvider

      public void setCurveConnectorProvider(ILcdCurveConnectorProvider aCurveConnectorProvider)
      Sets the curve connector provider, used to ensure that the surface's rings being edited stay nicely connected.
      Parameters:
      aCurveConnectorProvider - the new curve connector provider
    • getCreationMode

      public ELspCreationMode getCreationMode()
      Get the Creation Mode behavior for creating point list surfaces.
      Returns:
      the Creation Mode of the point list editor
    • setCreationMode

      public void setCreationMode(ELspCreationMode aCreationMode)
      Set the Creation Mode behavior for creating point list surfaces.
      Parameters:
      aCreationMode - the Creation Mode