yext.export.io
Class OutputHandler

java.lang.Object
  extended by y.io.IOHandler
      extended by yext.export.io.OutputHandler
Direct Known Subclasses:
EMFOutputHandler, EPSOutputHandler, PDFOutputHandler, SWFOutputHandler

public abstract class OutputHandler
extends IOHandler

Base class for all vector graphics generating IOHandler implementations provided by yExport.

 

Method Summary
 void addRenderingHint(RenderingHints.Key key, Object value)
          Adds a rendering hint key-value-pair, that is passed to the underlying rendering subsystem.
 boolean canRead()
          Returns false, since this IOHandler can only export files.
 boolean canWrite()
          Returns true.
 Graph2DView createDefaultGraph2DView(Graph2D graph)
          Creates the default view used as rendering context of this output handler in case there is no current view associated with the graph.
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.
 String getCreator()
          Returns the name of the application which uses this OutputHandler.
 String getFileFormatString()
          Returns a descriptive string of the supported file format
 void read(Graph2D graph, InputStream in)
          Unsupported Operation.
 void removeRenderingHint(RenderingHints.Key key)
          Removes a rendering hint key-value-pair, so that it is no longer passed to the underlying rendering subsystem.
 void setCreator(String creator)
          Specifies the name of the application which uses this OutputHandler.
 void write(Graph2D graph, OutputStream out)
          Writes the contents of the given graph to a stream
 
Methods inherited from class y.io.IOHandler
canWriteSubset, createObjectInputStream, createObjectOutputStream, 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
 

Method Detail

getFileFormatString

public String getFileFormatString()
Returns a descriptive string of the supported file format

Specified by:
getFileFormatString in class IOHandler

canRead

public boolean canRead()
Returns false, since this IOHandler can only export files.

Overrides:
canRead in class IOHandler

canWrite

public boolean canWrite()
Returns true.

Overrides:
canWrite in class IOHandler

read

public void read(Graph2D graph,
                 InputStream in)
          throws IOException
Unsupported Operation.

Specified by:
read in class IOHandler
Throws:
IOException

write

public void write(Graph2D graph,
                  OutputStream out)
           throws IOException
Writes the contents of the given graph to a stream

Specified by:
write in class IOHandler
Throws:
IOException

createGraphicsContext

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. This implementation sets the GraphicsContext.isExportPainting() property to true.

Parameters:
view - the view that will be used for the painting.
g2d - the graphics object to use for the painting
Returns:
the context to register with the graphics object or null.

createDefaultGraph2DView

public Graph2DView createDefaultGraph2DView(Graph2D graph)
Creates the default view used as rendering context of this output handler in case there is no current view associated with the graph. The default view renders the graph in its original size using a white background color.

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.

See Also:
Graph2D.removeView(y.view.View)

addRenderingHint

public void addRenderingHint(RenderingHints.Key key,
                             Object value)
Adds a rendering hint key-value-pair, that is passed to the underlying rendering subsystem.

Parameters:
key - the key of the hint to be set
value - the value indicating preferences for the specified hint category

removeRenderingHint

public void removeRenderingHint(RenderingHints.Key key)
Removes a rendering hint key-value-pair, so that it is no longer passed to the underlying rendering subsystem.

Parameters:
key - the key of the hint to be remove

getCreator

public String getCreator()
Returns the name of the application which uses this OutputHandler.

Returns:
the name of the application which uses this OutputHandler.

setCreator

public void setCreator(String creator)
Specifies the name of the application which uses this OutputHandler.
Some output formats can be queried for this information, e.g. Adobe® Reader® displays the creator string of a PDF file as application entry in the document properties. Defaults to yExport 1.5.

Parameters:
creator - the name of the application which uses this OutputHandler


© Copyright 2007-2015,
yWorks GmbH.
All rights reserved.