|
||||||||||
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
Abstract base class for IOHandlers that produce image based
output formats.
The encoding process is done in two steps. First the
graph will be renderer to an image. Rendering upon an image
is done by calling method Graph2DView.paintVisibleContent(Graphics2D)
on the current view of the Graph2D. Configuring the view
influences size, viewport, background, etc. of the rendered
image.
In the second step the image is taken and encoded to the
output format.
Constructor Summary | |
protected |
ImageOutputHandler()
|
protected |
ImageOutputHandler(boolean antialias)
|
Method Summary | |
boolean |
canRead()
Returns false, since this class can't read a graph. |
Graph2DView |
createDefaultGraph2DView(Graph2D graph)
Creates the default view used as image producer in case there is no current view associated with the graph2D. |
protected abstract BufferedImage |
createImage(int width,
int height)
Creates the buffered image on which the graph will be rendered. |
protected abstract void |
encode(BufferedImage image,
OutputStream out)
Encodes the given image to the given output stream. |
boolean |
isAntialiasingEnabled()
Getter for property antialias. |
void |
read(Graph2D graph,
InputStream in)
Unsupported method. |
void |
setAntialiasingEnabled(boolean antialias)
Setter for property antialias. |
void |
write(Graph2D graph,
OutputStream out)
Writes the contents of the given graph to the image based format encoded by this class. |
Methods inherited from class y.io.IOHandler |
canWrite, canWriteSubset, createObjectInputStream, createObjectOutputStream, getFileFormatString, getFileNameExtension, 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 |
protected ImageOutputHandler()
protected ImageOutputHandler(boolean antialias)
Method Detail |
public boolean canRead()
canRead
in class IOHandler
public void read(Graph2D graph, InputStream in)
read
in class IOHandler
public void write(Graph2D graph, OutputStream out) throws IOException
write
in class IOHandler
IOException
graph
- the graph to be encoded.out
- The OutputStream being written to.protected abstract BufferedImage createImage(int width, int height)
public Graph2DView createDefaultGraph2DView(Graph2D graph)
The returned view will be automatically registered as one of the graph's views. After the returned view is not needed anymore it is advisable to remove it from the list of registered view of the given graph.
Graph2D.removeView(View)
protected abstract void encode(BufferedImage image, OutputStream out) throws IOException
IOException
public boolean isAntialiasingEnabled()
public void setAntialiasingEnabled(boolean antialias)
antialias
- New value of property antialias.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |