diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index f8b5c9e808..b726fb7ba0 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -703,12 +703,12 @@ public class GroupManager { DrawableAttribute attributeOfCurrentGroup = viewedKey.map(GroupKey::getAttribute) .orElse(null); - /* if no group or if groupbies are different or if data * source != null and does not equal group */ if (viewedGroup.isPresent() == false || (getDataSource() != null && notEqual(dataSourceOfCurrentGroup, getDataSource())) || getGroupBy() != attributeOfCurrentGroup) { + //the current group should not be visible so ... if (isNotEmpty(unSeenGroups)) {// show then next unseen group controller.advance(GroupViewState.tile(unSeenGroups.get(0))); @@ -718,7 +718,7 @@ public class GroupManager { } else { //there are no groups, clear the group area. controller.advance(GroupViewState.tile(null)); } - } //else, the current group is for the given datasource, so just keep it in view. + } } } finally { groupProgress.finish(); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java index 33cd84916f..66736ab2f9 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTree.java @@ -38,6 +38,7 @@ import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.DrawableGroup; +import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; /** * Shows path based groups as a tree and others kinds of groups as a flat list ( @@ -82,7 +83,12 @@ final public class GroupTree extends NavPanel> { change.getAddedSubList().stream().forEach(this::insertGroup); change.getRemoved().stream().forEach(this::removeFromTree); } - Platform.runLater(this::sortGroups); + Platform.runLater(() -> { + GroupTree.this.sortGroups(); + Optional.ofNullable(getController().getViewState()) + .flatMap(GroupViewState::getGroup) + .ifPresent(this::setFocusedGroup); + }); }); getGroupManager().getAnalyzedGroups().forEach(this::insertGroup); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.java index f8544056e5..aa3af58b78 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.java @@ -92,11 +92,10 @@ abstract class NavPanel extends Tab { //keep selection in sync with controller controller.viewStateProperty().addListener(observable -> { - Platform.runLater(() -> { - Optional.ofNullable(controller.getViewState()) - .flatMap(GroupViewState::getGroup) - .ifPresent(this::setFocusedGroup); - }); + Platform.runLater(() + -> Optional.ofNullable(controller.getViewState()) + .flatMap(GroupViewState::getGroup) + .ifPresent(this::setFocusedGroup)); }); // notify controller about group selection in this view