Interface ILspInteractivePaintableLayer

All Superinterfaces:
ILcdLayer, ILcdPropertyChangeSource, ILcdSelection<Object>, ILspLayer, ILspPaintableLayer, ILspStyledLayer, Serializable
All Known Implementing Classes:
TLspGXYLayerAdapter, TLspGXYLayerTreeNodeAdapter, TLspLayer, TLspLayerTreeNode

public interface ILspInteractivePaintableLayer extends ILspPaintableLayer, ILspStyledLayer
Extension of ILspPaintableLayer that paints the contents of its model using an ILspPainter. This interface also defines the ability to graphically select and edit domain objects using an ILspEditor.
Since:
2012.0
  • Method Details

    • getPainter

      ILspPainter getPainter(TLspPaintRepresentation aPaintRepresentation)
      Returns the painter currently associated with the specified paint representation, or null if no painter is associated.
      Parameters:
      aPaintRepresentation - the paint representation for which to obtain a painter
      Returns:
      the associated painter if it exists, or null otherwise
      Throws:
      IllegalArgumentException - if aPaintRepresentation is not supported
    • getEditor

      ILspEditor getEditor(TLspPaintRepresentation aPaintRepresentation)
      Returns the editor currently associated with the given paint representation, or null if no editor is associated.
      Parameters:
      aPaintRepresentation - the paint representation for which to retrieve an editor
      Returns:
      the associated editor if it exists, or null otherwise
      Throws:
      IllegalArgumentException - if aPaintRepresentation is not supported
    • getObjectsWithPaintState

      ILcdCollection<Object> getObjectsWithPaintState(TLspPaintState aState)
      Returns the objects in the specified paint state.

      The paint state must not be TLspPaintState.REGULAR, you can use query(com.luciad.view.lightspeed.query.ALspPaintQuery<T>, com.luciad.view.lightspeed.TLspContext) instead to get the current regular objects in the view.

      The state of objects can be modified by adding/removing them from the returned collection. You can be informed when the objects in a certain state change by adding a listener to the returned collection.

      To avoid threading issues when multiple threads read or write to these collections, it is required to take a read or write lock on this collection when you access it, using the TLcdLockUtil. For example:

          ILcdCollection<Object> editedObjects = layer.getObjectsWithPaintState(TLspPaintState.EDITED);
          try (TLcdLockUtil.Lock lock = TLcdLockUtil.writeLock(editedObjects)) {
            editedObjects.add(newlySelectedObject);
          }
      
      Parameters:
      aState - a paint state
      Returns:
      the objects
    • editedObjectChanged

      void editedObjectChanged(Object aObject)
      This method should be called when an object that is being edited has changed significantly. As a result all editing listeners will be informed of this.
      Parameters:
      aObject - the object
      See Also:
    • editedObjectsChanged

      default void editedObjectsChanged(Collection<Object> aObjectList)
      This method should be called when a group of objects that is being edited has changed significantly. As a result, all editing listeners will be informed of this change.
      Parameters:
      aObjectList - A list of domain objects (in this layer) that have changed significantly. Never null.
      See Also:
    • addEditingStateListener

      void addEditingStateListener(ILspEditingStateListener aListener)
      /** Adds an ILspEditingStateListener to this ILspInteractivePaintableLayer.
      Parameters:
      aListener - the ILspEditingStateListener to be added.
    • removeEditingStateListener

      void removeEditingStateListener(ILspEditingStateListener aListener)
      Removes an ILspEditingStateListener from this ILspInteractivePaintableLayer.
      Parameters:
      aListener - the ILspEditingStateListener to be removed.
    • query

      <T> T query(ALspPaintQuery<T> aQuery, TLspContext aContext)
      Retrieves a set of domain objects and data based on the parameters given by the query.
      Type Parameters:
      T - the type of the return value of ALspPaintQuery.getResult()
      Parameters:
      aQuery - the query
      aContext - the context
      Returns:
      the value returned by ALspPaintQuery.getResult() after processing is finished
      Throws:
      UnsupportedOperationException - if an aspect of the query is not supported by this layer