Skip to content

Commit a10aa87

Browse files
Replacing usages of Image(Display, Rectangle)
Replacing usages of Image(Display, Rectangle) in favor of Image(Display, int ,int) since the prior one is getting deprecated.
1 parent 912fadf commit a10aa87

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/dumps/TimeoutDumpTimer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.eclipse.swt.graphics.Image;
4343
import org.eclipse.swt.graphics.ImageData;
4444
import org.eclipse.swt.graphics.ImageLoader;
45+
import org.eclipse.swt.graphics.Rectangle;
4546
import org.eclipse.swt.widgets.Control;
4647
import org.eclipse.swt.widgets.Display;
4748
import org.eclipse.swt.widgets.Shell;
@@ -285,7 +286,8 @@ public void run() {
285286

286287
// Take a screenshot:
287288
GC gc = new GC(display);
288-
final Image image = new Image(display, display.getBounds());
289+
Rectangle bounds = display.getBounds();
290+
final Image image = new Image(display, bounds.width, bounds.height);
289291
gc.copyArea(image, 0, 0);
290292
gc.dispose();
291293

tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/swt/Screenshots.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static String takeScreenshot(Class<?> testClass, String name, PrintStream
8989
GC gc = new GC(display);
9090
Rectangle displayBounds= display.getBounds();
9191
out.println("Display @ " + displayBounds);
92-
final Image image = new Image(display, displayBounds);
92+
final Image image = new Image(display, displayBounds.width, displayBounds.height);
9393
gc.copyArea(image, 0, 0);
9494
gc.dispose();
9595

tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/widgets/AbstractFactoryTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package org.eclipse.jface.tests.widgets;
1515

1616
import org.eclipse.swt.graphics.Image;
17-
import org.eclipse.swt.graphics.Rectangle;
1817
import org.eclipse.swt.widgets.Shell;
1918
import org.junit.After;
2019
import org.junit.AfterClass;
@@ -27,7 +26,7 @@ public class AbstractFactoryTest {
2726

2827
@BeforeClass
2928
public static void classSetup() {
30-
image = new Image(null, new Rectangle(1, 1, 1, 1));
29+
image = new Image(null, 1, 1);
3130
}
3231

3332
@Before

tests/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/ScreenshotTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static String takeScreenshot(Class<?> testClass, String name, PrintStream
117117
GC gc = new GC(display);
118118
Rectangle displayBounds= display.getBounds();
119119
out.println("Display @ " + displayBounds);
120-
final Image image = new Image(display, displayBounds);
120+
final Image image= new Image(display, displayBounds.width, displayBounds.height);
121121
gc.copyArea(image, 0, 0);
122122
gc.dispose();
123123

0 commit comments

Comments
 (0)