Skip to content

Commit 3b1dc49

Browse files
committed
Deprecate ScaledGraphics
All scaling needs for Draw2d can be handled by SWT natively and there are several issues in the implementation of ScaledGraphics.
1 parent 16d9b02 commit 3b1dc49

File tree

10 files changed

+175
-7
lines changed

10 files changed

+175
-7
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55

66
- Added new PrecisionPointList class. This class was created during the previous
77
release and has now been finalized.
8+
- **Deprecated ScaledGraphics**
9+
*To be removed after 2028-03 release*
10+
All scaling needs for Draw2d can be handled by SWT natively and there are several issues in the implementation of
11+
ScaledGraphics. Therefore, use `SWTGraphics` instead.
12+
13+
As part of this deprecation also all methods and flags allowing to switch to between `SWTGraphics` and
14+
`ScaledGraphics` are deprecated and the default behavior is changed to use `SWTGraphics`.
15+
16+
**Action Required:** If your application depends on `ScaledGraphics` you need to actively switch it on for the following classes:
17+
- ScaleableFreeformLayeredPane
18+
- ScalableFreeformRootEditPart
19+
- ScalableLayeredPane
20+
- ScalableRootEditPart
21+
- ScalableLightweightSystem
822

923
## GEF
1024

org.eclipse.draw2d/src/org/eclipse/draw2d/IScalablePane.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
*/
3333
public interface IScalablePane extends ScalableFigure {
3434

35+
/**
36+
* @deprecated will be deleted after the 2028-03 release (see
37+
* {@link ScaledGraphics}).
38+
*/
39+
@Deprecated(forRemoval = true, since = "2026-03")
3540
boolean useScaledGraphics();
3641

3742
boolean optimizeClip();

org.eclipse.draw2d/src/org/eclipse/draw2d/PrinterGraphics.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*
2929
* @author danlee
3030
*/
31+
@SuppressWarnings("removal")
3132
public class PrinterGraphics extends ScaledGraphics {
3233

3334
Map<Image, Image> imageCache = new HashMap<>();

org.eclipse.draw2d/src/org/eclipse/draw2d/ScalableFreeformLayeredPane.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,25 @@ public class ScalableFreeformLayeredPane extends FreeformLayeredPane implements
2424

2525
private double scale = 1.0;
2626

27+
/**
28+
* @deprecated will be deleted after the 2028-03 release (see
29+
* {@link ScaledGraphics}).
30+
*/
31+
@Deprecated(forRemoval = true, since = "2026-03")
2732
private final boolean useScaledGraphics;
2833

2934
public ScalableFreeformLayeredPane() {
30-
this(true);
35+
this(false);
3136
}
3237

3338
/**
3439
* Constructor which allows to configure if scaled graphics should be used.
3540
*
3641
* @since 3.13
42+
* @deprecated will be deleted after the 2028-03 release (see
43+
* {@link ScaledGraphics}).
3744
*/
45+
@Deprecated(forRemoval = true, since = "2026-03")
3846
public ScalableFreeformLayeredPane(boolean useScaledGraphics) {
3947
this.useScaledGraphics = useScaledGraphics;
4048
}
@@ -97,7 +105,10 @@ public void setScale(double newZoom) {
97105

98106
/**
99107
* @since 3.13
108+
* @deprecated will be deleted after the 2028-03 release (see
109+
* {@link ScaledGraphics}).
100110
*/
111+
@Deprecated(forRemoval = true, since = "2026-03")
101112
@Override
102113
public boolean useScaledGraphics() {
103114
return useScaledGraphics;

org.eclipse.draw2d/src/org/eclipse/draw2d/ScalableLayeredPane.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,25 @@ public class ScalableLayeredPane extends LayeredPane implements IScalablePane {
2727

2828
private double scale = 1.0;
2929

30+
/**
31+
* @deprecated will be deleted after the 2028-03 release (see
32+
* {@link ScaledGraphics}).
33+
*/
34+
@Deprecated(forRemoval = true, since = "2026-03")
3035
private final boolean useScaledGraphics;
3136

3237
public ScalableLayeredPane() {
33-
this(true);
38+
this(false);
3439
}
3540

3641
/**
3742
* Constructor which allows to configure if scaled graphics should be used.
3843
*
3944
* @since 3.13
45+
* @deprecated will be deleted after the 2028-03 release (see
46+
* {@link ScaledGraphics}).
4047
*/
48+
@Deprecated(forRemoval = true, since = "2026-03")
4149
public ScalableLayeredPane(boolean useScaledGraphics) {
4250
this.useScaledGraphics = useScaledGraphics;
4351
}
@@ -104,7 +112,10 @@ public void setScale(double newZoom) {
104112

105113
/**
106114
* @since 3.13
115+
* @deprecated will be deleted after the 2028-03 release (see
116+
* {@link ScaledGraphics}).
107117
*/
118+
@Deprecated(forRemoval = true, since = "2026-03")
108119
@Override
109120
public boolean useScaledGraphics() {
110121
return useScaledGraphics;

org.eclipse.draw2d/src/org/eclipse/draw2d/ScalableLightweightSystem.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ public double getScale() {
7777
return scale;
7878
}
7979

80+
/**
81+
* @deprecated will be deleted after the 2028-03 release (see
82+
* {@link ScaledGraphics}).
83+
*/
84+
@Deprecated(forRemoval = true, since = "2026-03")
8085
@Override
8186
public boolean useScaledGraphics() {
82-
return true;
87+
return false;
8388
}
8489

8590
@Override

0 commit comments

Comments
 (0)