Class JPanelMouse.RecordMouse
java.lang.Object
java.lang.Thread
gov.nih.mipav.view.renderer.J3D.surfaceview.JPanelMouse.RecordMouse
- All Implemented Interfaces:
Runnable
- Enclosing class:
JPanelMouse
Thread 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescription(package private) FileAviDOCUMENT ME!(package private) intDOCUMENT ME!(package private) short[]DOCUMENT ME!(package private) booleanDOCUMENT ME!(package private) intDOCUMENT ME!(package private) intDOCUMENT ME!(package private) int[]DOCUMENT ME!(package private) ModelImageDOCUMENT ME!(package private) ImageDOCUMENT ME!(package private) intDOCUMENT ME!(package private) javax.media.j3d.ImageComponent2DDOCUMENT ME!(package private) int[]DOCUMENT ME!(package private) ViewJProgressBarDOCUMENT ME!(package private) javax.media.j3d.RasterDOCUMENT ME!(package private) booleanDOCUMENT ME!(package private) intDOCUMENT ME!(package private) intDOCUMENT ME!(package private) intDOCUMENT ME!(package private) intDOCUMENT ME!(package private) intDOCUMENT ME!Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionRecordMouse(int subSample, double frameRate, FileAvi aviFile) Constructor that sets up the variables needed for the screen capture and allocates the buffers appropriately. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidCaptures the canvas.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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
aviFile
FileAvi aviFileDOCUMENT ME! -
blank
int blankDOCUMENT ME! -
buffer
short[] bufferDOCUMENT ME! -
cancelPressed
boolean cancelPressedDOCUMENT ME! -
compression
int compressionDOCUMENT ME! -
data
int dataDOCUMENT ME! -
extents
int[] extentsDOCUMENT ME! -
image
ModelImage imageDOCUMENT ME! -
imagePix
Image imagePixDOCUMENT ME! -
interval
int intervalDOCUMENT ME! -
javaImage
javax.media.j3d.ImageComponent2D javaImageDOCUMENT ME! -
pixels
int[] pixelsDOCUMENT ME! -
progress
ViewJProgressBar progressDOCUMENT ME! -
raster
javax.media.j3d.Raster rasterDOCUMENT ME! -
set
boolean setDOCUMENT ME! -
xDim
int xDimDOCUMENT ME! -
xScale
int xScaleDOCUMENT ME! -
yDim
int yDimDOCUMENT ME! -
yScale
int yScaleDOCUMENT ME! -
zDim
int zDimDOCUMENT ME!
-
-
Constructor Details
-
RecordMouse
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 Details
-
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. -
captureScreen
Captures the canvas. Saves it as an RGB image and sends it to the file avi writer.- Throws:
IOException- DOCUMENT ME!
-