net.jinx.video.processor
Class ScreenShotProcessor

java.lang.Object
  extended by net.jinx.video.processor.ImageSaver
      extended by net.jinx.video.processor.ScreenShotProcessor
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener, FrameProcessor

public class ScreenShotProcessor
extends ImageSaver
implements java.awt.event.KeyListener

ImageSaver extension modified to save images only when a key has been pressed.

API Stability: Stable.


Constructor Summary
ScreenShotProcessor(java.io.File dir, java.lang.String format)
           
ScreenShotProcessor(java.io.File dir, java.lang.String format, int imageType)
           
ScreenShotProcessor(java.lang.String dir, java.lang.String format)
           
ScreenShotProcessor(java.lang.String dir, java.lang.String format, int imageType)
           
 
Method Summary
 void keyPressed(java.awt.event.KeyEvent e)
          If the currently set key has been pressed, this signals that the next frame should be saved.
 void keyReleased(java.awt.event.KeyEvent e)
          Does nothing.
 void keyTyped(java.awt.event.KeyEvent e)
          Does nothing.
 void setKey(int key)
          Sets the key to listen for.
protected  boolean shouldProcess()
          Returns true if the key specified by setKey(int) has been detected and the frame has not yet been processed.
 
Methods inherited from class net.jinx.video.processor.ImageSaver
canProcess, deinit, init, nextFile, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenShotProcessor

public ScreenShotProcessor(java.lang.String dir,
                           java.lang.String format,
                           int imageType)

ScreenShotProcessor

public ScreenShotProcessor(java.lang.String dir,
                           java.lang.String format)

ScreenShotProcessor

public ScreenShotProcessor(java.io.File dir,
                           java.lang.String format)

ScreenShotProcessor

public ScreenShotProcessor(java.io.File dir,
                           java.lang.String format,
                           int imageType)
Method Detail

shouldProcess

protected boolean shouldProcess()
Returns true if the key specified by setKey(int) has been detected and the frame has not yet been processed. This method also resets the internal flag it checks to false.

Overrides:
shouldProcess in class ImageSaver
Returns:
true if the current frame should be processed.

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Does nothing.

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
If the currently set key has been pressed, this signals that the next frame should be saved.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
e - the KeyEvent.

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Does nothing.

Specified by:
keyReleased in interface java.awt.event.KeyListener

setKey

public void setKey(int key)
Sets the key to listen for.

Parameters:
key - the key code to listen for. This should be one of the VK_* constants from java.awt.event.KeyEvent.