Class TLspCompositeCurveEditor

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

public class TLspCompositeCurveEditor extends ALspEditor
Enables visual editing of ILcdEditableCompositeCurve objects in an ILspView.

Handles

The composite curve editor defines the following edit handles for a composite curve object:
  • Curve handles: allows the user to edit the sub-curves.
  • Object translation handle: allows the user to translate the composite curve object. This handle generates MOVE operations, with without any additional properties.

Editing

Based on the TLspEditOperation, generated by an edit handle (see description of handles above), this editor performs different edit operations on the associated composite curve object. Operations generated by the curve handles are delegated to the curve editors.

Creation

The creation process of a composite curve object consists of the creation of several curves. The next curve to be added during creation is determined by the ALspCreateEditorModel set using the setCurveCreateEditorModel method or the respective constructor.

Composite curve connectivity is maintained through the ILcdCurveConnector mechanism.

Since:
2012.0
See Also:
  • Constructor Details

    • TLspCompositeCurveEditor

      public TLspCompositeCurveEditor(ALspCreateEditorModel<ILcdCurve> aCurveCreateEditorModel)
      Creates a composite curve editor with the given curve create model.

      The editor will have support for 2D point lists and arcs. The addCurveEditor method can be used to add support for other curve types.

      Parameters:
      aCurveCreateEditorModel - curve creation model used to create a new curve
    • TLspCompositeCurveEditor

      public TLspCompositeCurveEditor()
      Creates a composite curve editor with a default curve create model.

      The editor will have support for 2D point lists and arcs. The addCurveEditor(ALspEditor) method can be used to add support for other curve type8s.

      See Also:
  • Method Details

    • addCurveEditor

      public void addCurveEditor(ALspEditor aEditor)
      Adds an editor as one of the editors used for the individual curves.
      Parameters:
      aEditor - the editor to be added to the list of individual curve editors
    • getCurveConnectorProvider

      public ILcdCurveConnectorProvider getCurveConnectorProvider()
      Gets the curve connector provider, used to ensure that the composite curve being edited stays 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 composite curve being edited stays nicely connected.
      Parameters:
      aCurveConnectorProvider - the new curve connector provider
    • getCurveCreateEditorModel

      public ALspCreateEditorModel<ILcdCurve> getCurveCreateEditorModel()
      Gets the create model that is used to create new instances of the curves in a composite curve.

      The default curve create model set is an instance of TLspCreateCurveEditorModel.

      Returns:
      the curve create model
    • setCurveCreateEditorModel

      public void setCurveCreateEditorModel(ALspCreateEditorModel<ILcdCurve> aCurveCreateEditorModel)
      Sets the create model that is used to create new instances of the curves in a composite curve.
      Parameters:
      aCurveCreateEditorModel - the new curve create model
    • canEdit

      public boolean canEdit(TLspEditContext aContext)
      Returns true if super returns true and the given object is an instance of ILcdEditableCompositeCurve.
      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.
    • 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 ILcdEditableCompositeCurve, 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:
    • 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. Further, it delegates to the editors added using addCurveEditor.

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

      If any of the operations contains the CURVE_IDENTIFIER property, with an ILcdCurve as value, this editor will delegate to the editor for that curve. Otherwise, in case of the MOVE operation, the whole curve is translated.
      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.
    • getCreationMode

      public ELspCreationMode getCreationMode()
      Returns how the default delegate curve editors behave during creation.
      Returns:
      the creation mode of the default delegate curve editors
    • setCreationMode

      public void setCreationMode(ELspCreationMode aCreationMode)
      Sets how the default delegate editors curve behaves during creation. Other editors added by addCurveEditor(ALspEditor) will not be affected.
      Parameters:
      aCreationMode - the creation mode to be set on the default delegate curve editors