net.groboclown.gui.timeBoundPaint.v1
Class TimeBoundPainter
java.lang.Object
|
+--net.groboclown.gui.timeBoundPaint.v1.TimeBoundPainter
- public class TimeBoundPainter
- extends Object
This class paints an image from a queue of images. Each pass
has a maximum number of items in the queue. If the maximum number of items
has not been posted to the queue and drawn to the outer image by the time
specified, then the image rendering is canceled.
When the painting is completed, an event is fired telling everyone that
the next frame is ready to be painted.
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
img
private Image img
imgG
private Graphics imgG
q
private SynchQueue q
listeners
private Vector listeners
numQueueThreads
private int numQueueThreads
maxTimePainting
private long maxTimePainting
pfe
private PaintFinishedEvent pfe
zorder
private PaintImageEvent[] zorder
width
private int width
height
private int height
lt
private LoopThread lt
transparent
private static final Color transparent
TimeBoundPainter
public TimeBoundPainter(Image img)
TimeBoundPainter
public TimeBoundPainter(Image img,
SynchQueue q)
addPaintFinishedListener
public void addPaintFinishedListener(PaintFinishedListener pfl)
removePaintFinishedListener
public void removePaintFinishedListener(PaintFinishedListener pfl)
setQueueThreadCount
public void setQueueThreadCount(int queueThreadCount)
- Sets the number of threads that post image data on the Queue.
getQueueThreadCount
public int getQueueThreadCount()
setMaxTimePainting
public void setMaxTimePainting(long millis)
- Sets the maximum amount of wait time allowed for letting each
thread post its images. Setting this value to 0 or under means
that there is no maximum wait time.
getMaxTimePainting
public long getMaxTimePainting()
startPainter
public void startPainter()
- Start the painting thread
pausePainter
public void pausePainter()
resumePainter
public void resumePainter()
stopPainter
public void stopPainter()
clearImage
protected void clearImage()
fireFinishedPainting
protected void fireFinishedPainting()
Written under the LGPL