Class PrintUtils
java.lang.Object
org.eclipse.nebula.widgets.ganttchart.print.PrintUtils
public class PrintUtils
extends java.lang.Object
Helper class for computations regarding printing of GanttCharts.
-
Field Summary
Fields Modifier and Type Field Description static int
FOOTER_HEIGHT_IN_PRINTER_DPI
The height of the footer on a print page. -
Constructor Summary
Constructors Constructor Description PrintUtils()
-
Method Summary
Modifier and Type Method Description static org.eclipse.swt.graphics.Rectangle
computePrintArea(org.eclipse.swt.printing.Printer printer)
Computes the print area, including marginsstatic org.eclipse.swt.graphics.Point
computeScaleFactor(org.eclipse.swt.printing.Printer printer)
static org.eclipse.swt.graphics.Point
getPageCount(org.eclipse.swt.printing.Printer printer, org.eclipse.swt.graphics.Image image)
Calculate number of horizontal and vertical pages needed to print the given image of the chart.static org.eclipse.swt.graphics.Rectangle
getVisibleGanttChartArea(org.eclipse.swt.graphics.Image image)
-
Field Details
-
FOOTER_HEIGHT_IN_PRINTER_DPI
public static final int FOOTER_HEIGHT_IN_PRINTER_DPIThe height of the footer on a print page.- See Also:
- Constant Field Values
-
-
Constructor Details
-
PrintUtils
public PrintUtils()
-
-
Method Details
-
computePrintArea
public static org.eclipse.swt.graphics.Rectangle computePrintArea(org.eclipse.swt.printing.Printer printer)Computes the print area, including margins- Parameters:
printer
- The printer that will be used to print the chart- Returns:
- The print area
-
computeScaleFactor
public static org.eclipse.swt.graphics.Point computeScaleFactor(org.eclipse.swt.printing.Printer printer)- Parameters:
printer
- The printer that will be used to print the chart- Returns:
- Amount to scale the screen resolution by, to match the printer resolution.
-
getPageCount
public static org.eclipse.swt.graphics.Point getPageCount(org.eclipse.swt.printing.Printer printer, org.eclipse.swt.graphics.Image image)Calculate number of horizontal and vertical pages needed to print the given image of the chart.- Parameters:
printer
- The printer that will be used to print the chartimage
- The image of the chart that should be printed.- Returns:
- The number of horizontal and vertical pages that will be printed.
-
getVisibleGanttChartArea
public static org.eclipse.swt.graphics.Rectangle getVisibleGanttChartArea(org.eclipse.swt.graphics.Image image)- Parameters:
image
- The image of the chart that should be printed.- Returns:
- The size of the image representation of the chart that should be printed.
-