net.sf.sdedit.server
Class Exporter

java.lang.Object
  extended by net.sf.sdedit.diagram.PaintDevice
      extended by net.sf.sdedit.ui.Graphics2DPaintDevice
          extended by net.sf.sdedit.server.Exporter
All Implemented Interfaces:
Iterable<Drawable>

public abstract class Exporter
extends Graphics2DPaintDevice

An Exporter is a paint device that can redirect its output to an output stream, using one of various output formats.

Author:
Markus Strauch

Constructor Summary
protected Exporter()
           
 
Method Summary
abstract  void export()
          This method should be called when the generation of the diagram has finished and PaintDevice.computeBounds() has been called.
static Exporter getExporter(String type, String orientation, String format, OutputStream stream)
          Returns an Exporter object if the exporting library is available, otherwise null.
static boolean isAvailable()
           
protected abstract  void setOutputStream(OutputStream stream)
           
protected abstract  void setType(String type)
           
 
Methods inherited from class net.sf.sdedit.ui.Graphics2DPaintDevice
close, createDummyGraphics, createGraphics, drawAll, getTextHeight, getTextWidth
 
Methods inherited from class net.sf.sdedit.diagram.PaintDevice
addOtherDrawable, addSequenceElement, announce, clear, computeAxes, computeBounds, getColor, getDiagram, getFont, getHeight, getRightBound, getTextHeight, getTextWidth, getWidth, isEmpty, iterator, reinitialize, setDiagram, writeToStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exporter

protected Exporter()
Method Detail

isAvailable

public static boolean isAvailable()

getExporter

public static Exporter getExporter(String type,
                                   String orientation,
                                   String format,
                                   OutputStream stream)
Returns an Exporter object if the exporting library is available, otherwise null. The following output types are supported: ps, pdf, swf, emf, svg, png, gif, jpg, bmp

Parameters:
type - describes the output format
orientation - one of {Portrait,Landscape}
stream - the stream to redirect the output to
Returns:
an instance of an Exporter

setType

protected abstract void setType(String type)

setOutputStream

protected abstract void setOutputStream(OutputStream stream)

export

public abstract void export()
This method should be called when the generation of the diagram has finished and PaintDevice.computeBounds() has been called. It redirects the output to the stream set via setOutputStream(OutputStream).



Copyright © 2011. All Rights Reserved.