org.gvsig.fmap.mapcontrol
Class MapControl.Drawer

java.lang.Object
  extended by 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
MapControl.Drawer()
           Creates a new drawer for managing all data painting requests in MapControl.
 
Method Summary
 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapControl.Drawer

public MapControl.Drawer()

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

Includes the following steps:

Method Detail

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()

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:
put(org.gvsig.fmap.mapcontrol.MapControl.PaintingRequest)


Copyright © 2004-2013 gvSIG. All Rights Reserved.