org.faceless.pdf2.viewer2
Class Exporter

java.lang.Object
  extended by org.faceless.pdf2.viewer2.ViewerFeature
      extended by org.faceless.pdf2.viewer2.Exporter
Direct Known Subclasses:
PDFExporter, TextExporter, TIFFExporter

public abstract class Exporter
extends ViewerFeature

A type of ViewerFeature which allows PDF's to be saved in a variety of formats. It's chiefly used with the Save widget, although it can be used in other contexts if necessary.

This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.

Since:
2.10.2

Nested Class Summary
 class Exporter.ExporterTask
          This class is a LongRunningTask that can be run to save a PDF to an OutputStream.
 
Constructor Summary
Exporter(String name)
          Create a new Exporter
 
Method Summary
 JComponent getComponent()
          Return a JComponent which prompts the user for additional information after the initial save dialog.
abstract  Exporter.ExporterTask getExporter(DocumentPanel panel, PDF pdf, JComponent component, OutputStream out)
          Return a new Exporter.ExporterTask that would save a PDF
abstract  FileFilter getFileFilter()
          Get a FileFilter that matches the Files output by this Exporter
abstract  String getFileSuffix()
          Return the suffix of files normally output by this Exporter, such as "pdf", "tif", "jpg" etc.
 boolean isEnabled(PDF pdf)
          Return true if this Exporter should be available for this PDF.
 String validateComponent(JComponent comp)
          Given the component returned by getComponent(), return null if the values are valid or an error message if they're invalid.
 
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, initialize, isEnabledByDefault, setFeatureName, teardown, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Exporter

public Exporter(String name)
Create a new Exporter

Parameters:
name - the name of the feature
Method Detail

getFileFilter

public abstract FileFilter getFileFilter()
Get a FileFilter that matches the Files output by this Exporter


getFileSuffix

public abstract String getFileSuffix()
Return the suffix of files normally output by this Exporter, such as "pdf", "tif", "jpg" etc.


isEnabled

public boolean isEnabled(PDF pdf)
Return true if this Exporter should be available for this PDF. The default implementation always returns true.

Since:
2.10.3

getExporter

public abstract Exporter.ExporterTask getExporter(DocumentPanel panel,
                                                  PDF pdf,
                                                  JComponent component,
                                                  OutputStream out)
Return a new Exporter.ExporterTask that would save a PDF

Parameters:
panel - the DocumentPanel this PDF is being saved from - may be null
pdf - the PDF being saves (not null)
component - the JComponent returned by getComponent()
out - the OutputStream to write the PDF to

getComponent

public JComponent getComponent()
Return a JComponent which prompts the user for additional information after the initial save dialog. An example might be when saving to a bitmap format - this component could prompt for image resolution and so on. If this method returns null (the default), then no additional component will be displayed on save.


validateComponent

public String validateComponent(JComponent comp)
Given the component returned by getComponent(), return null if the values are valid or an error message if they're invalid.

Parameters:
comp - the Component returned by getComponent()


Copyright © 2001-2010 Big Faceless Organization