Class MapControl.Drawer
- Enclosing class:
MapControl
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
ConstructorsConstructorDescriptionDrawer()Creates a new drawer for managing all data painting requests inMapControl. -
Method Summary
Modifier and TypeMethodDescriptionvoidput(org.gvsig.fmap.mapcontrol.MapControl.PaintingRequest newPaintRequest) Sets aPaintingRequestto be attended by the worker thread of this object.voidsetShutdown(boolean isShutdown) Sets thisDrawer2's worker to finish or continue with its process.org.gvsig.fmap.mapcontrol.MapControl.PaintingRequesttake()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.
-
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
PaintingRequestto 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:
PaintingRequestthat was waiting to be attended- See Also:
-