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

class JPanelMouse.RecordMouse extends Thread
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.
  • Field Details

    • 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

      Image imagePix
      DOCUMENT ME!
    • interval

      int interval
      DOCUMENT ME!
    • javaImage

      javax.media.j3d.ImageComponent2D javaImage
      DOCUMENT ME!
    • pixels

      int[] pixels
      DOCUMENT ME!
    • 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 Details

    • 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 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.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • captureScreen

      private void captureScreen() throws IOException
      Captures the canvas. Saves it as an RGB image and sends it to the file avi writer.
      Throws:
      IOException - DOCUMENT ME!