com.dlsc.flexgantt.swing.print

## Class PrintContext

- java.lang.Object
- - com.dlsc.flexgantt.swing.print.PrintContext

-     public class PrintContext
      extends Object

  A print context wraps all those Gantt chart components that are needed by the preview dialog to setup its internally used printable Gantt chart so that it uses the same settings as these components. The standard `GanttChart` always returns the same components when asked to print but the more complex `DualGanttChart` might return the upper (the primary) or the lower (the secondary) components.
  Since:
    1.0
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PrintContext()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PrintGanttChart` | `createPrintableGanttChart()` Constructs a printable Gantt chart.
    `AbstractGanttChart` | `getGanttChart()` The Gantt chart that is being printed.
    `LayerContainer` | `getLayerContainer()` Returns the layer container to print.
    `PrintSetup` | `getPrintSetup()` Returns the print setup object containing information about the header and footer setup.
    `TreeTableRowHeader` | `getRowHeader()` Returns the row header to print.
    `Timeline` | `getTimeline()` Returns the timeline to print.
    `ITimeSpan` | `getTimeSpan()` Returns the time span that needs to be printed.
    `TreeTable` | `getTreeTable()` Returns the tree table to print.
    `TreeTableHeader` | `getTreeTableHeader()` Returns the tree table header to print.
    `void` | `setGanttChart(AbstractGanttChart ganttChart)` Sets the Gantt chart that is being printed.
    `void` | `setLayerContainer(LayerContainer layerContainer)` Sets the layer container to print.
    `void` | `setPrintSetup(PrintSetup setup)` The setup object containing the information for the header and footer.
    `void` | `setRowHeader(TreeTableRowHeader rowHeader)` Sets the row header to print.
    `void` | `setTimeline(Timeline timeline)` Sets the timeline to print.
    `void` | `setTimeSpan(ITimeSpan span)` Returns the time span that needs to be printed.
    `void` | `setTreeTable(TreeTable treeTable)` Sets the tree table to print.
    `void` | `setTreeTableHeader(TreeTableHeader treeTableHeder)` Sets the tree table header to print.
    `void` | `validate()` Validates whether the print context is complete (all fields set, none NULL?).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PrintContext

          public PrintContext()

  - ### Method Detail

    - #### setPrintSetup

          public void setPrintSetup(PrintSetup setup)

      The setup object containing the information for the header and footer.
      Parameters:
        `setup` - the print setup information
      Since:
        2.1

    - #### getPrintSetup

          public PrintSetup getPrintSetup()

      Returns the print setup object containing information about the header and footer setup.
      Returns:
        the print setup object
      Since:
        2.1

    - #### getGanttChart

          public AbstractGanttChart getGanttChart()

      The Gantt chart that is being printed.
      Returns:
        the printing Gantt chart
      Since:
        1.0

    - #### setGanttChart

          public void setGanttChart(AbstractGanttChart ganttChart)

      Sets the Gantt chart that is being printed.
      Parameters:
        `ganttChart` - the ganttChart that is being printed
      Since:
        1.0

    - #### getLayerContainer

          public LayerContainer getLayerContainer()

      Returns the layer container to print.
      Returns:
        the layer container to print
      Since:
        1.0

    - #### setLayerContainer

          public void setLayerContainer(LayerContainer layerContainer)

      Sets the layer container to print.
      Parameters:
        `layerContainer` - the layerContainer to print
      Since:
        1.0

    - #### getRowHeader

          public TreeTableRowHeader getRowHeader()

      Returns the row header to print.
      Returns:
        the row header to print
      Since:
        1.0

    - #### setRowHeader

          public void setRowHeader(TreeTableRowHeader rowHeader)

      Sets the row header to print.
      Parameters:
        `rowHeader` - the row header to print
      Since:
        1.0

    - #### getTimeline

          public Timeline getTimeline()

      Returns the timeline to print.
      Returns:
        the timeline to print
      Since:
        1.0

    - #### setTimeline

          public void setTimeline(Timeline timeline)

      Sets the timeline to print.
      Parameters:
        `timeline` - the timeline to print
      Since:
        1.0

    - #### getTreeTable

          public TreeTable getTreeTable()

      Returns the tree table to print.
      Returns:
        the tree table to print
      Since:
        1.0

    - #### setTreeTable

          public void setTreeTable(TreeTable treeTable)

      Sets the tree table to print.
      Parameters:
        `treeTable` - the tree table to print
      Since:
        1.0

    - #### getTreeTableHeader

          public TreeTableHeader getTreeTableHeader()

      Returns the tree table header to print.
      Returns:
        the tree table header to print
      Since:
        1.0

    - #### setTreeTableHeader

          public void setTreeTableHeader(TreeTableHeader treeTableHeder)

      Sets the tree table header to print.
      Parameters:
        `treeTableHeder` - the tree table header to print
      Since:
        1.0

    - #### validate

          public void validate()
                        throws IllegalStateException

      Validates whether the print context is complete (all fields set, none NULL?).
      Throws:
        `IllegalStateException` - if a field is missing
      Since:
        1.0

    - #### getTimeSpan

          public ITimeSpan getTimeSpan()

      Returns the time span that needs to be printed.
      Returns:
        the time span to print
      Since:
        1.0

    - #### setTimeSpan

          public void setTimeSpan(ITimeSpan span)

      Returns the time span that needs to be printed.
      Parameters:
        `span` - the time span to print
      Since:
        1.0

    - #### createPrintableGanttChart

          public PrintGanttChart createPrintableGanttChart()

      Constructs a printable Gantt chart. This method delegates to `AbstractGanttChart.createPrintableGanttChart(PrintContext)`.
      Returns:
        a printable Gantt Chart
      Since:
        1.1

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