Class PrintFigureDialog
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.graphiti.ui.internal.util.ui.print.AbstractFigureSelectionDialog
org.eclipse.graphiti.ui.internal.util.ui.print.PrintFigureDialog
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
-
Field Summary
Fields inherited from class org.eclipse.graphiti.ui.internal.util.ui.print.AbstractFigureSelectionDialog
_allFigure, _figure, _graphicalViewer, _image, _insideInternalModify, _preferences, _selectionFigure
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred
Fields inherited from interface org.eclipse.graphiti.ui.print.IPrintConfiguration
OK
-
Constructor Summary
ConstructorDescriptionPrintFigureDialog
(org.eclipse.swt.widgets.Shell shell, org.eclipse.gef.GraphicalViewer graphicalViewer, org.eclipse.swt.printing.Printer printer) Creates a new PrintFigureDialog. -
Method Summary
Modifier and TypeMethodDescriptionvoid
buttonPressed
(int buttonID) This method is currently not used, since "normal" user would not need it.int
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
double
Returns the printer preferences as given through this dialog.org.eclipse.swt.printing.Printer
Returns thePrinter
to be used.double
void
modifyText
(org.eclipse.swt.events.ModifyEvent e) protected void
Pops up a warning if more thanWARNING_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
void
widgetSelected
(org.eclipse.swt.events.SelectionEvent e) Methods inherited from class org.eclipse.graphiti.ui.internal.util.ui.print.AbstractFigureSelectionDialog
cleanUp, createChooseFigureGroup, getFigure, getGraphicalViewer, getImage, getScaledImage, setScaledImage, setScaledImage, widgetDefaultSelected
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
Methods inherited from interface org.eclipse.graphiti.ui.print.IPrintConfiguration
cleanUp, getFigure, getScaledImage
-
Field Details
-
decimalNumberFormat
- See Also:
-
SCALE_FACTORS
public static final double[] SCALE_FACTORS
-
-
Constructor Details
-
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 Details
-
createButtonsForButtonBar
protected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent) - Overrides:
createButtonsForButtonBar
in classorg.eclipse.jface.dialogs.Dialog
-
configureShell
protected void configureShell(org.eclipse.swt.widgets.Shell newShell) - Overrides:
configureShell
in classAbstractFigureSelectionDialog
-
createDialogArea
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent) - Overrides:
createDialogArea
in classorg.eclipse.jface.dialogs.Dialog
-
updateControls
public void updateControls()- Overrides:
updateControls
in classAbstractFigureSelectionDialog
-
paintControl
public void paintControl(org.eclipse.swt.events.PaintEvent e) - Specified by:
paintControl
in interfaceorg.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 classorg.eclipse.jface.dialogs.Dialog
-
modifyText
public void modifyText(org.eclipse.swt.events.ModifyEvent e) - Specified by:
modifyText
in interfaceorg.eclipse.swt.events.ModifyListener
-
widgetSelected
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) - Specified by:
widgetSelected
in interfaceorg.eclipse.swt.events.SelectionListener
- Overrides:
widgetSelected
in classAbstractFigureSelectionDialog
-
okPressed
protected void okPressed()Pops up a warning if more thanWARNING_IF_MOREPAGES_THAN
pages are tp be printed and sets the scaled image for later retrieval for high quality printing.- Overrides:
okPressed
in classorg.eclipse.jface.dialogs.Dialog
-
getPrinterScaleFactor
public double getPrinterScaleFactor() -
getPreferences
Returns the printer preferences as given through this dialog.- Specified by:
getPreferences
in interfaceIPrintConfiguration
- Returns:
- The printer preferences as given through this dialog.
-
getCurrentScale
public double getCurrentScale() -
getPrinter
public org.eclipse.swt.printing.Printer getPrinter()Description copied from interface:IPrintConfiguration
Returns thePrinter
to be used.- Specified by:
getPrinter
in interfaceIPrintConfiguration
- Returns:
- The printer.
-
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 interfaceIPrintConfiguration
- Returns:
- The return code of this operation. Anything else than 0 will be interpreted as a cancellation request.
-