Skip to content

Commit 9d92673

Browse files
ptzieglerazoitl
authored andcommitted
Migrate to new DND cursors and raise minimum requirement to 2024-09
From: eclipse-platform/eclipse.platform.ui#3047 (comment) > The issue is rooted in the SVG image rasterization. When the > rasterization result is converted into SWT image data, that image data > is created with a 32bit data palette. This leads to a difference in > the image data used for the cursors, as they originally contained 24 > bit data (not having an alpha channel). With the 2024-09, those constants have been deprecated and replaced with equivalent cursors that don't require a mask.
1 parent 3b9b44f commit 9d92673

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- java: 21
1616
target: master
1717
- java: 17
18-
target: baseline
18+
target: 2024-09
1919
runs-on: ${{ matrix.os }}
2020
name: OS ${{ matrix.os }} Target ${{ matrix.target }} compile
2121
steps:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
## GEF
66

7+
- Raised minimum requirement to Eclipse 2024-09
8+
79
## Zest
810

911
# GEF Classic 3.24.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The code base of the GEF components implemented in JavaFX is located in the [ecl
99

1010
# Requirements:
1111

12-
- Eclipse 2024-06 or later
12+
- Eclipse 2024-06 (Draw2D/Zest), Eclipse 2024-09 (GEF) or later
1313
- Java 17 or later
1414

1515
# Update sites:

org.eclipse.gef/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Export-Package: org.eclipse.gef,
3434
Require-Bundle: org.eclipse.draw2d;visibility:=reexport;bundle-version="[3.13.0,4.0.0)",
3535
org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
3636
org.eclipse.ui.views;resolution:=optional;bundle-version="[3.2.0,4.0.0)",
37-
org.eclipse.ui.workbench;bundle-version="[3.2.0,4.0.0)",
37+
org.eclipse.ui.workbench;bundle-version="[3.133.0,4.0.0)",
3838
org.eclipse.jface;bundle-version="[3.2.0,4.0.0)"
3939
Bundle-ActivationPolicy: lazy
4040
Bundle-RequiredExecutionEnvironment: JavaSE-17

org.eclipse.gef/src/org/eclipse/gef/ui/palette/FlyoutPaletteComposite.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,22 +1581,18 @@ private static class DragCursors {
15811581
* @param code the code
15821582
* @return the cursor
15831583
*/
1584-
@SuppressWarnings("removal") // Still required for 2024-06
15851584
public static Cursor getCursor(int code) {
15861585
if (cursors[code] == null) {
15871586
switch (code) {
15881587
case LEFT:
1589-
cursors[LEFT] = createCursor(ISharedImages.IMG_OBJS_DND_LEFT_SOURCE,
1590-
ISharedImages.IMG_OBJS_DND_LEFT_MASK);
1588+
cursors[LEFT] = createCursor(ISharedImages.IMG_OBJS_DND_LEFT);
15911589
break;
15921590
case RIGHT:
1593-
cursors[RIGHT] = createCursor(ISharedImages.IMG_OBJS_DND_RIGHT_SOURCE,
1594-
ISharedImages.IMG_OBJS_DND_RIGHT_MASK);
1591+
cursors[RIGHT] = createCursor(ISharedImages.IMG_OBJS_DND_RIGHT);
15951592
break;
15961593
default:
15971594
case INVALID:
1598-
cursors[INVALID] = createCursor(ISharedImages.IMG_OBJS_DND_INVALID_SOURCE,
1599-
ISharedImages.IMG_OBJS_DND_INVALID_MASK);
1595+
cursors[INVALID] = createCursor(ISharedImages.IMG_OBJS_DND_INVALID);
16001596
break;
16011597
}
16021598
}
@@ -1610,17 +1606,15 @@ public static Cursor getCursor(int code) {
16101606
* The strings passed as arguments must belong to the source and mask ids of a
16111607
* cursor contributed by {@link ISharedImages}.
16121608
*/
1613-
private static Cursor createCursor(String sourceName, String maskName) {
1609+
private static Cursor createCursor(String sourceName) {
16141610
ImageDescriptor source = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(sourceName);
1615-
ImageDescriptor mask = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(maskName);
16161611
int deviceZoom = InternalGEFPlugin.getOrDefaultDeviceZoom();
16171612
// Scales the image if the display is using neither 100% nor 200% zoom
16181613
ImageData sourceData = InternalGEFPlugin.scaledImageData(source, deviceZoom);
1619-
ImageData maskData = InternalGEFPlugin.scaledImageData(mask, deviceZoom);
16201614
// Hotspot should be the center of the image. e.g. (16, 16) on 100% zoom
16211615
int hotspotX = sourceData.width / 2;
16221616
int hotspotY = sourceData.height / 2;
1623-
return new Cursor(null, sourceData, maskData, hotspotX, hotspotY);
1617+
return new Cursor(null, sourceData, hotspotX, hotspotY);
16241618
}
16251619
}
16261620
}

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,9 @@
363363
<id>master</id>
364364
</profile>
365365
<profile>
366-
<id>baseline</id>
366+
<id>2024-09</id>
367367
<properties>
368-
<target-platform>../org.eclipse.gef.baseline/gef-classic-3.20.0.target</target-platform>
368+
<target-platform>../org.eclipse.gef.baseline/gef-classic-3.21.0.target</target-platform>
369369
<execution-environment>JavaSE-17</execution-environment>
370370
<tycho.p2.baseline.skip>true</tycho.p2.baseline.skip>
371371
</properties>

0 commit comments

Comments
 (0)