From 885c43a18299a7c5fa34310d3a5f60ea16361978 Mon Sep 17 00:00:00 2001 From: jmillman Date: Thu, 4 Sep 2014 10:11:09 -0400 Subject: [PATCH] put header string update on jfx thread --- .../autopsy/imageanalyzer/gui/GroupPane.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/GroupPane.java b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/GroupPane.java index 1192b08a42..bd3f75e948 100644 --- a/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/GroupPane.java +++ b/ImageAnalyzer/src/org/sleuthkit/autopsy/imageanalyzer/gui/GroupPane.java @@ -308,7 +308,9 @@ public class GroupPane extends BorderPane implements GroupView { */ protected void resetHeaderString() { if (grouping.get() == null) { - groupLabel.setText(""); + Platform.runLater(() -> { + groupLabel.setText(""); + }); } else { int size = grouping.get().getSize(); int hashHitCount = grouping.get().getFilesWithHashSetHitsCount(); @@ -318,7 +320,10 @@ public class GroupPane extends BorderPane implements GroupView { } else { groupName = grouping.get().groupKey.getValue().toString(); } - groupLabel.setText(StringUtils.defaultIfBlank(groupName, Grouping.UNKNOWN) + " -- " + hashHitCount + " hash set hits / " + size + " files"); + final String headerString = StringUtils.defaultIfBlank(groupName, Grouping.UNKNOWN) + " -- " + hashHitCount + " hash set hits / " + size + " files"; + Platform.runLater(() -> { + groupLabel.setText(headerString); + }); } } @@ -356,12 +361,12 @@ public class GroupPane extends BorderPane implements GroupView { //and assign fileIDs to gridView if (grouping.get() == null) { Platform.runLater(gridView.getItems()::clear); - + } else { Platform.runLater(() -> { gridView.setItems(grouping.get().fileIds()); }); - grouping.get().fileIds().addListener((Observable p) -> { + grouping.get().fileIds().addListener((Observable p) -> { resetHeaderString(); }); }