Class MapControl.Drawer

java.lang.Object
org.gvsig.fmap.mapcontrol.MapControl.Drawer
Enclosing class:
MapControl

public class MapControl.Drawer extends Object

An instance of Drawer2 could manage all MapControl painting requests.

Based on the WorkerThread software pattern, creates a worker thread that will attend sequentially the current waiting painting request, after finishing the previous (that could be by a cancel action).

All new PaintingRequest generated will be stored as waiting requests since the worker attends it.

If a worker finished and there was no painting request, the worker would be set to wait until any painting request would be put.

Author:
fjp
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new drawer for managing all data painting requests in MapControl.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    put(org.gvsig.fmap.mapcontrol.MapControl.PaintingRequest newPaintRequest)
    Sets a PaintingRequest to be attended by the worker thread of this object.
    void
    setShutdown(boolean isShutdown)
    Sets this Drawer2's worker to finish or continue with its process.
    org.gvsig.fmap.mapcontrol.MapControl.PaintingRequest
    Used by this object's worker, returns the current waiting drawing request, causing current thread to wait until another thread invokes #put(com.iver.cit.gvsig.fmap.MapControl.PaintingRequest), if there was no waiting request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Drawer

      public Drawer()

      Creates a new drawer for managing all data painting requests in MapControl.

      Includes the following steps:

      • By default, there is no current painting request.
      • By default, there is no waiting painting request.
      • By default, the worker thread is waiting no painting request.
      • By default, the worker thread is running.
      • Creates and starts a worker thread for attending the painting requests.

  • Method Details

    • setShutdown

      public void setShutdown(boolean isShutdown)

      Sets this Drawer2's worker to finish or continue with its process.

      Parameters:
      isShutdown - a boolean value
    • put

      public void put(org.gvsig.fmap.mapcontrol.MapControl.PaintingRequest newPaintRequest)

      Sets a PaintingRequest to be attended by the worker thread of this object. If this one was waiting, wakes up.

      All waiting threads will be notified synchronized.

      Parameters:
      newPaintRequest -
      See Also:
    • take

      public org.gvsig.fmap.mapcontrol.MapControl.PaintingRequest take()

      Used by this object's worker, returns the current waiting drawing request, causing current thread to wait until another thread invokes #put(com.iver.cit.gvsig.fmap.MapControl.PaintingRequest), if there was no waiting request.

      All threads will access synchronized to the waiting request.

      Returns:
      PaintingRequest that was waiting to be attended
      See Also: