public class RasterizedAdaptor extends GraphicsAdaptor
GraphicsAdaptor
for rasterized formats, namely PNG or JPEG.Modifier and Type | Field and Description |
---|---|
protected Graphics2D |
graphics
The graphics object used for plotting
|
Constructor and Description |
---|
RasterizedAdaptor(String type)
Creates a new
RasterizedAdaptor for different formats. |
Modifier and Type | Method and Description |
---|---|
void |
generateOutput(File file)
Generates the outputs and saves the results to the supplied file.
|
Graphics2D |
getGraphics(int width,
int height)
Returns a
Graphics2D object for this GraphicsAdaptor of the given width and height. |
String |
getGraphicsExtension()
Returns the file extension for the graphics file format of this
GraphicsAdaptor . |
BufferedImage |
getImage()
Returns the internal image as a
BufferedImage |
generateOutput
protected Graphics2D graphics
public RasterizedAdaptor(String type)
RasterizedAdaptor
for different formats.
Currently, PNG and JPEG are supportedtype
- "png" or "jpg"public Graphics2D getGraphics(int width, int height)
GraphicsAdaptor
Graphics2D
object for this GraphicsAdaptor
of the given width and height.
This object may be used for plotting using the standard Graphics2D
methods.getGraphics
in class GraphicsAdaptor
width
- the widthheight
- the heightGraphics2D
objectpublic void generateOutput(File file) throws IOException
GraphicsAdaptor
generateOutput
in class GraphicsAdaptor
file
- the fileIOException
- if the output could not be writtenpublic String getGraphicsExtension()
GraphicsAdaptor
GraphicsAdaptor
.getGraphicsExtension
in class GraphicsAdaptor
public BufferedImage getImage()
BufferedImage