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.
Constructor and Description |
---|
MapControl.Drawer()
Creates a new drawer for managing all data painting requests in
MapControl . |
Modifier and Type | Method and 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 |
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. |
public MapControl.Drawer()
Creates a new drawer for managing all data painting requests in
MapControl
.
Includes the following steps:
public void setShutdown(boolean isShutdown)
Sets this Drawer2
's worker to finish or continue with
its process.
isShutdown
- a boolean valuepublic 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.
newPaintRequest
- 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.
PaintingRequest
that was waiting to be attendedput(org.gvsig.fmap.mapcontrol.MapControl.PaintingRequest)