Class AbstractExportOutputFormat

java.lang.Object
org.jhotdraw8.draw.io.AbstractExportOutputFormat
All Implemented Interfaces:
ExportOutputFormat
Direct Known Subclasses:
BitmapExportOutputFormat, PrinterExportFormat

public abstract class AbstractExportOutputFormat extends Object implements ExportOutputFormat
AbstractExportOutputFormat.
Author:
Werner Randelshofer
  • Constructor Details

    • AbstractExportOutputFormat

      public AbstractExportOutputFormat()
  • Method Details

    • getExtension

      protected abstract String getExtension()
    • isExportDrawing

      public boolean isExportDrawing()
    • isExportPages

      public boolean isExportPages()
    • isExportSlices

      public boolean isExportSlices()
    • isExportSlices2x

      public boolean isExportSlices2x()
    • isExportSlices3x

      public boolean isExportSlices3x()
    • isResolutionIndependent

      protected abstract boolean isResolutionIndependent()
    • writePage

      protected abstract void writePage(Path file, Page page, javafx.scene.Node node, int pageCount, int pageNumber, int internalPageNumber) throws IOException
      Writes a page.
      Parameters:
      file - the output file or null
      page - the page figure
      node - the node of the drawing
      pageCount - the page count
      pageNumber - the page number
      internalPageNumber - the internal page number of the page figure
      Throws:
      IOException - if writing fails
    • writePages

      protected void writePages(@Nullable Path dir, String basename, Drawing drawing) throws IOException
      Throws:
      IOException
    • writePages

      protected void writePages(@Nullable Path dir, String basename, Drawing drawing, List<Page> pages, Map<Key<?>,Object> hints) throws IOException
      Writes all pages of the drawing.
      Parameters:
      dir - the output directory, null for print output
      basename - the basename of the pages, null for print output
      drawing - the drawing
      pages - the pages
      hints - the hints
      Throws:
      IOException - in case of failure
    • writeSlice

      protected abstract boolean writeSlice(Path file, Slice slice, javafx.scene.Node node, double dpi) throws IOException
      Writes the node to the specified file as a Slice. May destroy the state of the node in the process!
      Parameters:
      file - a file
      slice - the Slice
      node - a node
      dpi - dots per inch
      Returns:
      returns true if the state of the node was destroyed
      Throws:
      IOException - in case of failure
    • writeSlices

      protected void writeSlices(@Nullable Path dir, Drawing drawing) throws IOException
      Throws:
      IOException
    • getOptions

      public ImmutableMap<Key<?>,Object> getOptions()
      Specified by:
      getOptions in interface ExportOutputFormat
    • setOptions

      public void setOptions(ImmutableMap<Key<?>,Object> options)
      Specified by:
      setOptions in interface ExportOutputFormat