com.dlsc.flexgantt.swing.print

## Interface IPrintManager

- All Known Implementing Classes:
    AbstractPrintManager, SimpleGranularityPrintManager, TimeGranularityPrintManager

      public interface IPrintManager

  Gantt charts delegate the task of printing to print managers. They have to pass a print context to the manager so that the print routine knows which settings to copy from the original Gantt chart to a fake but printable Gantt chart (see `PrintGanttChart`).
  Since:
    1.0
  Version:
    $Revision: 1.5 $
  Author:
    Dirk Lemmermann

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `JComponent` | `createTimelineControl(Timeline timeline)` Creates the control to change the printed time span.
    `PageFormat` | `getPageFormat()` Returns the currently used page format settings.
    `PrintContext` | `getPrintContext()` Returns the print context that was passed to the print manager from the printing Gantt chart.
    `PrinterJob` | `getPrinterJob()` Returns the current printer job.
    `PrintGanttChart` | `getPrintGanttChart()` Returns the printable Gantt chart, which will copy its settings from the Gantt chart requested to be printed.
    `void` | `print(JComponent parentComponent, PrintContext ctx, boolean preview)` Invokes the print operation on the manager.
    `void` | `setPageFormat(PageFormat format)` Specifies the page format settings to use.

- - ### Method Detail

    - #### print

          void print(JComponent parentComponent,
                     PrintContext ctx,
                     boolean preview)
              throws DatelineModelException

      Invokes the print operation on the manager.
      Parameters:
        `parentComponent` - the UI component from which printing was triggered (needed for hooking up the preview dialog)
        `ctx` - the printing context (depends on the Gantt chart, the dual Gantt chart has two different contexts, the upper and the lower part)
        `preview` - a flag signalling whether a preview dialog has to be shown before printing
      Throws:
        `DatelineModelException`
      Since:
        1.0

    - #### getPrinterJob

          PrinterJob getPrinterJob()

      Returns the current printer job. This method can only be invoked after the print method has been called.
      Returns:
        the current printer job
      Since:
        1.0

    - #### getPageFormat

          PageFormat getPageFormat()

      Returns the currently used page format settings.
      Returns:
        the page format settings
      Since:
        1.0

    - #### setPageFormat

          void setPageFormat(PageFormat format)

      Specifies the page format settings to use. The preview dialog might have changed them via the printer setup or page setup dialog.
      Parameters:
        `format` - the page format settings
      Since:
        1.0

    - #### getPrintContext

          PrintContext getPrintContext()

      Returns the print context that was passed to the print manager from the printing Gantt chart. A print context is needed so that the printable Gantt chart (a Gantt chart instance managed by the preview dialog) knows from where to copy the various settings.
      Returns:
        the print context used for the preview dialog
      Since:
        1.0

    - #### getPrintGanttChart

          PrintGanttChart getPrintGanttChart()

      Returns the printable Gantt chart, which will copy its settings from the Gantt chart requested to be printed.
      Returns:
        a Gantt chart used for printing
      Since:
        1.0

    - #### createTimelineControl

          JComponent createTimelineControl(Timeline timeline)

      Creates the control to change the printed time span. This control depends on the currently used dateline model.
      Parameters:
        `timeline` - the timeline that will be managed by the controls
      Returns:
        an arbitrary component for editing the time span of the timeline
      Since:
        1.0

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.