From e0f6479b6c654fb57f4f0f2a3b39c7c63d157bf6 Mon Sep 17 00:00:00 2001 From: jmillman Date: Mon, 23 Nov 2015 13:58:04 -0500 Subject: [PATCH] fix layout refresh after node expansion and collapse remove redundant layout operations --- .../ui/detailview/EventBundleNodeBase.java | 37 ++++--------------- .../ui/detailview/EventClusterNode.java | 10 ++--- .../ui/detailview/EventStripeNode.java | 1 - 3 files changed, 11 insertions(+), 37 deletions(-) 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 160f59cf05..730c97bf6b 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventBundleNodeBase.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventBundleNodeBase.java @@ -31,6 +31,7 @@ import java.util.stream.Collectors; import javafx.animation.KeyFrame; import javafx.animation.KeyValue; import javafx.animation.Timeline; +import javafx.application.Platform; import javafx.beans.property.SimpleObjectProperty; import javafx.concurrent.Task; import javafx.event.EventHandler; @@ -58,8 +59,6 @@ import javafx.scene.layout.BorderWidths; import javafx.scene.layout.CornerRadii; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; -import static javafx.scene.layout.Region.USE_COMPUTED_SIZE; -import static javafx.scene.layout.Region.USE_PREF_SIZE; import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; import javafx.util.Duration; @@ -154,33 +153,18 @@ public abstract class EventBundleNodeBase chart.requestChartLayout()); - setMaxHeight(USE_PREF_SIZE); - setMinWidth(USE_PREF_SIZE); - setMaxWidth(USE_PREF_SIZE); setLayoutX(chart.getXAxis().getDisplayPosition(new DateTime(eventBundle.getStartMillis())) - getLayoutXCompensation()); //initialize info hbox - infoHBox.setMinWidth(USE_PREF_SIZE); - infoHBox.setMaxWidth(USE_PREF_SIZE); infoHBox.setPadding(new Insets(2, 3, 2, 3)); infoHBox.setAlignment(Pos.TOP_LEFT); - //set up subnode pane sizing contraints - subNodePane.setPrefHeight(USE_COMPUTED_SIZE); - subNodePane.setPrefHeight(USE_COMPUTED_SIZE); - subNodePane.setMinHeight(24); - subNodePane.setPrefWidth(USE_COMPUTED_SIZE); - subNodePane.setMinWidth(USE_PREF_SIZE); - subNodePane.setMaxWidth(USE_PREF_SIZE); - Tooltip.install(this, this.tooltip); //set up mouse hover effect and tooltip @@ -378,17 +362,20 @@ public abstract class EventBundleNodeBase chart.requestChartLayout()); + timeline.setOnFinished(finished -> Platform.runLater(chart::requestChartLayout)); timeline.play(); } + abstract EventHandler getDoubleClickHandler(); + + abstract Collection getActions(); + /** * event handler used for mouse events on {@link EventStripeNode}s */ @@ -398,15 +385,11 @@ public abstract class EventBundleNodeBase 1) { getDoubleClickHandler().handle(t); } else if (t.isShiftDown()) { - if (chart.selectedNodes.contains(EventBundleNodeBase.this) == false) { - chart.selectedNodes.add(EventBundleNodeBase.this); - } + chart.selectedNodes.add(EventBundleNodeBase.this); } else if (t.isShortcutDown()) { chart.selectedNodes.removeAll(EventBundleNodeBase.this); } else { @@ -428,10 +411,6 @@ public abstract class EventBundleNodeBase getDoubleClickHandler(); - - abstract Collection getActions(); } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventClusterNode.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventClusterNode.java index 32df0af848..962b176f73 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventClusterNode.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventClusterNode.java @@ -85,19 +85,15 @@ final public class EventClusterNode extends EventBundleNodeBase