Skip to content

Commit 0904886

Browse files
ShahzaibIbrahimHeikoKlare
authored andcommitted
Mark Deprecated getBoundsInPixel for removal
The deprecated method getBoundsInPixel() in Image is marked for removal along with its tests.
1 parent 28697b0 commit 0904886

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ public Rectangle getBounds() {
13061306
* @deprecated This API doesn't serve the purpose in an environment having
13071307
* multiple monitors with different DPIs, hence deprecated.
13081308
*/
1309-
@Deprecated
1309+
@Deprecated(since = "2025-09", forRemoval = true)
13101310
public Rectangle getBoundsInPixels() {
13111311
Rectangle bounds = getBounds();
13121312
int scaleFactor = (int) NSScreen.mainScreen().backingScaleFactor();

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ public Rectangle getBounds() {
10141014
* @deprecated This API doesn't serve the purpose in an environment having
10151015
* multiple monitors with different DPIs, hence deprecated.
10161016
*/
1017-
@Deprecated
1017+
@Deprecated(since = "2025-09", forRemoval = true)
10181018
public Rectangle getBoundsInPixels() {
10191019
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
10201020
if (width != -1 && height != -1) {

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private void drawInCellEditor(long window) {
143143
public Rectangle getBounds () {
144144
checkWidget();
145145
if (image != null) {
146-
Rectangle rect = image.getBoundsInPixels ();
146+
Rectangle rect = image.getBounds();
147147
return new Rectangle (x, y, rect.width, rect.height);
148148
} else {
149149
if (width == 0) {
@@ -228,7 +228,7 @@ public Canvas getParent () {
228228
public Point getSize () {
229229
checkWidget();
230230
if (image != null) {
231-
Rectangle rect = image.getBoundsInPixels ();
231+
Rectangle rect = image.getBounds();
232232
return new Point (rect.width, rect.height);
233233
} else {
234234
if (width == 0) {

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ Rectangle getBounds(int zoom) {
11611161
* @deprecated This API doesn't serve the purpose in an environment having
11621162
* multiple monitors with different DPIs, hence deprecated.
11631163
*/
1164-
@Deprecated
1164+
@Deprecated(since = "2025-09", forRemoval = true)
11651165
public Rectangle getBoundsInPixels() {
11661166
return applyUsingAnyHandle(ImageHandle::getBounds);
11671167
}

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ public void test_getBounds() {
584584
assertEquals(bounds, bounds1);
585585
}
586586

587-
@SuppressWarnings("deprecation")
587+
@SuppressWarnings("removal")
588588
@Test
589589
public void test_getBoundsInPixels() {
590590
Rectangle initialBounds = new Rectangle(0, 0, 10, 20);

0 commit comments

Comments
 (0)