Class PrintPreviewTray

java.lang.Object
org.eclipse.jface.dialogs.DialogTray
de.cau.cs.kieler.klighd.ui.printing.dialog.PrintPreviewTray

public class PrintPreviewTray extends org.eclipse.jface.dialogs.DialogTray
A PrintPreview to be displayed as a dialog tray, e.g. used by KlighdPrintDialog.

The implementation is inspired by org.eclipse.gmf.runtime.diagram.ui.printing.internal.printpreview.PrintPreviewHelper of the GMF project, esp. PrintPreviewHelper.updateCompositeForNumberOfColumns(int, int).

Note: There's no method 'dispose()' or similar, since all required dispose routines are coupled to the disposal of the employed SWT widgets. Their disposal is invoked by TrayDialog#closeTray(), which is inherited by our KlighdPrintDialog.
Author:
csp, chsch
  • Field Details

    • MINIMAL_TILE_SIZE

      protected static final int MINIMAL_TILE_SIZE
      Minimal tile size.
      See Also:
    • BORDER_SIZE

      protected static final int BORDER_SIZE
      Border size.
      See Also:
    • OBSERVABLE_DELAY

      protected static final int OBSERVABLE_DELAY
      Delay (in milliseconds) of scale and pages tall/wide observables and the resize event before the preview gets updated. This prevents massive redrawings e.g. while resizing the window.
      See Also:
  • Method Details

    • createContents

      public org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
      Specified by:
      createContents in class org.eclipse.jface.dialogs.DialogTray
    • updateComposite

      public void updateComposite()
      Draw the composite centered on the body. Also calls the method to make the images and insert them into the composite.