Class PrintFigureDialog

  • All Implemented Interfaces:
    java.util.EventListener, IPrintConfiguration, org.eclipse.jface.window.IShellProvider, org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.PaintListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener

    public class PrintFigureDialog
    extends AbstractFigureSelectionDialog
    implements IPrintConfiguration, org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.PaintListener
    This is a dialog to choose positioning and scaling for a print operation.
    See Also:
    PrintFigureScaleableOperation
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jface.window.Window

        org.eclipse.jface.window.Window.IExceptionHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      PrintFigureDialog​(org.eclipse.swt.widgets.Shell shell, org.eclipse.gef.GraphicalViewer graphicalViewer, org.eclipse.swt.printing.Printer printer)
      Creates a new PrintFigureDialog.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void buttonPressed​(int buttonID)
      This method is currently not used, since "normal" user would not need it.
      int configure()
      Configures this container.
      protected void configureShell​(org.eclipse.swt.widgets.Shell newShell)  
      protected void createButtonsForButtonBar​(org.eclipse.swt.widgets.Composite parent)  
      protected org.eclipse.swt.widgets.Control createDialogArea​(org.eclipse.swt.widgets.Composite parent)  
      double getCurrentScale()  
      double getMaximumOfXYImageScaleFactors()  
      IPrintPreferences getPreferences()
      Returns the printer preferences as given through this dialog.
      org.eclipse.swt.printing.Printer getPrinter()
      Returns the Printer to be used.
      double getPrinterScaleFactor()  
      void modifyText​(org.eclipse.swt.events.ModifyEvent e)  
      protected void okPressed()
      Pops up a warning if more than WARNING_IF_MOREPAGES_THAN pages are tp be printed and sets the scaled image for later retrieval for high quality printing.
      void paintControl​(org.eclipse.swt.events.PaintEvent e)  
      void updateControls()  
      void widgetSelected​(org.eclipse.swt.events.SelectionEvent e)  
      • Methods inherited from class org.eclipse.jface.dialogs.Dialog

        applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
      • Methods inherited from class org.eclipse.jface.window.Window

        canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
      • Methods inherited from class java.lang.Object

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

      • decimalNumberFormat

        public static final java.lang.String decimalNumberFormat
        See Also:
        Constant Field Values
      • SCALE_FACTORS

        public static final double[] SCALE_FACTORS
    • Constructor Detail

      • PrintFigureDialog

        public PrintFigureDialog​(org.eclipse.swt.widgets.Shell shell,
                                 org.eclipse.gef.GraphicalViewer graphicalViewer,
                                 org.eclipse.swt.printing.Printer printer)
        Creates a new PrintFigureDialog.
        Parameters:
        shell - The Shell of this dialog.
        graphicalViewer - The GraphicalViewer, which to print.
        printer - The printer, to which to print
    • Method Detail

      • createButtonsForButtonBar

        protected void createButtonsForButtonBar​(org.eclipse.swt.widgets.Composite parent)
        Overrides:
        createButtonsForButtonBar in class org.eclipse.jface.dialogs.Dialog
      • createDialogArea

        protected org.eclipse.swt.widgets.Control createDialogArea​(org.eclipse.swt.widgets.Composite parent)
        Overrides:
        createDialogArea in class org.eclipse.jface.dialogs.Dialog
      • paintControl

        public void paintControl​(org.eclipse.swt.events.PaintEvent e)
        Specified by:
        paintControl in interface org.eclipse.swt.events.PaintListener
      • buttonPressed

        public void buttonPressed​(int buttonID)
        This method is currently not used, since "normal" user would not need it.
        Overrides:
        buttonPressed in class org.eclipse.jface.dialogs.Dialog
      • modifyText

        public void modifyText​(org.eclipse.swt.events.ModifyEvent e)
        Specified by:
        modifyText in interface org.eclipse.swt.events.ModifyListener
      • widgetSelected

        public void widgetSelected​(org.eclipse.swt.events.SelectionEvent e)
        Specified by:
        widgetSelected in interface org.eclipse.swt.events.SelectionListener
        Overrides:
        widgetSelected in class AbstractFigureSelectionDialog
      • okPressed

        protected void okPressed()
        Pops up a warning if more than WARNING_IF_MOREPAGES_THAN pages are tp be printed and sets the scaled image for later retrieval for high quality printing.
        Overrides:
        okPressed in class org.eclipse.jface.dialogs.Dialog
      • getPrinterScaleFactor

        public double getPrinterScaleFactor()
      • getCurrentScale

        public double getCurrentScale()
      • getMaximumOfXYImageScaleFactors

        public double getMaximumOfXYImageScaleFactors()
        Returns:
        maximum of scale factor for x- and y-axis as stored in _preferences.
      • configure

        public int configure()
        Description copied from interface: IPrintConfiguration
        Configures this container. May e.g. mean that a popup is presented to the user, but also simply some default values are set.
        Specified by:
        configure in interface IPrintConfiguration
        Returns:
        The return code of this operation. Anything else than 0 will be interpreted as a cancellation request.