com.dlsc.flexgantt.swing.print
Class PrintContext

java.lang.Object
  extended by com.dlsc.flexgantt.swing.print.PrintContext

public class PrintContext
extends java.lang.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
PrintContext()
           
 
Method Summary
 AbstractGanttChart getGanttChart()
          The Gantt chart that is being printed.
 LayerContainer getLayerContainer()
          Returns the layer container to print.
 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 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

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 java.lang.IllegalStateException
Validates whether the print context is complete (all fields set, none NULL?).

Throws:
java.lang.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