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
Author:
Dirk Lemmermann

Method Summary
 javax.swing.JComponent createTimelineControl(Timeline timeline)
          Creates the control to change the printed time span.
 java.awt.print.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.
 java.awt.print.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(javax.swing.JComponent parentComponent, PrintContext ctx, boolean preview)
          Invokes the print operation on the manager.
 void setPageFormat(java.awt.print.PageFormat format)
          Specifies the page format settings to use.
 

Method Detail

print

void print(javax.swing.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

java.awt.print.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

java.awt.print.PageFormat getPageFormat()
Returns the currently used page format settings.

Returns:
the page format settings
Since:
1.0

setPageFormat

void setPageFormat(java.awt.print.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

javax.swing.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