Class ExportDiagramDialog
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.ExportDiagramDialog
- All Implemented Interfaces:
EventListener,ISaveAsImageConfiguration,org.eclipse.jface.window.IShellProvider,org.eclipse.swt.events.ModifyListener,org.eclipse.swt.events.SelectionListener,org.eclipse.swt.internal.SWTEventListener
public class ExportDiagramDialog
extends AbstractFigureSelectionDialog
implements org.eclipse.swt.events.ModifyListener, ISaveAsImageConfiguration
This is a simple dialog to choose the image-format and the image-scale-factor
for a save-as-image operation.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]static final double[]static final String[]Fields inherited from class org.eclipse.graphiti.ui.internal.util.ui.print.AbstractFigureSelectionDialog
_allFigure, _figure, _graphicalViewer, _image, _insideInternalModify, _preferences, _selectionFigureFields 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, ELLIPSISFields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurredFields inherited from interface org.eclipse.graphiti.ui.saveasimage.ISaveAsImageConfiguration
OK -
Constructor Summary
ConstructorsConstructorDescriptionExportDiagramDialog(org.eclipse.swt.widgets.Shell shell, org.eclipse.gef.GraphicalViewer graphicalViewer) Creates a new ExportDiagramDialog. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExporters(Map<String, Boolean> diagramExporterTypes) Should add the given exporters to an internal list.intDoes the actual configuration.protected voidconfigureShell(org.eclipse.swt.widgets.Shell newShell) protected org.eclipse.swt.widgets.ControlcreateDialogArea(org.eclipse.swt.widgets.Composite parent) final StringReturns the file extension to use.final StringReturns the selected file extension formatted in a standard way, e.g.final intReturns the image format as defined by the SWT.IMAGE_* constants likeSWT.IMAGE_BMP.doubleRetunrs the scale factor to be used in the saved image.voidmodifyText(org.eclipse.swt.events.ModifyEvent e) protected voidvoidMethods inherited from class org.eclipse.graphiti.ui.internal.util.ui.print.AbstractFigureSelectionDialog
cleanUp, createChooseFigureGroup, getFigure, getGraphicalViewer, getImage, getScaledImage, setScaledImage, setScaledImage, widgetDefaultSelected, widgetSelectedMethods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenTextMethods 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, setWindowManagerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.graphiti.ui.saveasimage.ISaveAsImageConfiguration
getFigure, getScaledImage
-
Field Details
-
WIDTHS
-
HEIGHTS
-
SCALE_FACTORS
public static final double[] SCALE_FACTORS
-
-
Constructor Details
-
ExportDiagramDialog
public ExportDiagramDialog(org.eclipse.swt.widgets.Shell shell, org.eclipse.gef.GraphicalViewer graphicalViewer) Creates a new ExportDiagramDialog.- Parameters:
shell- The Shell of this dialog.graphicalViewer- The GraphicalViewer, which to save.
-
-
Method Details
-
configure
public int configure()Description copied from interface:ISaveAsImageConfigurationDoes the actual configuration. May bring up a UI.- Specified by:
configurein interfaceISaveAsImageConfiguration- Returns:
-
addExporters
Description copied from interface:ISaveAsImageConfigurationShould add the given exporters to an internal list. Clients may use this list to let users select in an UI from the exporters or programmatically decide which one to use.- Specified by:
addExportersin interfaceISaveAsImageConfiguration- Parameters:
diagramExporterTypes- AMapholding all exporters.
-
createDialogArea
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent) - Overrides:
createDialogAreain classorg.eclipse.jface.dialogs.Dialog
-
configureShell
protected void configureShell(org.eclipse.swt.widgets.Shell newShell) - Overrides:
configureShellin classAbstractFigureSelectionDialog
-
modifyText
public void modifyText(org.eclipse.swt.events.ModifyEvent e) - Specified by:
modifyTextin interfaceorg.eclipse.swt.events.ModifyListener
-
updateControls
public void updateControls()- Overrides:
updateControlsin classAbstractFigureSelectionDialog
-
okPressed
protected void okPressed()- Overrides:
okPressedin classorg.eclipse.jface.dialogs.Dialog
-
getImageFormat
public final int getImageFormat()Description copied from interface:ISaveAsImageConfigurationReturns the image format as defined by the SWT.IMAGE_* constants likeSWT.IMAGE_BMP.- Specified by:
getImageFormatin interfaceISaveAsImageConfiguration- Returns:
- An integer defining the format
-
getFormattedFileExtension
Description copied from interface:ISaveAsImageConfigurationReturns the selected file extension formatted in a standard way, e.g. converted to lower case.- Specified by:
getFormattedFileExtensionin interfaceISaveAsImageConfiguration- Returns:
- A string holding the file extension
-
getFileExtension
Description copied from interface:ISaveAsImageConfigurationReturns the file extension to use.- Specified by:
getFileExtensionin interfaceISaveAsImageConfiguration- Returns:
- A string holding the file extension
-
getImageScaleFactor
public double getImageScaleFactor()Description copied from interface:ISaveAsImageConfigurationRetunrs the scale factor to be used in the saved image.- Specified by:
getImageScaleFactorin interfaceISaveAsImageConfiguration- Returns:
- A double value defining the scale factor.
-