-
Notifications
You must be signed in to change notification settings - Fork 471
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
8293119: Additional constrained resize policies for Tree/TableView #897
8293119: Additional constrained resize policies for Tree/TableView #897
Conversation
👋 Welcome back angorya! A progress list of the required criteria for merging this PR into |
modules/javafx.controls/src/main/java/javafx/scene/control/TableView.java
Show resolved
Hide resolved
@andy-goryachev-oracle this pull request can not be integrated into git checkout 8293119.constrained
git fetch https://git.openjdk.org/jfx master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
OK, that makes complete sense to me, and is, I agree, a better choice. We might consider a follow-up doc bug to clarify this, but it isn't critical. I also don't think the remaining HiDPI issue is critical, so that also could be a follow-up. I'll continue testing it, and also review the code. |
I'm also seeing the mouse cursor tracking issue mentioned by Kevin while dragging the column divider. I wanted to check about following behavior. I ran these test in Windows 11 system. I will try to do some more testing on the same machine. |
thank you for testing, @karthikpandelu ! not really, the idea of providing several different policies with different behavior is that the app developer can choose the one that fits the requirements best. AUTO_RESIZE_ALL_COLUMNS tries to allocate extra space proportionally to the preferred width of each column, so the behavior you are describing is expected. |
Understood. Thanks for the clarification. |
I realized that, in presence of snapping and fractional scale, the implemented algorithm would never work correctly. The reason is that the distance between snapped positions is not the same. As a result, changing a single column width requires shifting of subsequent or all the columns, which in turn might require a change in their widths, and so on. This makes me think that a different algorithm might be needed, a simulated annealing perhaps. |
Can you file a follow-on bug so we don't lose track of it? It doesn't need to be fixed for JavaFX 20, but it would be good to fix it when we can. |
Logged two follow-up tickets: JDK-8299753 Tree/TableView: Column Resizing With Fractional Scale JDK-8299755 Tree/TableView: Cursor Decouples From Divider When Resizing With Fractional Scale |
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 did some additional testing, and other than the minor issues already identified with fractional screen scales (and tracked by follow-up bugs), everything looks good.
I left a few mostly minor comments inline. The only thing I'd definitely like to see is at least some testing of TreeTableView
.
modules/javafx.controls/src/test/java/test/javafx/scene/control/ResizeHelperTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/test/java/test/javafx/scene/control/ResizeHelperTest.java
Outdated
Show resolved
Hide resolved
tests/manual/tester/src/com/oracle/javafx/tester/ATableViewResizeTester.java
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ResizeHelper.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ResizeHelper.java
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ResizeHelper.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/ResizeHelper.java
Outdated
Show resolved
Hide resolved
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 with one minor formatting comment inline. I'll reapprove if you fix it.
modules/javafx.controls/src/test/java/test/javafx/scene/control/ResizeHelperTestBase.java
Show resolved
Hide resolved
@aghaisas could you take a final look at this please? |
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 have tested on macOS. This looks good!
@andy-goryachev-oracle This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 1ac97fc.
Your commit was automatically rebased without conflicts. |
@andy-goryachev-oracle Pushed as commit 1ac97fc. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The current CONSTRAINED_RESIZE_POLICY has a number of issues as explained in JDK-8292810.
We propose to address all these issues by replacing the old column resize algorithm with a different one, which not only honors all the constraints when resizing, but also provides 4 different resize modes similar to JTable's. The new implementation brings changes to the public API for Tree/TableView and ResizeFeaturesBase classes. Specifically:
Notes
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/897/head:pull/897
$ git checkout pull/897
Update a local copy of the PR:
$ git checkout pull/897
$ git pull https://git.openjdk.org/jfx pull/897/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 897
View PR using the GUI difftool:
$ git pr show -t 897
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/897.diff