Class JPanelMousePlotter.RecordMouse
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.plotterview.JPanelMousePlotter.RecordMouse
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- JPanelMousePlotter
class JPanelMousePlotter.RecordMouse extends java.lang.ThreadThread that records screen capture. Must be a thread so that when taking screen captures at intervals, will know if it's an original image or not. The original flag is set by transformChanged, which listens for transform events from the canvas.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) FileAviaviFileDOCUMENT ME!(package private) intblankDOCUMENT ME!(package private) short[]bufferDOCUMENT ME!(package private) booleancancelPressedDOCUMENT ME!(package private) intcompressionDOCUMENT ME!(package private) intdataDOCUMENT ME!(package private) int[]extentsDOCUMENT ME!(package private) ModelImageimageDOCUMENT ME!(package private) java.awt.ImageimagePixDOCUMENT ME!(package private) intintervalDOCUMENT ME!(package private) javax.media.j3d.ImageComponent2DjavaImageDOCUMENT ME!(package private) int[]pixelsDOCUMENT ME!(package private) ViewJProgressBarprogressDOCUMENT ME!(package private) javax.media.j3d.RasterrasterDOCUMENT ME!(package private) booleansetDOCUMENT ME!(package private) intxDimDOCUMENT ME!(package private) intxScaleDOCUMENT ME!(package private) intyDimDOCUMENT ME!(package private) intyScaleDOCUMENT ME!(package private) intzDimDOCUMENT ME!
-
Constructor Summary
Constructors Constructor Description RecordMouse(int subSample, double frameRate, FileAvi aviFile)Constructor that sets up the variables needed for the screen capture and allocates the buffers appropriately.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcaptureScreen()Captures the canvas.voiddisposeLocal()Dispose memory.voidrun()Runs the mouse recorder.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
aviFile
FileAvi aviFile
DOCUMENT ME!
-
blank
int blank
DOCUMENT ME!
-
buffer
short[] buffer
DOCUMENT ME!
-
cancelPressed
boolean cancelPressed
DOCUMENT ME!
-
compression
int compression
DOCUMENT ME!
-
data
int data
DOCUMENT ME!
-
extents
int[] extents
DOCUMENT ME!
-
image
ModelImage image
DOCUMENT ME!
-
imagePix
java.awt.Image imagePix
DOCUMENT ME!
-
interval
int interval
DOCUMENT ME!
-
javaImage
javax.media.j3d.ImageComponent2D javaImage
DOCUMENT ME!
-
pixels
int[] pixels
DOCUMENT ME!
-
progress
ViewJProgressBar progress
DOCUMENT ME!
-
raster
javax.media.j3d.Raster raster
DOCUMENT ME!
-
set
boolean set
DOCUMENT ME!
-
xDim
int xDim
DOCUMENT ME!
-
xScale
int xScale
DOCUMENT ME!
-
yDim
int yDim
DOCUMENT ME!
-
yScale
int yScale
DOCUMENT ME!
-
zDim
int zDim
DOCUMENT ME!
-
-
Constructor Detail
-
RecordMouse
public RecordMouse(int subSample, double frameRate, FileAvi aviFile)Constructor that sets up the variables needed for the screen capture and allocates the buffers appropriately.- Parameters:
subSample- Subsample size; determines if we need to scale the image captured.frameRate- Frame rate. Determines how often we capture the images.aviFile- AVI file to write to.
-
-
Method Detail
-
disposeLocal
public void disposeLocal()
Dispose memory.
-
run
public void run()
Runs the mouse recorder. Waits for the determined interval (based on frame rate) and then checks to see if this is an original image. The original flag is set by the transformChanged function, which listens for changes in the transform from the canvas. If the transform has changed, then original is set to true, and this method knows about it because it's in a separate thread. Instead of capturing the screen on the play, this method keeps track of the transform. This is because capturing the screen would take too long and the frame rate would no longer be accurate. Then once the playing is done, this method goes through all the transforms and captures the screen or sends a blank frame.- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
captureScreen
private void captureScreen() throws java.io.IOExceptionCaptures the canvas. Saves it as an RGB image and sends it to the file avi writer.- Throws:
java.io.IOException- DOCUMENT ME!
-
-