19 package org.sleuthkit.autopsy.timeline.ui.detailview.tree;
21 import java.util.Comparator;
22 import java.util.HashMap;
24 import javafx.application.Platform;
25 import javafx.collections.FXCollections;
26 import javafx.scene.control.TreeItem;
33 class RootItem
extends NavTreeItem {
36 private final Map<EventType, EventTypeTreeItem> childMap =
new HashMap<>();
45 public int getCount() {
46 return getValue().getCount();
54 public void insert(AggregateEvent g) {
56 EventTypeTreeItem treeItem = childMap.get(g.getType().getBaseType());
57 if (treeItem == null) {
58 final EventTypeTreeItem newTreeItem =
new EventTypeTreeItem(g);
59 newTreeItem.setExpanded(
true);
60 childMap.put(g.getType().getBaseType(), newTreeItem);
61 newTreeItem.insert(g);
63 Platform.runLater(() -> {
64 synchronized (getChildren()) {
65 getChildren().add(newTreeItem);
67 FXCollections.sort(getChildren(), TreeComparator.Type);
76 public void resort(Comparator<TreeItem<NavTreeNode>> comp) {
77 childMap.values().forEach((ti) -> {
83 public TreeItem<NavTreeNode> findTreeItemForEvent(AggregateEvent t) {
84 for (TreeItem<NavTreeNode> child : getChildren()) {
85 final TreeItem<NavTreeNode> findTreeItemForEvent = ((NavTreeItem) child).findTreeItemForEvent(t);
86 if (findTreeItemForEvent != null) {
87 return findTreeItemForEvent;