Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2015-03-13 11:56:51 +0000
committerSravan Kumar Lakkimsetti2015-03-13 11:56:51 +0000
commitfcbecdd5b8546b8c21fd9d91bdcd3af08845f6a8 (patch)
treec65de6e16e4631e59a4babd266e938f7a49a0fb1
parenta93e1e3fe5a47f4cb51520dfc03261096a506832 (diff)
downloadeclipse.platform.swt-fcbecdd5b8546b8c21fd9d91bdcd3af08845f6a8.tar.gz
eclipse.platform.swt-fcbecdd5b8546b8c21fd9d91bdcd3af08845f6a8.tar.xz
eclipse.platform.swt-fcbecdd5b8546b8c21fd9d91bdcd3af08845f6a8.zip
Completed the formatting changes
Change-Id: Idbe58a9d93d233964a0525723ef4e607519c2091 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/DPIUtil.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageFileNameProvider.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java6
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet366.java (renamed from examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet367.java)24
8 files changed, 51 insertions, 42 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
index 812cdf8cf1..55a5b53735 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
index 716345b57b..8b938afbcd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -12,7 +12,6 @@ package org.eclipse.swt.graphics;
import org.eclipse.swt.internal.cocoa.*;
-
import org.eclipse.swt.*;
import java.io.*;
@@ -554,7 +553,7 @@ public Image(Device device, String filename) {
* error if an error occurs while loading the image, or if the result
* is an image of an unsupported type.
* <p>
- * This constructor is provided for convenience for loading image as
+ * This constructor is provided for convenience for loading image as
* per DPI level.
*
* @param device the device on which to create the image
@@ -578,7 +577,7 @@ public Image(Device device, String filename) {
* @since 3.104
*/
public Image(Device device, ImageFileNameProvider imageFileNameProvider) {
- super(device);
+ super(device);
if (imageFileNameProvider == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
String filename = imageFileNameProvider.getImagePath(100);
NSAutoreleasePool pool = null;
@@ -604,7 +603,7 @@ public Image(Device device, ImageFileNameProvider imageFileNameProvider) {
* error if an error occurs while loading the image, or if the result
* is an image of an unsupported type.
* <p>
- * This constructor is provided for convenience for loading image as
+ * This constructor is provided for convenience for loading image as
* per DPI level.
*
* @param device the device on which to create the image
@@ -628,7 +627,7 @@ public Image(Device device, ImageFileNameProvider imageFileNameProvider) {
* @since 3.104
*/
public Image(Device device, ImageDataProvider imageDataProvider) {
- super(device);
+ super(device);
if (imageDataProvider == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
ImageData data = imageDataProvider.getImageData (100);
if (data == null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
@@ -952,9 +951,9 @@ void init(int width, int height) {
void init(ImageData image) {
if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
-
+
if (handle != null) handle.release();
-
+
handle = (NSImage)new NSImage().alloc();
NSSize size = new NSSize();
size.width = width;
@@ -962,8 +961,8 @@ void init(ImageData image) {
handle = handle.initWithSize(size);
this.width = image.width;
this.height = image.height;
-
- NSBitmapImageRep rep = createRepresentaion(image);
+
+ NSBitmapImageRep rep = createRepresentaion(image);
handle.addRepresentation(rep);
rep.release();
handle.setCacheMode(OS.NSImageCacheNever);
@@ -976,10 +975,10 @@ private NSBitmapImageRep createRepresentaion(ImageData imageData) {
if (!(((imageData.depth == 1 || imageData.depth == 2 || imageData.depth == 4 || imageData.depth == 8) && !palette.isDirect) ||
((imageData.depth == 8) || (imageData.depth == 16 || imageData.depth == 24 || imageData.depth == 32) && palette.isDirect)))
SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
-
+
/* Create the image */
int dataSize = imageData.width * imageData.height * 4;
-
+
/* Initialize data */
int bpr = imageData.width * 4;
byte[] buffer = new byte[dataSize];
@@ -1066,7 +1065,7 @@ private NSBitmapImageRep createRepresentaion(ImageData imageData) {
}
}
}
-
+
rep = rep.initWithBitmapDataPlanes(0, imageData.width, imageData.height, 8, hasAlpha ? 4 : 3, hasAlpha, false, OS.NSDeviceRGBColorSpace, OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32);
OS.memmove(rep.bitmapData(), buffer, dataSize);
return rep;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/DPIUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/DPIUtil.java
index c97b21a575..e3d4fbb123 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/DPIUtil.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/DPIUtil.java
@@ -13,7 +13,7 @@ package org.eclipse.swt.graphics;
/**
* This class hold common constants and utility functions w.r.t. to SWT high DPI
* functionality.
- *
+ *
* @since 3.104
*/
class DPIUtil {
@@ -24,7 +24,7 @@ class DPIUtil {
/**
* Compute the zoom value based on the DPI value.
- *
+ *
* @return zoom
*/
static int mapDPIToZoom (int dpi) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java
index 673b0e49a0..93ab7b90b1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java
@@ -12,14 +12,14 @@ package org.eclipse.swt.graphics;
/**
* Interface to provide a callback mechanism to get information about images
- * when the application is moved from low dpi monitor to high dpi. This
+ * when the application is moved from low dpi monitor to high dpi. This
* information will be used to render the higher resolution images
- *
+ *
* This interface needs to be implemented by client code and provide the image
* information on demand. This interface provides a callback mechanism to the
* client code to provide ImageData based on the OS as per the zoom
* level. Client can have their own naming convention for various zoom levels
- *
+ *
* @since 3.104
*/
public interface ImageDataProvider {
@@ -27,15 +27,15 @@ public interface ImageDataProvider {
/**
* Method to retrieve ImageData for a particular zoom level this needs to
* be implemented on the client side
- *
+ *
* This method should return an object of ImageData. If not available please
* fallback to image of 100% level and send its ImageData
- *
+ *
* Note: SWT will throw exception if this method returns null.
- *
+ *
* @param zoom
* value will be 100(16x16 image), 150(24x24 image) & 200(32x32 image)
- * @return the ImageData of the image
+ * @return the ImageData of the image
* @since 3.104
*/
public ImageData getImageData (int zoom);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageFileNameProvider.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageFileNameProvider.java
index 6ecc11e2cd..0003eaffaf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageFileNameProvider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageFileNameProvider.java
@@ -12,14 +12,14 @@ package org.eclipse.swt.graphics;
/**
* Interface to provide a callback mechanism to get information about images
- * when the application is moved from low dpi monitor to high dpi. This
+ * when the application is moved from low dpi monitor to high dpi. This
* information will be used to render the higher resolution images
- *
+ *
* This interface needs to be implemented by client code and provide the image
* information on demand. This interface provides a callback mechanism to the
* client code to provide file name based on the OS as per the zoom
* level. Client can have their own naming convention for various zoom levels
- *
+ *
* @since 3.104
*/
public interface ImageFileNameProvider {
@@ -27,13 +27,13 @@ public interface ImageFileNameProvider {
/**
* Method to retrieve absolute path to filename for a particular zoom level.
* This needs to be implemented on the client side
- *
+ *
* This method should return a filename available on the filesystem. If not
* available please fallback to image of 100% level and send its absolute
* path as return value.
- *
+ *
* Note: SWT will throw exception if this method returns null.
- *
+ *
* @param zoom
* value will be 100(16x16 image), 150(24x24 image) & 200(32x32 image)
* @return the absolute file path of the image
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
index ac62241d1a..968f2d5f9f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
@@ -689,7 +689,7 @@ public Image(Device device, String filename) {
* error if an error occurs while loading the image, or if the result
* is an image of an unsupported type.
* <p>
- * This constructor is provided for convenience for loading image as
+ * This constructor is provided for convenience for loading image as
* per DPI level.
*
* @param device the device on which to create the image
@@ -730,7 +730,7 @@ public Image(Device device, ImageFileNameProvider imageFileNameProvider) {
* error if an error occurs while loading the image, or if the result
* is an image of an unsupported type.
* <p>
- * This constructor is provided for convenience for loading image as
+ * This constructor is provided for convenience for loading image as
* per DPI level.
*
* @param device the device on which to create the image
@@ -770,7 +770,7 @@ int getDeviceZoom () {
/**
* Refresh the Image based on the zoom level, if required.
- *
+ *
* @return true if image is refreshed
*/
boolean refreshImageForZoom () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
index 57e03f6dd8..9d0eb9f9ac 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
@@ -636,7 +636,7 @@ public Image (Device device, String filename) {
* error if an error occurs while loading the image, or if the result
* is an image of an unsupported type.
* <p>
- * This constructor is provided for convenience for loading image as
+ * This constructor is provided for convenience for loading image as
* per DPI level.
*
* @param device the device on which to create the image
@@ -677,7 +677,7 @@ public Image(Device device, ImageFileNameProvider imageFileNameProvider) {
* error if an error occurs while loading the image, or if the result
* is an image of an unsupported type.
* <p>
- * This constructor is provided for convenience for loading image as
+ * This constructor is provided for convenience for loading image as
* per DPI level.
*
* @param device the device on which to create the image
@@ -717,7 +717,7 @@ int getDeviceZoom () {
/**
* Refresh the Image based on the zoom level, if required.
- *
+ *
* @return true if image is refreshed
*/
boolean refreshImageForZoom () {
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet367.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet366.java
index 371419e851..478721c734 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet367.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet366.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2015 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
+ *******************************************************************************/
package org.eclipse.swt.snippets;
/*
@@ -9,18 +19,18 @@ import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
-public class Snippet367 {
+public class Snippet366 {
public static void main (String [] args) {
final Display display = new Display ();
final ImageFileNameProvider filenameProvider = new ImageFileNameProvider () {
@Override
public String getImagePath (int zoom) {
switch (zoom) {
- case 100:
+ case 100:
return "collapseall.png";
- case 150:
+ case 150:
return "collapseall@1.5x.png";
- case 200:
+ case 200:
return "collapseall@2x.png";
}
return null;
@@ -30,11 +40,11 @@ public class Snippet367 {
@Override
public ImageData getImageData (int zoom) {
switch (zoom) {
- case 100:
+ case 100:
return new ImageData ("collapseall.png");
- case 150:
+ case 150:
return new ImageData ("collapseall@1.5x.png");
- case 200:
+ case 200:
return new ImageData ("collapseall@2x.png");
}
return null;

Back to the top