RFR: JMC-6368: Foldable threads table in the Threads page
Alex Macdonald
almacdon at redhat.com
Thu Jun 27 13:57:50 UTC 2019
On Fri, May 10, 2019 at 2:16 PM Alex Macdonald <almacdon at redhat.com> wrote:
> Hi,
>
> The following webrev [0] addresses issue JMC-6368 [1], in which the user
> should be able to fold away the table and graph on the Threads page to
> reclaim screen real-estate.
>
Webrev: http://cr.openjdk.java.net/~aptmac/JMC-6368/webrev.01
Please see the above webrev for an updated version of this patch. While the
previous implementation worked in Linux, I started running into problems
when running the same patch on Windows.
The first issue was that I had the toolbar buttons enable/disable
themselves to prevent the user from folding away both the chart and the
table, however having a button be both selected & disabled is not possible
in Windows.
The second issue had to do with layouts. There's a specific use case where
if the sash weight for a component is 0 (i.e., it's folded), the user can
still click the sash itself to make the component visible. As a result, I
needed to put an actionlistener on the sash to detect these events so the
toolbar buttons can be reset accordingly. The sash itself is not built
until the children are added and layout() is called, but what stumped me
for so long was that in Linux everything would get laid out as expected,
but in Windows there was a gaping whitespace to the right of the page that
only existed until the page was resized/redrawn. The solution was to
dispose of the chart legend before calling layout() (which makes sense),
but I'm still a bit confused as to why this looked fine on Linux but not in
Windows.
> I had previously attached two proof-of-concept gifs to the JIRA issue [1],
> and after discussion on Slack it looked like taking the route of POC2
> (adding toolbar actions along side existing page controls) was the short
> term win, and that POC1 (UI components collapsing into a vertical bar of
> some sort) should be investigated as it's own issue and potentially
> implemented across the UI. This patch introduces two selectable items to
> the toolbar which allow the user to expand either the table or graph to
> fill the screen, and then fold away the other component. In a way to
> prevent both components from being folded away (and viewing nothing) there
> are controls to disable toolbar items when only 1 component is visible (one
> is already folded), and enable them when both are visible (and one can be
> folded away).
>
> I've included a couple of screen shots that display the page with:
> - both the table and graph visible [2]
> - the table folded and the graph visible [3]
> - the graph folded and the table visible [4]
>
> and a couple of gifs to show
> - the general flow of the controls [5]
> - the folds persisting a reload of the jfr file [6]
>
> I wrote a couple of uitests that verify some behaviour by interacting with
> the toolbar items and verifying the weights of the SashForm; passing Travis
> build available [7]
>
I've included a couple more uitests, and the build looks ok on both Linux &
Windows.
Passing Travis CI log: https://api.travis-ci.org/v3/job/550842345/log.txt
>
> Thoughts?
>
> Cheers,
>
> Alex
>
> [0] http://cr.openjdk.java.net/~aptmac/JMC-6368/webrev.00/
> [1] https://bugs.openjdk.java.net/browse/JMC-6368
> [2] https://imgur.com/XW99H5L
> [3] https://imgur.com/d0d7Wln
> [4] https://imgur.com/ibPgaWw
> [5] https://imgur.com/QZzZZUN
> [6] https://imgur.com/gUNfpTX
> [7] https://travis-ci.org/aptmac/jmc-qa/builds/530418716
>
More information about the jmc-dev
mailing list