ch.unizh.ini.caviar.retina
Class CommThread

java.lang.Object
  extended by java.lang.Thread
      extended by ch.unizh.ini.caviar.retina.CommThread
All Implemented Interfaces:
java.lang.Runnable

public class CommThread
extends java.lang.Thread

receives AE from retina and paints the images


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 java.awt.Component display
           
 java.awt.Graphics g
           
 int[] histogram
           
 java.awt.Image img
           
 java.awt.image.MemoryImageSource imgsrc
           
 int[] pixels
           
 java.awt.Component topFrame
           
 double zoomLevel
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void clearImage()
           
 int getScale()
           
 boolean isAutoscaleEnabled()
           
 boolean isColorEnabled()
           
 void run()
          run method.
 void setAutoscaleEnabled(boolean autoscaleEnabled)
           
 void setColorEnabled(boolean colorEnabled)
           
 void setScale(int scale)
           
 void stopExecution()
           
 void updateImage()
          makes a new MemoryImageSource using the pixels, then creates an image with that imagesource.
 void zoom(double level)
          zooms image
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

img

public java.awt.Image img

imgsrc

public java.awt.image.MemoryImageSource imgsrc

display

public java.awt.Component display

topFrame

public java.awt.Component topFrame

pixels

public int[] pixels

histogram

public int[] histogram

g

public java.awt.Graphics g

zoomLevel

public double zoomLevel
Method Detail

zoom

public void zoom(double level)
zooms image

Parameters:
level - zoom factor

stopExecution

public void stopExecution()

clearImage

public void clearImage()

updateImage

public void updateImage()
makes a new MemoryImageSource using the pixels, then creates an image with that imagesource. ( or with a scaled copy). called by display().


run

public void run()
run method. loops until stop is true, acquiring events into a histogram. Actual painting of the histogram is done in the graphics context. Histogram is only rendered into frame when sufficient events have been accumulated.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

isColorEnabled

public boolean isColorEnabled()

setColorEnabled

public void setColorEnabled(boolean colorEnabled)

getScale

public int getScale()

setScale

public void setScale(int scale)

isAutoscaleEnabled

public boolean isAutoscaleEnabled()

setAutoscaleEnabled

public void setAutoscaleEnabled(boolean autoscaleEnabled)