|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.IOHandler y.io.ImageOutputHandler y.io.ImageIoOutputHandler
public class ImageIoOutputHandler
This class serves as an adapter to the javax.imageio API which is available in J2RE version 1.4 and later. It can be used to adapt an ImageWriter to an ImageOutputHandler.
Constructor Summary | |
---|---|
ImageIoOutputHandler(javax.imageio.ImageWriter iWriter)
Creates a new instance of ImageIoOutputHandler using the given ImageWriter. |
Method Summary | |
---|---|
protected java.awt.image.BufferedImage |
createImage(int width,
int height)
Creates the buffered image on which the graph will be rendered. |
protected void |
encode(java.awt.image.BufferedImage image,
java.io.OutputStream out)
Encodes the given image to the given output stream. |
java.lang.String |
getFileFormatString()
Returns a descriptive string of the supported file format. |
java.lang.String |
getFileNameExtension()
Returns the file name extension of the supported file format. |
javax.imageio.ImageWriteParam |
getImageWriteParam()
Returns the current ImageWriteParam for the ImageWriter. |
javax.imageio.ImageWriter |
getImageWriter()
Returns the currently set ImageWriter instance. |
boolean |
isTransparencyEnabled()
Returns true if this image output handler uses an intermediate
image that can handle non-opaque pixels and false otherwise. |
void |
setImageWriteParam(javax.imageio.ImageWriteParam iwp)
Sets the current ImageWriteParam for the ImageWriter. |
void |
setImageWriter(javax.imageio.ImageWriter iWriter)
Sets the new ImageWriter instance. |
void |
setTransparencyEnabled(boolean enabled)
Specifies whether this image output handler uses an intermediate image that can or cannot handle non-opaque pixels. |
Methods inherited from class y.io.ImageOutputHandler |
---|
canRead, createDefaultGraph2DView, createGraphicsContext, getBorder, isAntialiasingEnabled, isSelectionPaintingEnabled, read, setAntialiasingEnabled, setBorder, setSelectionPaintingEnabled, write, write |
Methods inherited from class y.io.IOHandler |
---|
canWrite, canWriteSubset, createObjectInputStream, createObjectOutputStream, hide, read, read, shouldSerialize, shouldSerialize, write, writeSubset, writeSubset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageIoOutputHandler(javax.imageio.ImageWriter iWriter)
Method Detail |
---|
public boolean isTransparencyEnabled()
true
if this image output handler uses an intermediate
image that can handle non-opaque pixels and false
otherwise.
Defaults to false
Note: If the ImageWriter
associated to this handler
does not support transparency, the result image will only have opaque
pixels regardless of this property.
true
if this image output handler uses an intermediate
image that can handle non-opaque pixels and false
otherwise.setTransparencyEnabled(boolean)
public void setTransparencyEnabled(boolean enabled)
Defaults to false
Note: If the ImageWriter
associated to this handler
does not support transparency, the result image will only have opaque
pixels regardless of this property.
enabled
- if true
an intermediate image that can handle
non-opaque pixels is used; otherwise an intermediate image that cannot
handle non-opaque pixels is used.isTransparencyEnabled()
public void setImageWriter(javax.imageio.ImageWriter iWriter)
iWriter
- the new writer - must not be null
public javax.imageio.ImageWriter getImageWriter()
protected void encode(java.awt.image.BufferedImage image, java.io.OutputStream out) throws java.io.IOException
ImageOutputHandler
encode
in class ImageOutputHandler
java.io.IOException
- if an error occurs during writing.public java.lang.String getFileNameExtension()
IOHandler
getFileNameExtension
in class IOHandler
public java.lang.String getFileFormatString()
IOHandler
getFileFormatString
in class IOHandler
protected java.awt.image.BufferedImage createImage(int width, int height)
ImageOutputHandler
createImage
in class ImageOutputHandler
public javax.imageio.ImageWriteParam getImageWriteParam()
public void setImageWriteParam(javax.imageio.ImageWriteParam iwp)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |