diff options
| author | Laurent Redor | 2016-04-18 14:29:03 +0000 |
|---|---|---|
| committer | Laurent Redor | 2016-04-22 14:28:22 +0000 |
| commit | fc272903173652c4eba722c26aaecbe25198a610 (patch) | |
| tree | 233739a269cabe5de01a70f33f9c96aee719e723 | |
| parent | ad8c2a23533e04f6744495453307f36028b8470d (diff) | |
| download | org.eclipse.sirius-fc272903173652c4eba722c26aaecbe25198a610.tar.gz org.eclipse.sirius-fc272903173652c4eba722c26aaecbe25198a610.tar.xz org.eclipse.sirius-fc272903173652c4eba722c26aaecbe25198a610.zip | |
[491913] Format original classes from GMF
Preparation commit: The Sirius formatter is used to format the original
GMF classes.
The classes GradientHelper and DiagramEditPartService have also been
formatted. DiagramEditPartService has also been reorganized to
facilitate the comparison with the original CopyToImageUitl.
Bug: 491913
Change-Id: I09496bb23b4b78d2e26f9e5f7fe38157cdfe96ef
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
5 files changed, 127 insertions, 118 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java index 346bb472a2..68c3485d82 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -21,9 +21,9 @@ import org.eclipse.swt.graphics.Pattern; /** * Helper for the creation of gradient from ViewGradientFigureDesc. - * + * * @author mporhel - * + * */ public final class GradientHelper { @@ -33,7 +33,7 @@ public final class GradientHelper { /** * Set the gradation of colors. - * + * * @param graphics * the graphics * @param figure @@ -54,13 +54,13 @@ public final class GradientHelper { /** * Returns the pattern corresponding to the wanted gradient. - * + * * @param backgroundStyle - * the backgroud style + * the background style * @param bounds * the bounds * @param backgroundColor - * the bachground color + * the background color * @param gradientColor * the gradient color * @return the wanted pattern @@ -84,14 +84,14 @@ public final class GradientHelper { /** * Returns the pattern corresponding to the LeftToRight gradient. - * + * * @param bounds * the bounds * @param backgroundColor * the background color * @param gradientColor - * teh gradient color - * @return the correesponding pattern. + * the gradient color + * @return the corresponding pattern. */ public static Pattern getGradientLeftToRight(final Rectangle bounds, final Color backgroundColor, final Color gradientColor) { return VisualBindingManager.getDefault().getPatternFromValue(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y, backgroundColor, gradientColor); @@ -99,7 +99,7 @@ public final class GradientHelper { /** * Returns the pattern corresponding to the diagonal gradient. - * + * * @param bounds * the bounds * @param backgroundColor @@ -123,19 +123,19 @@ public final class GradientHelper { if (gradientZoneHeight != bounds.height) { y = bounds.y - (i - bounds.height) / 2; } - return VisualBindingManager.getDefault().getPatternFromValue(x, y, x + gradientZoneWidth, y + gradientZoneHeight, backgroundColor, gradientColor); + return VisualBindingManager.getDefault().getPatternFromValue(x, y, x + gradientZoneWidth, y + gradientZoneHeight, backgroundColor, gradientColor); } /** * Returns the pattern corresponding to the TopToBottom gradient. - * + * * @param bounds * the bounds * @param backgroundColor * the background color * @param gradientColor * the gradient color - * @return the correesponding pattern. + * @return the corresponding pattern. */ public static Pattern getGradientTopToBottom(final Rectangle bounds, final Color backgroundColor, final Color gradientColor) { return VisualBindingManager.getDefault().getPatternFromValue(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height, backgroundColor, gradientColor); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/part/DiagramEditPartService.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/part/DiagramEditPartService.java index 4f47ee5531..f6f3d4c2cf 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/part/DiagramEditPartService.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/part/DiagramEditPartService.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2005, 2015 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -56,10 +56,10 @@ import org.eclipse.swt.widgets.Shell; * {@link org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer} used * by OffscreenEditPartFactory so we therefore use our * {@link OffscreenEditPartFactory} in place. - * + * * Many methods are duplicated from {@link CopyToImageUtil} (version * org.eclipse.gmf.runtime.diagram.ui.render_1.4.1.v20100909-1300). - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil { @@ -72,54 +72,30 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r /** * Check if GMF is able to export in HTML. - * + * * @return <code>true</code> if it is, <code>false</code> otherwise */ public static boolean canExportToHtml() { - if (canExportToHtml == null) { + if (DiagramEditPartService.canExportToHtml == null) { try { - exportToHtmlClass = Class.forName("org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToHTMLImageUtil"); //$NON-NLS-1$ - canExportToHtml = true; + DiagramEditPartService.exportToHtmlClass = Class.forName("org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToHTMLImageUtil"); //$NON-NLS-1$ + DiagramEditPartService.canExportToHtml = true; } catch (ClassNotFoundException e) { - canExportToHtml = false; + DiagramEditPartService.canExportToHtml = false; } } - return canExportToHtml; - } - - /** - * Creates a <code>DiagramEditPart</code> given the <code>Diagram</code> - * without opening an editor. - * - * NOTE : to avoid post-commit canonical refresh, execute - * DDiagramCanonicalSynchronizer#synchronize() on the GMF model before. - * - * @param diagram - * the <code>Diagram</code> - * @param shell - * An out parameter for the shell that must be disposed after the - * copy to image operation has completed. - * @param preferencesHint - * The preference hint that is to be used to find the appropriate - * preference store from which to retrieve diagram preference - * values. The preference hint is mapped to a preference store in - * the preference registry <@link DiagramPreferencesRegistry>. - * @return the new populated <code>DiagramEditPart</code> - */ - @Override - public DiagramEditPart createDiagramEditPart(final Diagram diagram, final Shell shell, final PreferencesHint preferencesHint) { - return OffscreenEditPartFactory.getInstance().createDiagramEditPart(diagram, shell, preferencesHint); + return DiagramEditPartService.canExportToHtml; } /** * Layout GMF views created by a * {@link org.eclipse.sirius.diagram.business.api.refresh.view.refresh.CanonicalSynchronizer#synchronize()} * . - * + * * NOTE : a set of * {@link org.eclipse.emf.common.command.AbstractCommand.NonDirtying} * commands will be executed. - * + * * @param diagramEditPart * the <code>DiagramEditPart</code> to layout. */ @@ -135,8 +111,32 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r } /** + * Creates a <code>DiagramEditPart</code> given the <code>Diagram</code> + * without opening an editor. + * + * NOTE : to avoid post-commit canonical refresh, execute + * DDiagramCanonicalSynchronizer#synchronize() on the GMF model before. + * + * @param diagram + * the <code>Diagram</code> + * @param shell + * An out parameter for the shell that must be disposed after the + * copy to image operation has completed. + * @param preferencesHint + * The preference hint that is to be used to find the appropriate + * preference store from which to retrieve diagram preference + * values. The preference hint is mapped to a preference store in + * the preference registry <@link DiagramPreferencesRegistry>. + * @return the new populated <code>DiagramEditPart</code> + */ + @Override + public DiagramEditPart createDiagramEditPart(Diagram diagram, Shell shell, PreferencesHint preferencesHint) { + return OffscreenEditPartFactory.getInstance().createDiagramEditPart(diagram, shell, preferencesHint); + } + + /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil#copyToImage(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart, * org.eclipse.core.runtime.IPath, * org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat, @@ -146,7 +146,7 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r public DiagramGenerator copyToImage(DiagramEditPart diagramEP, IPath destination, org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat format, IProgressMonitor monitor) throws CoreException { if (exportToHtml && DiagramEditPartService.canExportToHtml()) { try { - CopyToImageUtil copyToHmlUtil = (CopyToImageUtil) exportToHtmlClass.newInstance(); + CopyToImageUtil copyToHmlUtil = (CopyToImageUtil) DiagramEditPartService.exportToHtmlClass.newInstance(); return copyToHmlUtil.copyToImage(diagramEP, destination, format, monitor); } catch (InstantiationException e) { throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, -1, MessageFormat.format(Messages.DiagramEditPartService_imageExportException, "InstanciationException"), e)); //$NON-NLS-1$ @@ -171,7 +171,7 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil#saveToFile(org.eclipse.core.runtime.IPath, * org.eclipse.swt.graphics.Image, * org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat, @@ -202,10 +202,33 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r refreshLocal(destination); } + private void saveToOutputStream(OutputStream stream, Image image, ImageFileFormat imageFormat, IProgressMonitor monitor) { + monitor.worked(1); + + ImageData imageData = image.getImageData(); + + if (imageFormat.equals(ImageFileFormat.GIF) || imageFormat.equals(ImageFileFormat.BMP)) { + imageData = createImageData(image); + } + + monitor.worked(1); + + ImageLoader imageLoader = new ImageLoader(); + imageLoader.data = new ImageData[] { imageData }; + imageLoader.logicalScreenHeight = image.getBounds().width; + imageLoader.logicalScreenHeight = image.getBounds().height; + if (imageFormat.equals(ImageFileFormat.JPG)) { + imageLoader.compression = 100; + } + imageLoader.save(stream, imageFormat.getOrdinal()); + + monitor.worked(1); + } + /** * create a file in the workspace if the destination is in a project in the * workspace. - * + * * @param destination * the destination file. * @return the status from validating the file for editing @@ -234,7 +257,7 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r /** * refresh the file in the workspace if the destination is in a project in * the workspace. - * + * * @param destination * the destination file. * @exception CoreException @@ -247,32 +270,10 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r } } - private void saveToOutputStream(OutputStream stream, Image image, ImageFileFormat imageFormat, IProgressMonitor monitor) { - monitor.worked(1); - - ImageData imageData = image.getImageData(); - - if (imageFormat.equals(ImageFileFormat.GIF) || imageFormat.equals(ImageFileFormat.BMP)) - imageData = createImageData(image); - - monitor.worked(1); - - ImageLoader imageLoader = new ImageLoader(); - imageLoader.data = new ImageData[] { imageData }; - imageLoader.logicalScreenHeight = image.getBounds().width; - imageLoader.logicalScreenHeight = image.getBounds().height; - if (imageFormat.equals(ImageFileFormat.JPG)) { - imageLoader.compression = 100; - } - imageLoader.save(stream, imageFormat.getOrdinal()); - - monitor.worked(1); - } - /** * Retrieve the image data for the image, using a palette of at most 256 * colours. - * + * * @param image * the SWT image. * @return new image data. @@ -308,7 +309,7 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r /** * Retrieve an image data with an 8 bit palette for an image. We assume that * the image has less than 256 colours. - * + * * @param imageData * the imageData for the image. * @return the new 8 bit imageData or null if the image has more than 256 @@ -335,8 +336,9 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r colours[newPixel] = colour; break; } - if (colours[newPixel].equals(colour)) + if (colours[newPixel].equals(colour)) { break; + } } if (newPixel >= 256) { @@ -353,8 +355,9 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r RGB colour = new RGB(0, 0, 0); for (int k = 0; k < 256; ++k) { - if (colours[k] == null) + if (colours[k] == null) { colours[k] = colour; + } } return newImageData; @@ -382,8 +385,9 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r RGB colour = palette.getRGB(pixel); RGB webSafeColour = getWebSafeColour(colour); for (newPixel = 0; newPixel < 256; ++newPixel) { - if (webSafePallette[newPixel].equals(webSafeColour)) + if (webSafePallette[newPixel].equals(webSafeColour)) { break; + } } Assert.isTrue(newPixel < 216); @@ -396,9 +400,23 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r } /** + * Retrieves a web safe colour that closely matches the provided colour. + * + * @param colour + * a colour. + * @return the web safe colour. + */ + private RGB getWebSafeColour(RGB colour) { + int red = Math.round((colour.red + 25) / 51) * 51; + int green = Math.round((colour.green + 25) / 51) * 51; + int blue = Math.round((colour.blue + 25) / 51) * 51; + return new RGB(red, green, blue); + } + + /** * Retrieves a web safe pallette. Our palette will be 216 web safe colours * and the remaining filled with white. - * + * * @return array of 256 colours. */ private RGB[] getWebSafePallette() { @@ -415,24 +433,11 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r RGB colour = new RGB(0, 0, 0); for (int k = 0; k < 256; ++k) { - if (colours[k] == null) + if (colours[k] == null) { colours[k] = colour; + } } return colours; } - - /** - * Retrieves a web safe colour that closely matches the provided colour. - * - * @param colour - * a colour. - * @return the web safe colour. - */ - private RGB getWebSafeColour(RGB colour) { - int red = ((colour.red + 25) / 51) * 51; - int green = ((colour.green + 25) / 51) * 51; - int blue = ((colour.blue + 25) / 51) * 51; - return new RGB(red, green, blue); - } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusDiagramSVGGenerator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusDiagramSVGGenerator.java index 37626358a9..a7c2c45eb9 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusDiagramSVGGenerator.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusDiagramSVGGenerator.java @@ -1,14 +1,13 @@ /****************************************************************************** - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation ****************************************************************************/ - package org.eclipse.sirius.diagram.ui.tools.internal.render; import java.awt.Image; @@ -45,7 +44,7 @@ import org.w3c.dom.Element; /** * Supports generation of an SVG DOM for a diagram or a subset of editparts on a * diagram. - * + * * @author jschofie / sshaw */ // CHECKSTYLE:OFF @@ -59,7 +58,7 @@ public class SiriusDiagramSVGGenerator extends DiagramGenerator { /** * Creates a new instance. - * + * * @param diagramEditPart * the diagram editpart */ @@ -73,6 +72,7 @@ public class SiriusDiagramSVGGenerator extends DiagramGenerator { * org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator# * setUpGraphics(int, int) */ + @Override protected Graphics setUpGraphics(int width, int height) { viewBox = new Rectangle(0, 0, width, height); return GraphicsSVG.getInstance(viewBox); @@ -84,6 +84,7 @@ public class SiriusDiagramSVGGenerator extends DiagramGenerator { * org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator# * getImageDescriptor(org.eclipse.draw2d.Graphics) */ + @Override protected ImageDescriptor getImageDescriptor(Graphics g) { try { GraphicsSVG svgG = (GraphicsSVG) g; @@ -107,7 +108,7 @@ public class SiriusDiagramSVGGenerator extends DiagramGenerator { /** * Writes the SVG Model out to a file. - * + * * @param outputStream * output stream to store the SVG Model */ @@ -141,13 +142,15 @@ public class SiriusDiagramSVGGenerator extends DiagramGenerator { * org.eclipse.gmf.runtime.diagram.ui.internal.clipboard.DiagramGenerator# * createAWTImageForParts(java.util.List) */ + @Override public Image createAWTImageForParts(List editparts, org.eclipse.swt.graphics.Rectangle sourceRect) { createSWTImageDescriptorForParts(editparts, sourceRect); if (getRenderedImage() != null) { try { BufferedImage bufImg = (BufferedImage) getRenderedImage().getAdapter(BufferedImage.class); - if (bufImg == null) + if (bufImg == null) { bufImg = ImageConverter.convert(getRenderedImage().getSWTImage()); + } return bufImg; } catch (Error e) { // log the Error but allow execution to continue diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusGraphicsSVG.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusGraphicsSVG.java index b74c96958c..1def9e07f8 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusGraphicsSVG.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusGraphicsSVG.java @@ -1,12 +1,12 @@ /****************************************************************************** - * Copyright (c) 2004, 2010 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Corporation - initial API and implementation + * IBM Corporation - initial API and implementation ****************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.render; @@ -34,7 +34,7 @@ import org.w3c.dom.Element; /** * Objects of this class can be used with draw2d to create an SVG DOM. - * + * * @author jschofie / sshaw */ // CHECKSTYLE:OFF @@ -44,11 +44,11 @@ public class SiriusGraphicsSVG extends GraphicsToGraphics2DAdaptor implements Dr /** * Static initializer that will return an instance of - * <code>GraphicsSVG</code> - * + * <code>SiriusGraphicsSVG</code> + * * @param viewPort * the <code>Rectangle</code> area that is to be rendered. - * @return a new <code>GraphicsSVG</code> object. + * @return a new <code>SiriusGraphicsSVG</code> object. */ public static SiriusGraphicsSVG getInstance(Rectangle viewPort) { SVGGraphics2D svgGraphics; @@ -103,7 +103,7 @@ public class SiriusGraphicsSVG extends GraphicsToGraphics2DAdaptor implements Dr /** * Method used to get the SVG DOM from the Graphics - * + * * @return SVG document */ public Document getDocument() { @@ -112,7 +112,7 @@ public class SiriusGraphicsSVG extends GraphicsToGraphics2DAdaptor implements Dr /** * Method used to get the SVG Root element from the document - * + * * @return DOM Root element */ public Element getRoot() { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusGraphicsToGraphics2DAdaptor.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusGraphicsToGraphics2DAdaptor.java index 344310ddcf..bdefa47852 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusGraphicsToGraphics2DAdaptor.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/render/SiriusGraphicsToGraphics2DAdaptor.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2004, 2015 IBM Corporation and others. + * Copyright (c) 2004, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,6 @@ * Contributors: * IBM Corporation - initial API and implementation ****************************************************************************/ - package org.eclipse.sirius.diagram.ui.tools.internal.render; import java.awt.AlphaComposite; @@ -701,8 +700,9 @@ public class SiriusGraphicsToGraphics2DAdaptor extends Graphics implements Drawa @Override public void drawString(String s, int x, int y) { - if (s == null || s.length() == 0) + if (s == null || s.length() == 0) { return; + } java.awt.FontMetrics metrics = getGraphics2D().getFontMetrics(); int stringLength = metrics.stringWidth(s); @@ -1356,12 +1356,13 @@ public class SiriusGraphicsToGraphics2DAdaptor extends Graphics implements Drawa public int getAntialias() { Object antiAlias = getGraphics2D().getRenderingHint(RenderingHints.KEY_ANTIALIASING); if (antiAlias != null) { - if (antiAlias.equals(RenderingHints.VALUE_ANTIALIAS_ON)) + if (antiAlias.equals(RenderingHints.VALUE_ANTIALIAS_ON)) { return SWT.ON; - else if (antiAlias.equals(RenderingHints.VALUE_ANTIALIAS_OFF)) + } else if (antiAlias.equals(RenderingHints.VALUE_ANTIALIAS_OFF)) { return SWT.OFF; - else if (antiAlias.equals(RenderingHints.VALUE_ANTIALIAS_DEFAULT)) + } else if (antiAlias.equals(RenderingHints.VALUE_ANTIALIAS_DEFAULT)) { return SWT.DEFAULT; + } } return SWT.DEFAULT; |
