Class TLspEditContext

java.lang.Object
com.luciad.view.lightspeed.editor.TLspEditContext

public final class TLspEditContext extends Object
Provides context information to editors, such as the object being edited, its paint representation or its layer. This edit context contains the context for the edited objects, as well as for its handles (which can be painted in a different layer for example).
Since:
2012.0
  • Constructor Details

    • TLspEditContext

      public TLspEditContext()
      Creates a new context. Before using this context, it should still be initialized properly.
    • TLspEditContext

      public TLspEditContext(TLspEditContext aEditContext)
      Creates a new context from the given context.
      Parameters:
      aEditContext - an edit context.
    • TLspEditContext

      public TLspEditContext(ILspView aView, Object aObject, TLspPaintRepresentation aObjectPaintRepresentation, ILspInteractivePaintableLayer aObjectLayer, TLspPaintRepresentation aHandlePaintRepresentation, ILspInteractivePaintableLayer aHandleLayer, double aSensitivity, Object aGeometry)
      Creates a new edit context with the given parameters.
      Parameters:
      aView - the view.
      aObject - the object that is being edited.
      aObjectPaintRepresentation - the paint representation of the object that is being edited.
      aObjectLayer - the layer of the object that is being edited.
      aHandlePaintRepresentation - the paint representation of the handles.
      aHandleLayer - the handle layer.
      aSensitivity - the sensitivity.
      aGeometry - the geometry that is being edited. Can be null, in that case, aObject is returned as geometry.
  • Method Details

    • getObjectContext

      public TLspContext getObjectContext()
      Returns the context for the edited object.
      Returns:
      the context for the edited object.
    • getHandleContext

      public TLspContext getHandleContext()
      Returns the context for the handles. This context contains the layer in which handles are visualized.

      Using this context makes it for example possible to do isTouched queries on the projected base shape of a 3D object.

      Returns:
      the context for the handles.
      See Also:
    • getObject

      public Object getObject()
      Returns the object that is being edited. Note: this object can be different than the geometry that is being edited, see also getGeometry. In most cases the geometry is needed, as this is the object that is actually being edited. The object returned by this method is mostly provided as context information.
      Returns:
      the object that is being edited.
    • setObject

      public void setObject(Object aObject)
      Sets the object that is being edited.
      Parameters:
      aObject - the object being edited.
      See Also:
    • getGeometry

      public Object getGeometry()
      Returns the geometry. Note that this could be equal to the object. If no geometry was set, this method will return the edited object.

      The geometry is defined in the same reference as the domain object. To obtain this reference, use getObjectContext and retrieve the model reference of the domain object.

      Returns:
      the geometry being edited.
    • setGeometry

      public void setGeometry(Object aGeometry)
      Sets the geometry that is being edited.
      Parameters:
      aGeometry - the geometry being edited.
      See Also:
    • getObjectPaintRepresentation

      public TLspPaintRepresentation getObjectPaintRepresentation()
      Returns the paint representation for the edited object.
      Returns:
      the paint representation for the edited object.
      See Also:
    • setObjectPaintRepresentation

      public void setObjectPaintRepresentation(TLspPaintRepresentation aObjectPaintRepresentation)
      Sets the paint representation for the edited object.
      Parameters:
      aObjectPaintRepresentation - the paint representation for the edited object.
      See Also:
    • getHandlePaintRepresentation

      public TLspPaintRepresentation getHandlePaintRepresentation()
      returns the paint representation for the handles. This is the paint representation used in the handle layer, in which the handles are visualized.
      Returns:
      the paint representation for the handles.
      See Also:
    • setHandlePaintRepresentation

      public void setHandlePaintRepresentation(TLspPaintRepresentation aHandlePaintRepresentation)
      Sets the paint representation for the handles.
      Parameters:
      aHandlePaintRepresentation - the paint representation for the handles.
      See Also:
    • getSensitivity

      public double getSensitivity()
      Returns the sensitivity.
      Returns:
      the sensitivity.
      See Also:
    • setSensitivity

      public void setSensitivity(double aSensitivity)
      This setting determines for example how close one needs to be to a handle or to a point to be able to move it. The sensitivity is expressed in pixels.
      Parameters:
      aSensitivity - the sensitivity.