# HG changeset patch # User Omair Majid # Date 1349796771 14400 # Node ID be076fc26f78ffdfe9e9eff64a647113ab183551 # Parent 3befd8ddad2f345d01518fd21111693fc47930a2 Only update Chart view when done updating model Update the chart in the Memory Analyzer view only when all the model updates are done. Otherwise each model update will redraw the UI even though the next model update will discard the previous result. Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2012-October/003678.html diff -r 3befd8ddad2f -r be076fc26f78 client/heapdumper/src/main/java/com/redhat/thermostat/client/heap/HeapDumpController.java --- a/client/heapdumper/src/main/java/com/redhat/thermostat/client/heap/HeapDumpController.java Thu Oct 04 17:35:18 2012 -0400 +++ b/client/heapdumper/src/main/java/com/redhat/thermostat/client/heap/HeapDumpController.java Tue Oct 09 11:32:51 2012 -0400 @@ -228,7 +228,6 @@ max =+ space.maxCapacity; } } - // model will automatically update view model.addData(memoryStats.getTimeStamp(), used, capacity); NumberFormat formatter = DecimalFormat.getInstance(); @@ -241,6 +240,8 @@ view.updateUsedAndCapacity(_used, _capacity); } + + model.notifyListenersOfModelChange(); } } } diff -r 3befd8ddad2f -r be076fc26f78 client/heapdumper/src/main/java/com/redhat/thermostat/client/heap/chart/OverviewChart.java --- a/client/heapdumper/src/main/java/com/redhat/thermostat/client/heap/chart/OverviewChart.java Thu Oct 04 17:35:18 2012 -0400 +++ b/client/heapdumper/src/main/java/com/redhat/thermostat/client/heap/chart/OverviewChart.java Tue Oct 09 11:32:51 2012 -0400 @@ -147,18 +147,25 @@ Millisecond millisecond = new Millisecond(new Date(timeStamp)); synchronized (lock) { if (this.total.getValue(millisecond) == null) { - this.total.add(millisecond, total); + this.total.add(millisecond, total, false); this.total.removeAgedItems(true); } if (this.used.getValue(millisecond) == null) { - this.used.add(millisecond, used); + this.used.add(millisecond, used, false); this.used.removeAgedItems(true); } } } + public void notifyListenersOfModelChange() { + synchronized (lock) { + this.total.fireSeriesChanged(); + this.used.fireSeriesChanged(); + } + } + public void setRange(int seconds) { total.setMaximumItemCount(seconds); used.setMaximumItemCount(seconds);