|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.io.IOHandler
y.io.ImageOutputHandler
public abstract class 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 GraphicsContext |
createGraphicsContext(Graph2DView view,
Graphics2D g2d)
Factory method that creates the GraphicsContext that will be used
for the graphics object during the rendering of the image. |
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. |
void |
write(Graph2DView view,
OutputStream out)
Writes the contents of the given Graph2dView 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(y.view.Graph2DView, java.io.OutputStream).
write in class IOHandlerIOExceptiongraph - the graph to be encoded.out - The OutputStream being written to.
public void write(Graph2DView view,
OutputStream out)
throws IOException
IOExceptionview - the view whose contents should be encoded.out - The OutputStream being written to.
protected GraphicsContext createGraphicsContext(Graph2DView view,
Graphics2D g2d)
GraphicsContext that will be used
for the graphics object during the rendering of the image.
This implemenation sets the GraphicsContext.isExportPainting()
property to true.
view - the view that will be used for the painting.g2d - the graphics object to use for the painting
null.
protected abstract BufferedImage createImage(int width,
int height)
public Graph2DView createDefaultGraph2DView(Graph2D graph)
Graph2D.removeView(y.view.View)
protected abstract void encode(BufferedImage image,
OutputStream out)
throws IOException
IOExceptionpublic boolean isAntialiasingEnabled()
public void setAntialiasingEnabled(boolean antialias)
antialias - New value of property antialias.
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||