mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Merge pull request #852 from millmanorama/fix_tree_population_existing_case
populate tree view when opening an existing case, tweak fxml
This commit is contained in:
commit
12c6618b76
@ -17,6 +17,6 @@ public @interface ThreadConfined {
|
|||||||
|
|
||||||
public enum ThreadType {
|
public enum ThreadType {
|
||||||
|
|
||||||
ANY, UI, NOT_UI
|
ANY, UI, JFX, AWT, NOT_UI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,8 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
|||||||
import org.sleuthkit.autopsy.imageanalyzer.EurekaController;
|
import org.sleuthkit.autopsy.imageanalyzer.EurekaController;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.EurekaModule;
|
import org.sleuthkit.autopsy.imageanalyzer.EurekaModule;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.LoggedTask;
|
import org.sleuthkit.autopsy.imageanalyzer.LoggedTask;
|
||||||
|
import org.sleuthkit.autopsy.imageanalyzer.ThreadConfined;
|
||||||
|
import org.sleuthkit.autopsy.imageanalyzer.ThreadConfined.ThreadType;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.datamodel.Category;
|
import org.sleuthkit.autopsy.imageanalyzer.datamodel.Category;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.datamodel.DrawableAttribute;
|
import org.sleuthkit.autopsy.imageanalyzer.datamodel.DrawableAttribute;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.datamodel.DrawableDB;
|
import org.sleuthkit.autopsy.imageanalyzer.datamodel.DrawableDB;
|
||||||
@ -74,12 +76,15 @@ public class GroupManager {
|
|||||||
private final Map<GroupKey, Grouping> groupMap = new HashMap<>();
|
private final Map<GroupKey, Grouping> groupMap = new HashMap<>();
|
||||||
|
|
||||||
/** list of all analyzed groups */
|
/** list of all analyzed groups */
|
||||||
|
@ThreadConfined(type = ThreadType.JFX)
|
||||||
private final ObservableList<Grouping> analyzedGroups = FXCollections.observableArrayList();
|
private final ObservableList<Grouping> analyzedGroups = FXCollections.observableArrayList();
|
||||||
|
|
||||||
/** list of unseen groups */
|
/** list of unseen groups */
|
||||||
|
@ThreadConfined(type = ThreadType.JFX)
|
||||||
private final ObservableList<Grouping> unSeenGroups = FXCollections.observableArrayList();
|
private final ObservableList<Grouping> unSeenGroups = FXCollections.observableArrayList();
|
||||||
|
|
||||||
/** sorted list of unseen groups */
|
/** sorted list of unseen groups */
|
||||||
|
@ThreadConfined(type = ThreadType.JFX)
|
||||||
private final SortedList<Grouping> sortedUnSeenGroups = unSeenGroups.sorted();
|
private final SortedList<Grouping> sortedUnSeenGroups = unSeenGroups.sorted();
|
||||||
|
|
||||||
private ReGroupTask groupByTask;
|
private ReGroupTask groupByTask;
|
||||||
@ -100,6 +105,7 @@ public class GroupManager {
|
|||||||
return analyzedGroups;
|
return analyzedGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ThreadConfined(type = ThreadType.JFX)
|
||||||
public SortedList<Grouping> getUnSeenGroups() {
|
public SortedList<Grouping> getUnSeenGroups() {
|
||||||
return sortedUnSeenGroups;
|
return sortedUnSeenGroups;
|
||||||
}
|
}
|
||||||
@ -542,14 +548,19 @@ public class GroupManager {
|
|||||||
if (groupByTask != null) {
|
if (groupByTask != null) {
|
||||||
groupByTask.cancel(true);
|
groupByTask.cancel(true);
|
||||||
}
|
}
|
||||||
sortedUnSeenGroups.setComparator(sortBy.getGrpComparator(groupBy, sortOrder));
|
Platform.runLater(() -> {
|
||||||
|
sortedUnSeenGroups.setComparator(sortBy.getGrpComparator(groupBy, sortOrder));
|
||||||
|
});
|
||||||
|
|
||||||
groupByTask = new ReGroupTask(groupBy, sortBy, sortOrder);
|
groupByTask = new ReGroupTask(groupBy, sortBy, sortOrder);
|
||||||
controller.submitBGTask(groupByTask);
|
controller.submitBGTask(groupByTask);
|
||||||
} else {
|
} else {
|
||||||
// just resort the list of groups
|
// just resort the list of groups
|
||||||
setSortBy(sortBy);
|
setSortBy(sortBy);
|
||||||
setSortOrder(sortOrder);
|
setSortOrder(sortOrder);
|
||||||
sortedUnSeenGroups.setComparator(sortBy.getGrpComparator(groupBy, sortOrder));
|
Platform.runLater(() -> {
|
||||||
|
sortedUnSeenGroups.setComparator(sortBy.getGrpComparator(groupBy, sortOrder));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
<?import javafx.scene.image.*?>
|
<?import javafx.scene.image.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
<fx:root id="BorderPane" maxHeight="-1.0" maxWidth="-1.0" minHeight="-1.0" minWidth="200.0" prefHeight="-1.0" prefWidth="-1.0" type="javafx.scene.layout.BorderPane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
|
|
||||||
<center>
|
<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">
|
||||||
<TabPane fx:id="navTabPane" prefHeight="-1.0" prefWidth="-1.0" tabClosingPolicy="UNAVAILABLE">
|
|
||||||
<tabs>
|
<tabs>
|
||||||
<Tab fx:id="navTab" text="Contents">
|
<Tab fx:id="navTab" text="Contents">
|
||||||
<content>
|
<content>
|
||||||
@ -63,6 +62,4 @@
|
|||||||
</graphic>
|
</graphic>
|
||||||
</Tab>
|
</Tab>
|
||||||
</tabs>
|
</tabs>
|
||||||
</TabPane>
|
</fx:root>
|
||||||
</center>
|
|
||||||
</fx:root>
|
|
||||||
|
@ -39,7 +39,6 @@ import javafx.scene.control.Tab;
|
|||||||
import javafx.scene.control.TabPane;
|
import javafx.scene.control.TabPane;
|
||||||
import javafx.scene.control.TreeItem;
|
import javafx.scene.control.TreeItem;
|
||||||
import javafx.scene.control.TreeView;
|
import javafx.scene.control.TreeView;
|
||||||
import javafx.scene.layout.BorderPane;
|
|
||||||
import javafx.scene.layout.Priority;
|
import javafx.scene.layout.Priority;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -62,7 +61,7 @@ import org.sleuthkit.datamodel.TskCoreException;
|
|||||||
* with images. the user can select folders with images to see them in the
|
* with images. the user can select folders with images to see them in the
|
||||||
* main GroupPane The other shows folders with hash set hits.
|
* main GroupPane The other shows folders with hash set hits.
|
||||||
*/
|
*/
|
||||||
public class NavPanel extends BorderPane {
|
public class NavPanel extends TabPane {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private ResourceBundle resources;
|
private ResourceBundle resources;
|
||||||
@ -113,7 +112,7 @@ public class NavPanel extends BorderPane {
|
|||||||
assert navTree != null : "fx:id=\"navTree\" was not injected: check your FXML file 'NavPanel.fxml'.";
|
assert navTree != null : "fx:id=\"navTree\" was not injected: check your FXML file 'NavPanel.fxml'.";
|
||||||
assert sortByBox != null : "fx:id=\"sortByBox\" was not injected: check your FXML file 'NavPanel.fxml'.";
|
assert sortByBox != null : "fx:id=\"sortByBox\" was not injected: check your FXML file 'NavPanel.fxml'.";
|
||||||
|
|
||||||
VBox.setVgrow(this, Priority.SOMETIMES);
|
VBox.setVgrow(this, Priority.ALWAYS);
|
||||||
|
|
||||||
navTree.setShowRoot(false);
|
navTree.setShowRoot(false);
|
||||||
hashTree.setShowRoot(false);
|
hashTree.setShowRoot(false);
|
||||||
@ -169,6 +168,13 @@ public class NavPanel extends BorderPane {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
for (Grouping g : controller.getGroupManager().getAnalyzedGroups()) {
|
||||||
|
insertIntoNavTree(g);
|
||||||
|
if (g.getFilesWithHashSetHitsCount() > 0) {
|
||||||
|
insertIntoHashTree(g);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
controller.viewState().addListener((ObservableValue<? extends GroupViewState> observable, GroupViewState oldValue, GroupViewState newValue) -> {
|
controller.viewState().addListener((ObservableValue<? extends GroupViewState> observable, GroupViewState oldValue, GroupViewState newValue) -> {
|
||||||
if (newValue != null && newValue.getGroup() != null) {
|
if (newValue != null && newValue.getGroup() != null) {
|
||||||
setFocusedGroup(newValue.getGroup());
|
setFocusedGroup(newValue.getGroup());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user