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 margins
    static 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)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • 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 chart
      image - 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.