Class TLcdGXYLspAsynchronousLayerWrapper

java.lang.Object
com.luciad.view.gxy.asynchronous.TLcdGXYAsynchronousLayerWrapper
com.luciad.view.gxy.asynchronous.lightspeed.TLcdGXYLspAsynchronousLayerWrapper
All Implemented Interfaces:
ILcdPropertyChangeSource, ILcdSelection<Object>, ILcdGXYAsynchronousLayerWrapper, ILcdGXYLayer, ILcdLayer, Serializable
Direct Known Subclasses:
TLcdGXYLspAsynchronousLayerTreeNodeWrapper

public class TLcdGXYLspAsynchronousLayerWrapper extends TLcdGXYAsynchronousLayerWrapper
Deprecated.
Lightspeed integration in GXY views is no longer supported. Instead, either use GXY components only, or switch to a Lightspeed view.
Asynchronous layer wrapper that partly delegates to a Lightspeed layer for rendering.

It behaves exactly the same as a TLcdGXYAsynchronousLayerWrapper, except that it uses a Lightspeed layer for the body representation of the layer's visualization. This can be useful when you cannot use a Lightspeed view, but you do want to speed up rendering in your ILcdGXYView, for example when painting many objects or complex visualizations such as density or hypsometry data.

The body's visualization is delegated to the given Lightspeed layer. Hence, the layer should have the same model as the original layer, and it should have an appropriate painter configured for rendering the bodies of the model's shapes. All other visualization (labels, selection) and interaction is delegated to the original ILcdGXYLayer.

This wrapper needs a special Lightspeed-capable paint queue: TLcdGXYLspAsynchronousPaintQueue. Typically it is used as follows:


   ILcdGXYLayer originalLayer = ... // original, slow GXY layer
   ILspLayer fastLayer = ...        // fast Lightspeed layer, only used for rendering
   TLcdGXYLspAsynchronousLayerWrapper wrapper = new TLcdGXYLspAsynchronousLayerWrapper( originalLayer, fastLayer );
   wrapper.setGXYAsynchronousPaintQueue( new TLcdGXYLspAsynchronousPaintQueue( map ) );
   map.addGXYLayer( wrapper );
 
Since:
2012.0
See Also:
  • Constructor Details

    • TLcdGXYLspAsynchronousLayerWrapper

      public TLcdGXYLspAsynchronousLayerWrapper(ILcdGXYLayer aDecoratedLayer, ILspLayer aLayer)
      Deprecated.
      Creates a layer decorator that delegates painting to an asynchronous paint queue. After construction, a paint queue must be set using setGXYAsynchronousPaintQueue(com.luciad.view.gxy.asynchronous.ILcdGXYAsynchronousPaintQueue) For thread safety, the given layers should operate synchronously. Hence, a TLcdGXYLspAsynchronousLayerWrapper should not wrap another ILcdGXYAsynchronousLayerWrapper.
      Parameters:
      aDecoratedLayer - a synchronous layer that will be delegated to for everything except body visualization. State changes are propagated to and from the wrapper.
      aLayer - a synchronous layer for the visualization of the shape's bodies. Wrapper state changes are propagated to this layer.
    • TLcdGXYLspAsynchronousLayerWrapper

      public TLcdGXYLspAsynchronousLayerWrapper(ILcdGXYLayer aDecoratedLayer, ILspLayer aLayer, ILcdGXYAsynchronousPaintQueue aQueue)
      Deprecated.
      Creates a layer decorator that delegates painting to an asynchronous paint queue.
      Parameters:
      aDecoratedLayer - will be delegated to for everything except body visualization.
      aLayer - layer for the visualization of the shape's bodies. Wrapper state changes are propagated to this layer.
      aQueue - the paint queue that handles the asynchronous paint calls.
  • Method Details

    • setGXYAsynchronousPaintQueue

      public void setGXYAsynchronousPaintQueue(ILcdGXYAsynchronousPaintQueue aQueue)
      Deprecated.
      Description copied from interface: ILcdGXYAsynchronousLayerWrapper
      Sets the paint queue to delegate asynchronous paint requests to. Paint queues can be shared between multiple layer wrappers. This is even advised, as each paint queue uses memory for buffering the asynchronously generated images.
      Specified by:
      setGXYAsynchronousPaintQueue in interface ILcdGXYAsynchronousLayerWrapper
      Overrides:
      setGXYAsynchronousPaintQueue in class TLcdGXYAsynchronousLayerWrapper
      Parameters:
      aQueue - the asynchronous paint queue responsible for executing the paint calls.
    • getAsynchronousGXYLayerChangeTracker

      public ILcdGXYLayerChangeTracker getAsynchronousGXYLayerChangeTracker()
      Deprecated.
      Description copied from interface: ILcdGXYAsynchronousLayerWrapper
      Returns a state change synchronizer for the wrapped layer. The changes will be applied after each asynchronous paint, using the synchronous tracker.
      Specified by:
      getAsynchronousGXYLayerChangeTracker in interface ILcdGXYAsynchronousLayerWrapper
      Overrides:
      getAsynchronousGXYLayerChangeTracker in class TLcdGXYAsynchronousLayerWrapper
      Returns:
      a synchronizer tracking changes for the wrapped layer. To protect the wrapped layer's state, the tracker should only be used in the asynchronous thread, i.e. the paint thread.
    • getLspLayer

      public ILspLayer getLspLayer()
      Deprecated.
      Returns:
      the Lightspeed layer used for the body visualization
    • invokeLaterOnGXYAndLspLayer

      public void invokeLaterOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
      Deprecated.

      Executes the given layer runnable so that the invocation does not interfere with the asynchronous painting. The invocation is executed in the asynchronous paint thread if the layer is painted asynchronously, and in the event dispatch thread otherwise. The method always returns immediately.

      The invocation should take care when waiting for another thread: if that thread in turn waits for asynchronous painting to complete, a deadlock will occur.

      To avoid concurrency problems with property change listeners, layer property changes will be fired on the event dispatch thread, not on the asynchronous paint thread.

      Parameters:
      aRunnable - the invocation to run. The invocation will pass the original Lightspeed and GXY layer.
    • invokeAndWaitOnGXYAndLspLayer

      public void invokeAndWaitOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable) throws InterruptedException
      Deprecated.
      Executes the given layer runnable so that the invocation does not interfere with the asynchronous painting. The painting is executed in the event dispatch thread. The method waits until the invocation has stopped.
      Parameters:
      aRunnable - the invocation to run. The invocation will pass the original Lightspeed and GXY layer.
      Throws:
      InterruptedException - when the thread is interrupted while waiting for the asynchronous painting to complete
    • invokeNowOnGXYAndLspLayer

      public void invokeNowOnGXYAndLspLayer(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
      Deprecated.
      Executes the given layer runnable so that the invocation does not interfere with state synchronization. The invocation is executed in the caller's thread. The method waits until the invocation has stopped. during the invocation, asynchronous painting may occur, so care is advised.
      Parameters:
      aRunnable - the invocation to run. The invocation will pass the original Lightspeed and GXY layer.
    • invokeLaterOnGXYAndLspLayerInEDT

      public void invokeLaterOnGXYAndLspLayerInEDT(ILcdGXYLspAsynchronousLayerRunnable aRunnable)
      Deprecated.
      Executes the given layer runnable so that the invocation does not interfere with the asynchronous painting. The invocation is executed in the event dispatch thread. The method always returns immediately.
      Parameters:
      aRunnable - the invocation to run. The invocation will pass the original Lightspeed and GXY layer.