net.groboclown.gui.paintpipe.v1
Class OutputPainter

java.lang.Object
  |
  +--net.groboclown.gui.paintpipe.v1.PainterThread
        |
        +--net.groboclown.gui.paintpipe.v1.OutputPainter
Direct Known Subclasses:
PipePainter

public abstract class OutputPainter
extends PainterThread

OutputPainter threads draw their images, and post them to a PaintQueue with an ImageDoneEvent, or ZDepthDoneEvent or any other PaintEvent.

In order to be more efficient, the various events should be pooled. The EventPooler class can handle such situations for the programmer. It does, however, require you to override the PainterThread.initialize() method, PainterThread.cleanup() method, and PainterThread.paintFinished(net.groboclown.gui.paintpipe.v1.PaintFinishedEvent) method in order to call the appropriate hook in the instance. Each of these should call super.<method> where appropriate.

Version:
1.0
Author:
Matt Albrecht

Inner classes inherited from class net.groboclown.gui.paintpipe.v1.PainterThread
PainterThread.PaintRunnable
 
Field Summary
private  PaintQueue outq
           
 
Fields inherited from class net.groboclown.gui.paintpipe.v1.PainterThread
frameNumber, group, isPainting, METRICS, metricsListeners, name, numberPaintAttempts, numberWaitForEvent, painter, priority, RUN_NEVER_STARTED, RUN_PAUSED, RUN_REQUESTED_PAUSE, RUN_REQUESTED_STOP, RUN_RUNNING, RUN_STOPPED, runState, sentPaintFinishedEvent, startTimeMillis, syncThis, totalPaintTimeMillis, totalWaitForEventTimeMillis
 
Constructor Summary
OutputPainter()
          Creates a new OutputPainter with a new PaintQueue.
OutputPainter(PaintQueue queue)
          Creates a new OutputPainter, using the given queue as the output queue for all events fired.
 
Method Summary
protected  void firePaintEvent(PaintEvent pe)
          Subclasses should use this method to send off various events to the listening side of the queue.
 PaintQueue getOutputQueue()
          Returns the queue used to send output events to.
 
Methods inherited from class net.groboclown.gui.paintpipe.v1.PainterThread
addMetricsListener, canPause, canStop, cleanup, fireMetricsPaint, fireMetricsWait, getFrameNumber, getNumberPaintCalls, getNumberWaitForEventTimes, getStartTimeMillis, getTotalPaintTimeMillis, getTotalWaitForEventTimeMillis, initialize, isAlive, isInterrupted, isRunning, isStopImpending, isStopping, isSuspended, isWaitingForEvent, join, killPainting, paint, paintFinished, removeMetricsListener, resume, start, stop, stopInterrupt, stopInterruptJoin, stopJoin, suspend, suspendInterrupt
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

outq

private PaintQueue outq
Constructor Detail

OutputPainter

public OutputPainter()
Creates a new OutputPainter with a new PaintQueue.

OutputPainter

public OutputPainter(PaintQueue queue)
Creates a new OutputPainter, using the given queue as the output queue for all events fired.
Parameters:
queue - the queue to send output events to.
Method Detail

getOutputQueue

public PaintQueue getOutputQueue()
Returns the queue used to send output events to.

firePaintEvent

protected void firePaintEvent(PaintEvent pe)
Subclasses should use this method to send off various events to the listening side of the queue.

If events are being pooled, be careful of this method. When you send a pooled event to someone else on the queue, they may save the event object for later use. You can only reuse an event object safely after a PaintFinishedEvent is recieved.

Parameters:
pe - the event to send to the queue listener (if any).


Written under the LGPL