com.jme.input.action
Class KeyScreenShotAction

java.lang.Object
  extended by com.jme.input.action.InputAction
      extended by com.jme.input.action.KeyInputAction
          extended by com.jme.input.action.KeyScreenShotAction
All Implemented Interfaces:
InputActionInterface

public class KeyScreenShotAction
extends KeyInputAction

KeyScreenShotAction allows the user to press a key to take a screenshot of the current display. This screenshot is saved in the current running directory with a supplied filename.png. If no filename is supplied it is saved as screenshot.png.

Version:
$Id: KeyScreenShotAction.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell, Jack Lindamood (javadoc only)

Field Summary
 
Fields inherited from class com.jme.input.action.InputAction
speed
 
Constructor Summary
KeyScreenShotAction()
          A call to KeyScreenShotAction("screenshot")
KeyScreenShotAction(java.lang.String filename)
          Creates a screenshot action that saves to the given filename.
 
Method Summary
 java.lang.String getFilename()
          Returns the currently set filename that screenshots are saved too.
 void performAction(InputActionEvent evt)
          performAction saves the current renderer screen to the filename as an image.
 void setFilename(java.lang.String filename)
          Sets the name of the file to save screenshots too.
 
Methods inherited from class com.jme.input.action.InputAction
getSpeed, setSpeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyScreenShotAction

public KeyScreenShotAction()
A call to KeyScreenShotAction("screenshot")

See Also:
KeyScreenShotAction(java.lang.String)

KeyScreenShotAction

public KeyScreenShotAction(java.lang.String filename)
Creates a screenshot action that saves to the given filename. Usually, an extention is appended to the filename signaling the screenshot image type. The file is accessed with the File class

Parameters:
filename - The filename to save the current renderer screen to.
See Also:
File
Method Detail

performAction

public void performAction(InputActionEvent evt)
performAction saves the current renderer screen to the filename as an image.

Parameters:
evt - the event that triggered the perform action method.
See Also:
InputActionInterface.performAction(InputActionEvent)

setFilename

public void setFilename(java.lang.String filename)
Sets the name of the file to save screenshots too.

Parameters:
filename - The filename to save too.

getFilename

public java.lang.String getFilename()
Returns the currently set filename that screenshots are saved too.

Returns:
The current filename where screenshots are saved.