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

Marcus Hirt hirt at openjdk.java.net
Fri Apr 9 16:39:09 UTC 2021


On Fri, 9 Apr 2021 15:35:34 GMT, Alex Macdonald <aptmac at openjdk.org> wrote:

> 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)

Marked as reviewed by hirt (Lead).

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

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


More information about the jmc-dev mailing list