The Meta-Environment API

nl.cwi.sen1.visplugin.screenshotmaker
Class ScreenshotMaker

java.lang.Object
  extended by nl.cwi.sen1.visplugin.screenshotmaker.ScreenshotMaker

public class ScreenshotMaker
extends java.lang.Object

ScreenshotMaker has the functionality to export a JPanel as an image

Author:
R. Bergen, S. Tharmarajah

Field Summary
static java.lang.String DEFAULT_EXTENSION
           
static java.lang.String JPEG_EXTENSION
           
static java.lang.String PNG_EXTENSION
           
 
Constructor Summary
ScreenshotMaker()
           
 
Method Summary
private static java.awt.image.BufferedImage createImageFromPanel(javax.swing.JPanel jPanel)
          Create a BufferedImage from a given JPanel.
static void saveScreenshot(javax.swing.JPanel jPanel, java.lang.String exportDestination, java.lang.String fileExtension)
          Save a JPanel as an image to a given destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JPEG_EXTENSION

public static final java.lang.String JPEG_EXTENSION
See Also:
Constant Field Values

PNG_EXTENSION

public static final java.lang.String PNG_EXTENSION
See Also:
Constant Field Values

DEFAULT_EXTENSION

public static final java.lang.String DEFAULT_EXTENSION
See Also:
Constant Field Values
Constructor Detail

ScreenshotMaker

public ScreenshotMaker()
Method Detail

saveScreenshot

public static void saveScreenshot(javax.swing.JPanel jPanel,
                                  java.lang.String exportDestination,
                                  java.lang.String fileExtension)
Save a JPanel as an image to a given destination.

Parameters:
JPanel - The Jpanel which should be saved
exportDestination - The destination of the exported image
fileExtension - The extension of the exported image

createImageFromPanel

private static java.awt.image.BufferedImage createImageFromPanel(javax.swing.JPanel jPanel)
Create a BufferedImage from a given JPanel.

Parameters:
JPanel - The Jpanel which should be saved
Returns:
bufferedImage a BufferedImage of the given JPanel

The Meta-Environment API