org.freehep.graphicsio
Class ImageGraphics2D
java.lang.Object
java.awt.Graphics
java.awt.Graphics2D
org.freehep.graphics2d.VectorGraphics
org.freehep.graphics2d.AbstractVectorGraphics
org.freehep.graphics2d.PixelGraphics2D
org.freehep.graphicsio.ImageGraphics2D
- All Implemented Interfaces:
- VectorGraphicsConstants
- Direct Known Subclasses:
- GIFGraphics2D
- public class ImageGraphics2D
- extends PixelGraphics2D
Generic class for generating bitmap outputs from an image.
- Version:
- $Id: ImageGraphics2D.java,v 1.14 2003/06/05 09:10:46 duns Exp $
- Author:
- Mark Donszelmann
- Source Code:
- ImageGraphics2D.java
Fields inherited from interface org.freehep.graphics2d.VectorGraphicsConstants |
NUMBER_OF_HORIZ_ALIGNMENTS, NUMBER_OF_SYMBOLS, NUMBER_OF_VERTICAL_ALIGNMENTS, SYMBOL_BOX, SYMBOL_CIRCLE, SYMBOL_CROSS, SYMBOL_DIAMOND, SYMBOL_DN_TRIANGLE, SYMBOL_HLINE, SYMBOL_PLUS, SYMBOL_STAR, SYMBOL_UP_TRIANGLE, SYMBOL_VLINE, TEXT_BASELINE, TEXT_BOTTOM, TEXT_CENTER, TEXT_LEFT, TEXT_RIGHT, TEXT_TOP |
Method Summary |
static boolean |
canWriteTransparent(String format)
|
static boolean |
canWriteUncompressed(String format)
|
void |
closeStream()
|
Graphics |
create()
|
Graphics |
create(double x,
double y,
double width,
double height)
|
static BufferedImage |
createBufferedImage(String format,
int width,
int height)
|
void |
endExport()
|
static BufferedImage |
generateThumbnail(Component component,
Dimension size)
|
static Properties |
getDefaultProperties(String format)
|
static ImageWriter |
getPreferredImageWriter(String format)
|
static ImageWriter |
getPreferredImageWriterForMIMEType(String mimeType)
|
protected void |
handleException(Exception exception)
Handles an exception which has been caught. |
static BufferedImage |
readImage(String format,
InputStream is)
|
void |
setProperties(Properties newProperties)
|
void |
startExport()
|
protected void |
write()
|
static void |
writeImage(Image image,
String format,
Properties properties,
OutputStream os)
|
static void |
writeImage(RenderedImage image,
String format,
Properties properties,
OutputStream os)
|
Methods inherited from class org.freehep.graphics2d.PixelGraphics2D |
addRenderingHints, clearRect, clearRect, clip, clipRect, clipRect, copyArea, createShape, dispose, draw, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolygon, drawPolyline, drawRect, drawRenderableImage, drawRenderedImage, drawString, drawString, drawString, drawString, drawString, drawString, drawString, drawString, drawSymbol, fill, fillAndDrawSymbol, fillArc, fillOval, fillPolygon, fillPolygon, fillRect, fillSymbol, getClip, getClipBounds, getClipBounds, getComposite, getDeviceConfiguration, getFontMetrics, getFontRenderContext, getRenderingHint, getRenderingHints, getStroke, getTransform, hit, isDisplayLocal, isDisplayX11, printComment, rotate, rotate, scale, setBackground, setClip, setClip, setClip, setColor, setComposite, setFont, setHostGraphics, setLineWidth, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, setXORMode, shear, toString, transform, translate, translate |
Methods inherited from class org.freehep.graphics2d.AbstractVectorGraphics |
createShape, drawArc, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawRoundRect, drawString, drawString, drawSymbol, drawSymbol, fillAndDraw, fillAndDrawSymbol, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, fillRoundRect, fillSymbol, fillSymbol, getBackground, getColor, getColorMode, getCreator, getFont, getPaint, getPrintColor, getProperties, getProperty, getPropertyColor, getPropertyDimension, getPropertyDouble, getPropertyInsets, getPropertyInt, getPropertyRectangle, initProperties, isDeviceIndependent, isProperty, setColorMode, setCreator, setDeviceIndependent, setLineWidth |
rootKey
public static final String rootKey
- See Also:
- Constant Field Values
TRANSPARENT
public static final String TRANSPARENT
- See Also:
- Constant Field Values
BACKGROUND
public static final String BACKGROUND
- See Also:
- Constant Field Values
BACKGROUND_COLOR
public static final String BACKGROUND_COLOR
- See Also:
- Constant Field Values
ANTIALIAS
public static final String ANTIALIAS
- See Also:
- Constant Field Values
ANTIALIAS_TEXT
public static final String ANTIALIAS_TEXT
- See Also:
- Constant Field Values
PROGRESSIVE
public static final String PROGRESSIVE
- See Also:
- Constant Field Values
COMPRESS
public static final String COMPRESS
- See Also:
- Constant Field Values
COMPRESS_MODE
public static final String COMPRESS_MODE
- See Also:
- Constant Field Values
COMPRESS_DESCRIPTION
public static final String COMPRESS_DESCRIPTION
- See Also:
- Constant Field Values
COMPRESS_QUALITY
public static final String COMPRESS_QUALITY
- See Also:
- Constant Field Values
os
protected OutputStream os
image
protected BufferedImage image
format
protected String format
component
protected Component component
ImageGraphics2D
public ImageGraphics2D(File file,
Dimension size,
String format)
throws FileNotFoundException
ImageGraphics2D
public ImageGraphics2D(File file,
Component component,
String format)
throws FileNotFoundException
ImageGraphics2D
public ImageGraphics2D(OutputStream os,
Dimension size,
String format)
ImageGraphics2D
public ImageGraphics2D(OutputStream os,
Component component,
String format)
ImageGraphics2D
protected ImageGraphics2D(ImageGraphics2D graphics)
getDefaultProperties
public static Properties getDefaultProperties(String format)
setProperties
public void setProperties(Properties newProperties)
- Overrides:
setProperties
in class AbstractVectorGraphics
create
public Graphics create()
- Overrides:
create
in class PixelGraphics2D
create
public Graphics create(double x,
double y,
double width,
double height)
- Overrides:
create
in class PixelGraphics2D
startExport
public void startExport()
- Overrides:
startExport
in class PixelGraphics2D
endExport
public void endExport()
- Overrides:
endExport
in class PixelGraphics2D
write
protected void write()
throws IOException
- Throws:
IOException
closeStream
public void closeStream()
throws IOException
- Throws:
IOException
handleException
protected void handleException(Exception exception)
- Handles an exception which has been caught. Dispatches
exception to writeWarning for UnsupportedOperationExceptions
and writeError for others
- Parameters:
exception
- to be handled
createBufferedImage
public static BufferedImage createBufferedImage(String format,
int width,
int height)
generateThumbnail
public static BufferedImage generateThumbnail(Component component,
Dimension size)
writeImage
public static void writeImage(Image image,
String format,
Properties properties,
OutputStream os)
throws IOException
- Throws:
IOException
writeImage
public static void writeImage(RenderedImage image,
String format,
Properties properties,
OutputStream os)
throws IOException
- Throws:
IOException
getPreferredImageWriter
public static ImageWriter getPreferredImageWriter(String format)
getPreferredImageWriterForMIMEType
public static ImageWriter getPreferredImageWriterForMIMEType(String mimeType)
readImage
public static BufferedImage readImage(String format,
InputStream is)
throws IOException
- Throws:
IOException
canWriteUncompressed
public static boolean canWriteUncompressed(String format)
canWriteTransparent
public static boolean canWriteTransparent(String format)
Copyright © 2000-2004 FreeHEP, All Rights Reserved.