Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@

- Added new PrecisionPointList class. This class was created during the previous
release and has now been finalized.
- **Deprecated ScaledGraphics**
*To be removed after 2028-03 release*
All scaling needs for Draw2d can be handled by SWT natively and there are several issues in the implementation of
ScaledGraphics. Therefore, use `SWTGraphics` instead.

As part of this deprecation also all methods and flags allowing to switch to between `SWTGraphics` and
`ScaledGraphics` are deprecated and the default behavior is changed to use `SWTGraphics`.

**Action Required:** If your application depends on `ScaledGraphics` you need to actively switch it on for the following classes:
- ScaleableFreeformLayeredPane
- ScalableFreeformRootEditPart
- ScalableLayeredPane
- ScalableRootEditPart
- ScalableLightweightSystem

## GEF

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

@SuppressWarnings("removal")
public class ScaledGraphicsTest {

static Stream<Arguments> singleValueTestCombinations() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
public class AutoscaleFreeformViewport extends FreeformViewport {

@SuppressWarnings("removal")
public AutoscaleFreeformViewport(boolean useScaledGraphics) {
super.setContents(new ScalableFreeformLayeredPane(useScaledGraphics));
}
Expand Down
6 changes: 6 additions & 0 deletions org.eclipse.draw2d/src/org/eclipse/draw2d/IScalablePane.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
*/
public interface IScalablePane extends ScalableFigure {

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

boolean optimizeClip();
Expand All @@ -42,6 +47,7 @@ public default Rectangle getScaledRect(Rectangle rect) {
return rect;
}

@SuppressWarnings("removal")
public static final class IScalablePaneHelper {

private static Graphics prepareScaledGraphics(final Graphics graphics, IScalablePane figurePane) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*
* @author danlee
*/
@SuppressWarnings("removal")
public class PrinterGraphics extends ScaledGraphics {

Map<Image, Image> imageCache = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,25 @@ public class ScalableFreeformLayeredPane extends FreeformLayeredPane implements

private double scale = 1.0;

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

public ScalableFreeformLayeredPane() {
this(true);
this(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember there being issues with the Logic editor when scaling with a plain SWTGraphics object. I'd have to double-check if this is still the case, but I would prefer to not change the default behavior when this already causes issues for our examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember too. That is also my hesitation in my comment above. However I thought we could change it now early so that we find such problems and can address them and if we can not address them we can still change it back in M3 or RC1. Similar to the native scaling flag we introduced in the last cycle.

}

/**
* Constructor which allows to configure if scaled graphics should be used.
*
* @since 3.13
* @deprecated will be deleted after the 2028-03 release (see
* {@link ScaledGraphics}).
*/
@Deprecated(forRemoval = true, since = "2026-03")
public ScalableFreeformLayeredPane(boolean useScaledGraphics) {
this.useScaledGraphics = useScaledGraphics;
}
Expand Down Expand Up @@ -97,7 +105,10 @@ public void setScale(double newZoom) {

/**
* @since 3.13
* @deprecated will be deleted after the 2028-03 release (see
* {@link ScaledGraphics}).
*/
@Deprecated(forRemoval = true, since = "2026-03")
@Override
public boolean useScaledGraphics() {
return useScaledGraphics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,25 @@ public class ScalableLayeredPane extends LayeredPane implements IScalablePane {

private double scale = 1.0;

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

public ScalableLayeredPane() {
this(true);
this(false);
}

/**
* Constructor which allows to configure if scaled graphics should be used.
*
* @since 3.13
* @deprecated will be deleted after the 2028-03 release (see
* {@link ScaledGraphics}).
*/
@Deprecated(forRemoval = true, since = "2026-03")
public ScalableLayeredPane(boolean useScaledGraphics) {
this.useScaledGraphics = useScaledGraphics;
}
Expand Down Expand Up @@ -104,7 +112,10 @@ public void setScale(double newZoom) {

/**
* @since 3.13
* @deprecated will be deleted after the 2028-03 release (see
* {@link ScaledGraphics}).
*/
@Deprecated(forRemoval = true, since = "2026-03")
@Override
public boolean useScaledGraphics() {
return useScaledGraphics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ public double getScale() {
return scale;
}

/**
* @deprecated will be deleted after the 2028-03 release (see
* {@link ScaledGraphics}).
*/
@Deprecated(forRemoval = true, since = "2026-03")
@Override
public boolean useScaledGraphics() {
return true;
return false;
}

@Override
Expand Down
Loading
Loading