-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8345261: Refactor the Dimension2D classes #1653
base: master
Are you sure you want to change the base?
8345261: Refactor the Dimension2D classes #1653
Conversation
👋 Welcome back nlisker! A progress list of the required criteria for merging this PR into |
@nlisker This change is no longer ready for integration - check the PR body for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Thanks John. Because it's the weekend I'll wait until Monday evening with this. |
@azvegint Can you take a quick look at this since you added the Dimension class as part of your initial Wayland Robot fix? |
These 3 classes are all different from each other. They use different types of variables to store data ( We have Switching from So I would prefer to keep the |
Thanks @azvegint. If the |
I also looked at the uses of |
Not sure if it helps, but when working on #1462, I also found that inconsistencies. I'm not sure why this happens, but maybe worth to take a deeper look. |
I am fine with it. |
/reviewers 2 |
@kevinrushforth |
* The <code>Dimension2D</code> class is to encapsulate a width | ||
* and a height dimension. | ||
* <p> | ||
* A 2D dimension object that contains a width and a height. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe mention that this class uses float
s?
rectangle.width, | ||
rectangle.height | ||
)) | ||
.map(rectangle -> new Dimension2D(rectangle.width, rectangle.height)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the largest positive integer that can be stored in a float exactly is ~16M. we are fine here.
height = h; | ||
} | ||
} | ||
public record Dimension2D(float width, float height) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish this class was named differently to signify it's based on float...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the classes in this package are based on floats. As this is an internal class, adding a comment seems sufficient.
You reviewed the PR before the requested changes were made :) |
A small refactoring of the Dimension classes.
com.sun.javafx.geom.Dimension
was removed and its uses were replaced bycom.sun.javafx.geom.Dimension2D
.com.sun.javafx.geom.Dimension2D
became a record.javafx.geometry.Dimension2D
: fields becamefinal
.I'm not sure we need the implementation class at all considering we are free to use the public one.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1653/head:pull/1653
$ git checkout pull/1653
Update a local copy of the PR:
$ git checkout pull/1653
$ git pull https://git.openjdk.org/jfx.git pull/1653/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1653
View PR using the GUI difftool:
$ git pr show -t 1653
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1653.diff
Using Webrev
Link to Webrev Comment