public abstract class GraphicExporter extends Object
Modifier and Type | Field and Description |
---|---|
static GraphicExporter |
EPS
Exports to Encapsulated PostScript.
|
static GraphicExporter |
EPS_GZIP
Exports to gzipped Encapsulated PostScript.
|
static GraphicExporter |
GIF
Exports to GIF format.
|
static GraphicExporter |
JPEG
Exports to JPEG format.
|
static GraphicExporter |
PNG
Exports to PNG format with a standard (currently opaque) background.
|
static GraphicExporter |
PNG_TRANSPARENT
Exports to PNG format with a transparent background.
|
static GraphicExporter |
SVG
Exports to SVG format.
|
Modifier | Constructor and Description |
---|---|
protected |
GraphicExporter(String name,
String mimeType,
boolean isVector,
String description,
String[] fileSuffixes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
exportGraphic(Picture picture,
OutputStream out)
Paints the given picture to an output stream using some graphics format
or other.
|
String |
getContentEncoding()
Returns the content encoding for the output used by this exporter.
|
String |
getDescription()
Returns a minimal description of this exporter.
|
String[] |
getFileSuffixes()
Returns an array of file suffixes which usually indicate a file with
an export format used by this instance.
|
static GraphicExporter[] |
getKnownExporters(PdfGraphicExporter pdfEx)
Returns a standard list of available GraphicExporter objects.
|
String |
getMimeType()
Returns the MIME type for the graphics format used by this exporter.
|
String |
getName()
Returns the name of this exporter (usually the graphics format name).
|
boolean |
isVector()
Indicates whether this exports to a vector or bitmapped graphics format.
|
static Picture |
toPicture(JComponent comp)
Utility method to acquire a Picture object which can paint the content
of a screen component.
|
String |
toString() |
public static final GraphicExporter JPEG
public static final GraphicExporter PNG
public static final GraphicExporter PNG_TRANSPARENT
public static final GraphicExporter GIF
public static final GraphicExporter SVG
public static final GraphicExporter EPS
public static final GraphicExporter EPS_GZIP
protected GraphicExporter(String name, String mimeType, boolean isVector, String description, String[] fileSuffixes)
name
- exporter name (usually graphics format name)mimeType
- MIME type for this exporter's output formatisVector
- true for vector formats, false for bitmappeddescription
- minimal description of format (may just be name)fileSuffixes
- file suffixes which usually indicate the
export format used by this instance (may be null)public abstract void exportGraphic(Picture picture, OutputStream out) throws IOException
picture
- picture to drawout
- destination output streamIOException
public String getName()
public String getMimeType()
public boolean isVector()
public String getDescription()
public String getContentEncoding()
public String[] getFileSuffixes()
public static Picture toPicture(JComponent comp)
comp
- screen componentpublic static GraphicExporter[] getKnownExporters(PdfGraphicExporter pdfEx)
pdfEx
- exporter for PDF graphics, or null if none requiredCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.