diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventBundleNodeBase.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventBundleNodeBase.java index 1310942144..c75f0c2492 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventBundleNodeBase.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventBundleNodeBase.java @@ -356,7 +356,7 @@ public abstract class EventBundleNodeBase { private static final Logger LOGGER = Logger.getLogger(EventClusterNode.class.getName()); - /** - * Use this recursive function to flatten a tree of nodes into an single - * stream. More specifically it takes an EventStripeNode and produces a - * stream of EventStripes conaiting the stripes for the given node and all - * child eventStripes, ignoring intervening EventCluster nodes. - * - * @see - * #loadSubBundles(org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD.RelativeDetail) - * for usage - */ - private final static Function> stripeFlattener = new Function>() { - @Override - public Stream apply(EventStripeNode node) { - return Stream.concat( - Stream.of(node.getEventStripe()), - node.getSubNodes().stream().flatMap(clusterNode -> clusterNode.getSubNodes().stream().flatMap(this))); - } - }; private static final BorderWidths CLUSTER_BORDER_WIDTHS = new BorderWidths(2, 1, 2, 1); private static final Image PLUS = new Image("/org/sleuthkit/autopsy/timeline/images/plus-button.png"); // NON-NLS //NOI18N @@ -137,7 +117,7 @@ final public class EventClusterNode extends EventBundleNodeBase bundles = get(); //clear the existing subnodes - List transform = subNodes.stream().flatMap(stripeFlattener).collect(Collectors.toList()); + List transform = subNodes.stream().flatMap(new StripeFlattener()).collect(Collectors.toList()); chart.getEventStripes().removeAll(transform); subNodes.clear(); if (bundles.isEmpty()) { @@ -311,4 +291,5 @@ final public class EventClusterNode extends EventBundleNodeBase nonNull(getEventCluster()) && descLOD.get() == getEventCluster().getDescriptionLoD(), descLOD)); } } + } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventDetailsChart.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventDetailsChart.java index dc05f74779..387120f7ef 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventDetailsChart.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventDetailsChart.java @@ -151,7 +151,7 @@ public final class EventDetailsChart extends XYChart impl private final Group nodeGroup = new Group(); @ThreadConfined(type = ThreadConfined.ThreadType.JFX) - private final ObservableList bundles = FXCollections.observableArrayList(); + private final ObservableList eventStripes = FXCollections.observableArrayList(); private final ObservableList< EventStripeNode> stripeNodes = FXCollections.observableArrayList(); private final ObservableList< EventStripeNode> sortedStripeNodes = stripeNodes.sorted(Comparator.comparing(EventStripeNode::getStartMillis)); private final Map projectionMap = new ConcurrentHashMap<>(); @@ -248,7 +248,7 @@ public final class EventDetailsChart extends XYChart impl } ObservableList getEventStripes() { - return bundles; + return eventStripes; } @Override @@ -392,7 +392,7 @@ public final class EventDetailsChart extends XYChart impl EventStripeNode stripeNode = new EventStripeNode(EventDetailsChart.this, eventStripe, null); Platform.runLater(() -> { - bundles.add(eventStripe); + eventStripes.add(eventStripe); stripeNodes.add(stripeNode); nodeGroup.getChildren().add(stripeNode); data.setNode(stripeNode); @@ -408,10 +408,8 @@ public final class EventDetailsChart extends XYChart impl */ void removeDataItem(Data data) { Platform.runLater(() -> { - EventStripe removedStripe = data.getYValue(); - - bundles.removeAll(removedStripe); EventStripeNode removedNode = (EventStripeNode) data.getNode(); + eventStripes.removeAll(new StripeFlattener().apply(removedNode).collect(Collectors.toList())); stripeNodes.removeAll(removedNode); nodeGroup.getChildren().removeAll(removedNode); data.setNode(null); @@ -468,10 +466,6 @@ public final class EventDetailsChart extends XYChart impl .filter(p).collect(Collectors.toList()); } - Iterable> getAllNodes() { - return getNodes(x -> true); - } - synchronized void setVScroll(double vScrollValue) { nodeGroup.setTranslateY(-vScrollValue); } @@ -588,7 +582,7 @@ public final class EventDetailsChart extends XYChart impl bundleNode.setManaged(true); //apply advanced layout description visibility options bundleNode.setDescriptionVisibility(descrVisibility.get()); - bundleNode.setDescriptionWidth(descriptionWidth); + bundleNode.setMaxDescriptionWidth(descriptionWidth); //do recursive layout bundleNode.layoutChildren(); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventStripeNode.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventStripeNode.java index dde8cb03c4..fb8c4a68b6 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventStripeNode.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventStripeNode.java @@ -102,7 +102,7 @@ final public class EventStripeNode extends EventBundleNodeBase> { + + @Override + public Stream apply(EventStripeNode node) { + return Stream.concat( + Stream.of(node.getEventStripe()), + node.getSubNodes().stream().flatMap(clusterNode -> + clusterNode.getSubNodes().stream().flatMap(this))); + } +}