org.jzy3d.chart.controllers.keyboard.camera
Class ScreenshotKeyListener

java.lang.Object
  extended by org.jzy3d.chart.controllers.keyboard.camera.ScreenshotKeyListener
All Implemented Interfaces:
KeyListener, EventListener

public class ScreenshotKeyListener
extends Object
implements KeyListener

Saves a screenshot in PNG format once key S is pressed.


Nested Class Summary
static interface ScreenshotKeyListener.IScreenshotEventListener
           
 
Field Summary
protected  Chart chart
           
protected  List<ScreenshotKeyListener.IScreenshotEventListener> listeners
           
protected  String outputFile
           
 
Constructor Summary
ScreenshotKeyListener(Chart chart, String outputFile)
           
 
Method Summary
 void addListener(ScreenshotKeyListener.IScreenshotEventListener listener)
           
protected  void fireDone(String file)
           
protected  void fireError(String file, Exception e)
           
 void keyPressed(KeyEvent e)
           
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent e)
           
 void screenshot(Chart chart, String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chart

protected Chart chart

outputFile

protected String outputFile

listeners

protected List<ScreenshotKeyListener.IScreenshotEventListener> listeners
Constructor Detail

ScreenshotKeyListener

public ScreenshotKeyListener(Chart chart,
                             String outputFile)
Method Detail

keyTyped

public void keyTyped(KeyEvent e)
Specified by:
keyTyped in interface KeyListener

screenshot

public void screenshot(Chart chart,
                       String filename)
                throws IOException
Throws:
IOException

keyReleased

public void keyReleased(KeyEvent e)
Specified by:
keyReleased in interface KeyListener

keyPressed

public void keyPressed(KeyEvent e)
Specified by:
keyPressed in interface KeyListener

fireDone

protected void fireDone(String file)

addListener

public void addListener(ScreenshotKeyListener.IScreenshotEventListener listener)

fireError

protected void fireError(String file,
                         Exception e)