Conversation
|
Thank you for informing us, @azoitl. We definitely see the benefits in SWTGraphics and would like to migrate sooner than later. We are constantly evaluating the possibility to switch from ScaledGraphics to SWTGraphics but we have so much customization implemented on top of it and so many higher priority stuff to do that we do not know yet whether that switch will be feasible for us, both technically and in terms of effort. And even if it will, we will probably not manage to perform that switch anytime soon (quite sure not until 2028-03). |
|
@HeikoKlare I undestand your concerns and that is also the reason I wanted your feedback here. I definitely don't want to drive you into a situation where you have to do a full fork of GEF Classic. I think that would harm us both. Before discussing dates and when really to remove If me analysis is correct then you could just copy Aside from that I'm not sure what would be a good switching time. Maybe 2028-03 was to optimistic and early. I'm open to discuss this. Also I one thing that I did with this PR is to switch the default from |
|
To provide some additional context: The deprecation has been proposed quite some time ago with Bug 442442 - Deprecate ScaledGraphics, make native scaling the default. The purpose of this class is to enable scaling on operating systems that don't support advanced mode. This should no longer be a concern:
However, I think it has become clear that this class can also be used (some might say misused) in a different context. I'm not sure if also marking it as "for removal" is the best approach, especially because we already know that our own editor examples rely on some of the side effects of the Deprecating sounds fine to be but I think we should first make sure that we don't depend on it ourselves, before we start telling other projects to move away from it. |
|
|
||
| public ScalableFreeformLayeredPane() { | ||
| this(true); | ||
| this(false); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
I think it makes sense to focus on one thing at a time. So for now, I would propose to only deprecated the |
Good point. Will remove this change and later look into how @Phillipus is doing this in Archi. Because this was the driver of the original API change around |
Mine is a bit of hack, see https://github.com/archimatetool/archi/blob/a033f986cf68ff3f5659ab7d9c5c3a11631ff3b2/org.eclipse.draw2d/src/org/eclipse/draw2d/PrintOperation.java#L31 (I need to align my hacked fork of GEF/Draw2d with the latest version sometime next year) |
|
I found that |
01f5997 to
3b1dc49
Compare
|
@Phillipus thx for the feedback. Removed the deprecation from |
This removes the usage of the soon-to-be deprecated `ScaledGraphics` in both the `PathExample` and `ZoomExample`. For the `ZoomExample`, the old GIF icons have been converted to PNG/SVG. Contributes to eclipse-gef#901
This removes the usage of the soon-to-be deprecated `ScaledGraphics` in both the `PathExample` and `ZoomExample`. For the `ZoomExample`, the old GIF icons have been converted to PNG/SVG. Contributes to #901
3b1dc49 to
f75ff49
Compare
f75ff49 to
45f5405
Compare
The method `getAbsoluteScaled()` is defined in the `Graphics` class and returns `1.0` by default. A type-check for `ScaledGraphics` is therefore not needed. Contributes to eclipse-gef#901
The method `getAbsoluteScaled()` is defined in the `Graphics` class and returns `1.0` by default. A type-check for `ScaledGraphics` is therefore not needed. Contributes to #901
45f5405 to
2042be2
Compare
05b269f to
28bad93
Compare
All scaling needs for Draw2d can be handled by SWT natively and there are several issues in the implementation of ScaledGraphics.
28bad93 to
b3c1b88
Compare
|
Thank you again for letting us know and asking for feedback in advance!
I did not check yet but I am quite sure that it is true that we could just integrate the parts we need from I will share the information about the intent to possibly remove |
| ScrollingGraphicalViewer viewer = (ScrollingGraphicalViewer) getGraphicalViewer(); | ||
|
|
||
| ScalableFreeformRootEditPart rootEP = new ScalableFreeformRootEditPart(true); | ||
| ScalableFreeformRootEditPart rootEP = new ScalableFreeformRootEditPart(); |
There was a problem hiding this comment.
@ptziegler just found by accident that at least the LogicEditor does not look correct with monitor scaling (e.g., 150%) anymore.
This is how it should look:

And this is how it actually looks now:

When I revert this change to initialize the root edit part for the LogicEditor with ScaledGraphics again, the issue is fixed.
There was a problem hiding this comment.
I remember mentioning the problem here as well: #824 (comment)
There are two problems, actually:
The first one is the improper placement of the figures, which is because the SWTGraphics class is using an Transform object for scaling. You can get the same issue at 100% monitor zoom by changing the editor zoom to e.g. 400%, so it's a general issue.
I'm not able to reproduce this on Linux, so I'm not sure yet whether this is an inconsistency on the Draw2D or the SWT side.
The second one is a side-effect introduced by enabling advanced scaling. Normally, the feedback figure should be transparent, but this is never explicitly set (in fact. getAlpha() returns 255). When advanced mode is enabled this causes the feedback figures to always be drawn opaque.
|
I currently try to adapt our product to
The first one produces some effort and for the second I am not even sure how one could use the @ptziegler the Changelog file mentiones the classes for which the default configuration has been changed but does not propose a strategy how to switch back to |
|
@HeikoKlare thx for your analysis. It looks that my initial proposal of switching the default to SWTGraphics was to radical. What I could over to reduce the effort for now is to change the default back to use ScaledGraphics and still allow clients to opt out of ScaledGraphics. But keep ScaledGraphics deprecated. |
|
I remember bringing up the same concern. My understanding was that we try out switchting to
To be honest, I haven't put much thought into the migration step, primarily because I don't really have dog in this fight. |
And with @HeikoKlare's feedback we achieved my goal.
As long as I can easily switch the major parts to |
|
I hope I didn't produce any confusion with the I understand that I did not miss any specific, existing idea how to switch back to |
|
It seems to be quite impossible to make every single place configurable. Just as an example, the A more relevant case might be the So I wonder if it might not be helpful to have a global switch for the default |
All scaling needs for Draw2d can be handled by SWT natively and there are several issues in the implementation of ScaledGraphics.
FYI @HeikoKlare, @akoch-yatta