RFR: 6939: Time range indicator isn't updated when setting the time range

Alex Macdonald aptmac at openjdk.java.net
Fri Apr 9 15:39:27 UTC 2021


This PR addresses JMC-6939 [[0]](https://bugs.openjdk.java.net/browse/JMC-6939), in which the time range indicator does not update when setting a time range.

The issue here is that visible range of the chart is not updated when a new range is selected. In `onFlavorSelected()`, the table is updated with the new selection, but the chart is not. Here I've added a line to set the visible range with the new selection values. Additionally, I've tweaked the if-statement so that when "No Selection" is selected in the flavor selector the table & chart display the default selection. Previously if the "No Selection" option was selected after viewing a different selection, because `selectionItems` is null there would be no update to the table or chart; now it is really showing "No Selection".

There was also a problem with the time range indicator in the flavor selector not updating properly when a selection is chosen. The issue seems to be the `layout()` call not resulting in a redraw of the canvas, so it has been changed to `redraw()` instead.

[0] https://bugs.openjdk.java.net/browse/JMC-6939

### Gif examples:

**Before**
The table updates correctly, but the chart doesn't.
The flavor selector time range indicator doesn't redraw as expected.
![6939-before](https://user-images.githubusercontent.com/10425301/114095984-2051b080-988c-11eb-97a7-64f90465049d.gif)

**After**
The chart updates to the selected time range, and the flavor selector redraws as expected.
![6939-after](https://user-images.githubusercontent.com/10425301/114096008-2a73af00-988c-11eb-9a77-196bd47f9ef7.gif)

-------------

Commit messages:
 - 6939: Time range indicator isn't updated when setting the time range

Changes: https://git.openjdk.java.net/jmc/pull/238/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jmc&pr=238&range=00
  Issue: https://bugs.openjdk.java.net/browse/JMC-6939
  Stats: 17 lines in 3 files changed: 2 ins; 4 del; 11 mod
  Patch: https://git.openjdk.java.net/jmc/pull/238.diff
  Fetch: git fetch https://git.openjdk.java.net/jmc pull/238/head:pull/238

PR: https://git.openjdk.java.net/jmc/pull/238


More information about the jmc-dev mailing list