diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index b4b01984db1f17364021cb1f18f26f911fdd9b66..4c378d7b55604eb97a99107bb1bb7428a4b83495 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -69,6 +69,7 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState; import org.sleuthkit.autopsy.imagegallery.gui.NoGroupsDialog; import org.sleuthkit.autopsy.imagegallery.gui.Toolbar; +import org.sleuthkit.autopsy.imagegallery.gui.navpanel.NavPanel; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; @@ -138,6 +139,7 @@ public static synchronized ImageGalleryController getDefault() { private Node infoOverlay; private SleuthkitCase sleuthKitCase; + private NavPanel navPanel; public ReadOnlyBooleanProperty getMetaDataCollapsed() { return metaDataCollapsed.getReadOnlyProperty(); @@ -218,7 +220,7 @@ private ImageGalleryController() { groupManager.getUnSeenGroups().addListener((Observable observable) -> { //if there are unseen groups and none being viewed if (groupManager.getUnSeenGroups().isEmpty() == false && (getViewState() == null || getViewState().getGroup() == null)) { - advance(GroupViewState.tile(groupManager.getUnSeenGroups().get(0))); + advance(GroupViewState.tile(groupManager.getUnSeenGroups().get(0)), true); } }); @@ -246,8 +248,12 @@ public ReadOnlyBooleanProperty getCanRetreat() { return historyManager.getCanRetreat(); } - public void advance(GroupViewState newState) { + public void advance(GroupViewState newState, boolean forceShowTree) { + if (Objects.nonNull(navPanel) && forceShowTree) { + navPanel.showTree(); + } historyManager.advance(newState); + } public GroupViewState advance() { @@ -440,13 +446,15 @@ void onStart() { case CONTENT_CHANGED: //TODO: do we need to do anything here? -jm case DATA_ADDED: - /* we could listen to DATA events and progressivly - * update files, and get data from DataSource ingest - * modules, but given that most modules don't post new - * artifacts in the events and we would have to query for - * them, without knowing which are the new ones, we just - * ignore these events for now. The relevant data should all - * be captured by file done event, anyways -jm */ + /* + * we could listen to DATA events and progressivly update + * files, and get data from DataSource ingest modules, but + * given that most modules don't post new artifacts in the + * events and we would have to query for them, without + * knowing which are the new ones, we just ignore these + * events for now. The relevant data should all be captured + * by file done event, anyways -jm + */ break; case FILE_DONE: /** @@ -523,6 +531,10 @@ public DrawableTagsManager getTagsManager() { return tagsManager; } + public void setNavPanel(NavPanel navPanel) { + this.navPanel = navPanel; + } + // @@@ REVIEW IF THIS SHOLD BE STATIC... //TODO: concept seems like the controller deal with how much work to do at a given time // @@@ review this class for synchronization issues (i.e. reset and cancel being called, add, etc.) @@ -844,8 +856,8 @@ public void run() { } /** - * task that does pre-ingest copy over of files from a new datasource - * (uses fs_obj_id to identify files from new datasource) * + * task that does pre-ingest copy over of files from a new datasource (uses + * fs_obj_id to identify files from new datasource) * * * TODO: create methods to simplify progress value/text updates to both * netbeans and ImageGallery progress/status @@ -881,9 +893,11 @@ public void run() { progressHandle.start(); updateMessage("prepopulating image/video database"); - /* Get all "drawable" files, based on extension. After ingest we use + /* + * Get all "drawable" files, based on extension. After ingest we use * file type id module and if necessary jpeg signature matching to - * add/remove files */ + * add/remove files + */ final List<AbstractFile> files; try { List<Long> fsObjIds = new ArrayList<>(); @@ -896,11 +910,13 @@ public void run() { } fsQuery = "(fs_obj_id = " + StringUtils.join(fsObjIds, " or fs_obj_id = ") + ") "; } else { - /* NOTE: Logical files currently (Apr '15) have a null - * value for fs_obj_id in DB. for them, we will not specify - * a fs_obj_id, which means we will grab files from another + /* + * NOTE: Logical files currently (Apr '15) have a null value + * for fs_obj_id in DB. for them, we will not specify a + * fs_obj_id, which means we will grab files from another * data source, but the drawable DB is smart enough to - * de-dupe them. */ + * de-dupe them. + */ fsQuery = "(fs_obj_id IS NULL) "; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java index 658e523be97aac6b33f093b081d04a8f5290d8a3..a2669cf3dfce53f9bbd0747ee71bf3f5bc3aaaf2 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryTopComponent.java @@ -35,11 +35,11 @@ import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.imagegallery.gui.drawableviews.GroupPane; -import org.sleuthkit.autopsy.imagegallery.gui.drawableviews.MetaDataPane; import org.sleuthkit.autopsy.imagegallery.gui.StatusBar; import org.sleuthkit.autopsy.imagegallery.gui.SummaryTablePane; import org.sleuthkit.autopsy.imagegallery.gui.Toolbar; +import org.sleuthkit.autopsy.imagegallery.gui.drawableviews.GroupPane; +import org.sleuthkit.autopsy.imagegallery.gui.drawableviews.MetaDataPane; import org.sleuthkit.autopsy.imagegallery.gui.navpanel.NavPanel; /** @@ -158,6 +158,7 @@ public ImageGalleryTopComponent() { splitPane.setDividerPositions(0.0, 1.0); ImageGalleryController.getDefault().setStacks(fullUIStack, centralStack); + ImageGalleryController.getDefault().setNavPanel(navPanel); }); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java index 6a68810457825a16ce6dbfa416fc8ddb6eebfc90..95199f4bbf070cf1cbdf51f18023bd8a6c5d238e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/NextUnseenGroup.java @@ -68,7 +68,7 @@ public NextUnseenGroup(ImageGalleryController controller) { .ifPresent(group -> controller.getGroupManager().markGroupSeen(group, true)); if (false == controller.getGroupManager().getUnSeenGroups().isEmpty()) { - controller.advance(GroupViewState.tile(controller.getGroupManager().getUnSeenGroups().get(0))); + controller.advance(GroupViewState.tile(controller.getGroupManager().getUnSeenGroups().get(0)), true); } updateButton(); }); diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.fxml b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.fxml index 27132629fa649f578f429b5c72bd135060750134..6ba6abe0a177b137cb7ef28e38b3a1f41a1073df 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.fxml +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.fxml @@ -6,10 +6,9 @@ <?import javafx.scene.image.*?> <?import javafx.scene.layout.*?> - - <fx:root fx:id="navTabPane" maxHeight="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" tabClosingPolicy="UNAVAILABLE" type="TabPane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> +<fx:root fx:id="navTabPane" maxHeight="1.7976931348623157E308" prefHeight="-1.0" prefWidth="-1.0" tabClosingPolicy="UNAVAILABLE" type="TabPane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> <tabs> - <Tab fx:id="navTab" text="Contents"> + <Tab fx:id="navTab" text="All Groups"> <content> <AnchorPane prefHeight="-1.0" prefWidth="-1.0"> <children> @@ -25,7 +24,7 @@ </ImageView> </graphic> </Tab> - <Tab fx:id="hashTab" text="Hash Hits"> + <Tab fx:id="hashTab" text="Groups With Hash Hits"> <content> <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="-1.0" prefWidth="-1.0"> <children> 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 d00f28cea8001952d3c19f0d6f39c2ec9c6b8158..f3416e41d65f0581175845fbfa6bb009f929130c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/NavPanel.java @@ -18,10 +18,8 @@ */ package org.sleuthkit.autopsy.imagegallery.gui.navpanel; -import java.net.URL; import java.util.Arrays; import java.util.List; -import java.util.ResourceBundle; import javafx.application.Platform; import javafx.beans.Observable; import javafx.beans.property.SimpleObjectProperty; @@ -57,12 +55,6 @@ */ public class NavPanel extends TabPane { - @FXML - private ResourceBundle resources; - - @FXML - private URL location; - /** * TreeView for folders with hash hits */ @@ -212,7 +204,7 @@ private void rebuildTrees() { private void updateControllersGroup() { final TreeItem<TreeNode> selectedItem = activeTreeProperty.get().getSelectionModel().getSelectedItem(); if (selectedItem != null && selectedItem.getValue() != null && selectedItem.getValue().getGroup() != null) { - controller.advance(GroupViewState.tile(selectedItem.getValue().getGroup())); + controller.advance(GroupViewState.tile(selectedItem.getValue().getGroup()), false); } } @@ -233,14 +225,15 @@ public void setFocusedGroup(DrawableGroup grouping) { final GroupTreeItem treeItemForGroup = ((GroupTreeItem) activeTreeProperty.get().getRoot()).getTreeItemForPath(path); if (treeItemForGroup != null) { - /* When we used to run the below code on the FX thread, it would - * get into infinite loops when the next group button was pressed + /* + * When we used to run the below code on the FX thread, it would get + * into infinite loops when the next group button was pressed * quickly because the udpates became out of order and History could - * not - * keep track of what was current. + * not keep track of what was current. * * Currently (4/2/15), this method is already on the FX thread, so - * it is OK. */ + * it is OK. + */ //Platform.runLater(() -> { TreeItem<TreeNode> ti = treeItemForGroup; while (ti != null) { @@ -316,4 +309,8 @@ private void initHashTree() { }); } } + + public void showTree() { + getSelectionModel().select(navTab); + } }