diff --git a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineTopComponent.java b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineTopComponent.java index cb4c70b4b6..5ab8584112 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineTopComponent.java @@ -22,7 +22,6 @@ import java.awt.BorderLayout; import java.util.Collections; import java.util.List; import javafx.application.Platform; -import javafx.beans.Observable; import javafx.embed.swing.JFXPanel; import javafx.scene.Scene; import javafx.scene.control.SplitPane; @@ -112,8 +111,8 @@ public final class TimeLineTopComponent extends TopComponent implements Explorer final TabPane leftTabPane = new TabPane(filterTab, eventsTreeTab); VBox.setVgrow(leftTabPane, Priority.ALWAYS); - controller.viewModeProperty().addListener((Observable observable) -> { - if (controller.viewModeProperty().get().equals(ViewMode.DETAIL) == false) { + controller.viewModeProperty().addListener(viewMode -> { + if (controller.getViewMode().equals(ViewMode.DETAIL) == false) { //if view mode is counts, make sure events tab is not active leftTabPane.getSelectionModel().select(filterTab); } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.java index 17d989f04c..7176440656 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.java @@ -91,8 +91,8 @@ import org.sleuthkit.autopsy.timeline.ui.listvew.ListViewPane; import org.sleuthkit.autopsy.timeline.utils.RangeDivisionInfo; /** - * A container for an AbstractVisualizationPane. Has a Toolbar on top to hold - * settings widgets supplied by contained AbstractVisualizationPane, and the + * A container for an AbstractTimelineView. Has a Toolbar on top to hold + * settings widgets supplied by contained AbstractTimelineView, and the * histogram / time selection on bottom. * * TODO: Refactor common code out of histogram and CountsView? -jm @@ -121,7 +121,7 @@ final public class VisualizationPanel extends BorderPane { private LoggedTask histogramTask; private final EventsTree eventsTree; - private AbstractTimeLineView visualization; + private AbstractTimeLineView hostedView; /* * HBox that contains the histogram bars. @@ -295,8 +295,8 @@ final public class VisualizationPanel extends BorderPane { controller.setViewMode(newValue != null ? newValue : (oldVisMode != null ? oldVisMode : ViewMode.COUNTS)); }); - controller.viewModeProperty().addListener(visualizationMode -> syncVisualizationMode()); - syncVisualizationMode(); + controller.viewModeProperty().addListener(viewMode -> syncViewMode()); + syncViewMode(); ActionUtils.configureButton(new SaveSnapshotAsReport(controller, notificationPane::getContent), snapShotButton); ActionUtils.configureButton(new UpdateDB(controller), updateDBButton); @@ -326,7 +326,7 @@ final public class VisualizationPanel extends BorderPane { rangeHistogramStack.getChildren().add(rangeSlider); /* - * this padding attempts to compensates for the fact that the + * This padding attempts to compensates for the fact that the * rangeslider track doesn't extend to edge of node,and so the * histrogram doesn't quite line up with the rangeslider */ @@ -372,7 +372,7 @@ final public class VisualizationPanel extends BorderPane { */ @Subscribe public void handleTimeLineTagUpdate(TagsUpdatedEvent event) { - visualization.setOutOfDate(); + hostedView.setOutOfDate(); Platform.runLater(() -> { if (notificationPane.isShowing() == false) { notificationPane.getActions().setAll(new Refresh()); @@ -410,7 +410,7 @@ final public class VisualizationPanel extends BorderPane { */ @Subscribe public void handleDBUpdated(DBUpdatedEvent event) { - visualization.refresh(); + hostedView.refresh(); refreshHistorgram(); Platform.runLater(notificationPane::hide); } @@ -576,22 +576,28 @@ final public class VisualizationPanel extends BorderPane { } /** - * Switch to the given VisualizationMode, by swapping out the hosted - * AbstractVislualization for one of the correct type. + * Switch to the given ViewMode, by swapping out the hosted + * AbstractTimelineView for one of the correct type. */ - private void syncVisualizationMode() { - AbstractTimeLineView vizPane; - ViewMode visMode = controller.viewModeProperty().get(); + private void syncViewMode() { + AbstractTimeLineView view; + ViewMode viewMode = controller.viewModeProperty().get(); //make new visualization. - switch (visMode) { + switch (viewMode) { case LIST: - vizPane = new ListViewPane(controller); - Platform.runLater(() -> listToggle.setSelected(true)); + view = new ListViewPane(controller); + Platform.runLater(() -> { + listToggle.setSelected(true); + //TODO: should remove listeners from events tree + }); break; case COUNTS: - vizPane = new CountsViewPane(controller); - Platform.runLater(() -> countsToggle.setSelected(true)); + view = new CountsViewPane(controller); + Platform.runLater(() -> { + countsToggle.setSelected(true); + //TODO: should remove listeners from events tree + }); break; case DETAIL: DetailViewPane detailViewPane = new DetailViewPane(controller); @@ -600,34 +606,34 @@ final public class VisualizationPanel extends BorderPane { detailViewPane.setHighLightedEvents(eventsTree.getSelectedEvents()); eventsTree.setDetailViewPane(detailViewPane); }); - vizPane = detailViewPane; + view = detailViewPane; break; default: - throw new IllegalArgumentException("Unknown VisualizationMode: " + visMode.toString()); + throw new IllegalArgumentException("Unknown VisualizationMode: " + viewMode.toString()); } //Set the new AbstractVisualizationPane as the one hosted by this VisualizationPanel. Platform.runLater(() -> { //clear out old vis. - if (visualization != null) { - toolBar.getItems().removeAll(visualization.getSettingsNodes()); - visualization.dispose(); + if (hostedView != null) { + toolBar.getItems().removeAll(hostedView.getSettingsNodes()); + hostedView.dispose(); } - visualization = vizPane; + hostedView = view; //setup new vis. ActionUtils.configureButton(new Refresh(), refreshButton);//configure new refresh action for new visualization - visualization.refresh(); - toolBar.getItems().addAll(2, vizPane.getSettingsNodes()); - notificationPane.setContent(visualization); + hostedView.refresh(); + toolBar.getItems().addAll(2, view.getSettingsNodes()); + notificationPane.setContent(hostedView); //listen to has events property and show "dialog" if it is false. - visualization.hasVisibleEventsProperty().addListener(hasEvents -> { - notificationPane.setContent(visualization.hasVisibleEvents() - ? visualization - : new StackPane(visualization, + hostedView.hasVisibleEventsProperty().addListener(hasEvents -> { + notificationPane.setContent(hostedView.hasVisibleEvents() + ? hostedView + : new StackPane(hostedView, NO_EVENTS_BACKGROUND, - new NoEventsDialog(() -> notificationPane.setContent(visualization)) + new NoEventsDialog(() -> notificationPane.setContent(hostedView)) ) ); }); @@ -773,7 +779,7 @@ final public class VisualizationPanel extends BorderPane { setLongText(Bundle.VisualizationPanel_refresh_longText()); setGraphic(new ImageView(REFRESH)); setEventHandler(actionEvent -> filteredEvents.postRefreshRequest()); - disabledProperty().bind(visualization.outOfDateProperty().not()); + disabledProperty().bind(hostedView.outOfDateProperty().not()); } } } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java index 819a7998de..c1db261b2f 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java @@ -131,18 +131,24 @@ final public class FilterSetPanel extends BorderPane { controller.viewModeProperty().addListener(observable -> { applyFilters(); - if (controller.viewModeProperty().get() == ViewMode.COUNTS) { - dividerPosition = splitPane.getDividerPositions()[0]; - splitPane.setDividerPositions(1); - hiddenDescriptionsPane.setExpanded(false); - hiddenDescriptionsPane.setCollapsible(false); - hiddenDescriptionsPane.setDisable(true); - } else { - splitPane.setDividerPositions(dividerPosition); - hiddenDescriptionsPane.setDisable(false); - hiddenDescriptionsPane.setCollapsible(true); - hiddenDescriptionsPane.setExpanded(true); - hiddenDescriptionsPane.setCollapsible(false); + switch (controller.getViewMode()) { + case COUNTS: + case LIST: + dividerPosition = splitPane.getDividerPositions()[0]; + splitPane.setDividerPositions(1); + hiddenDescriptionsPane.setExpanded(false); + hiddenDescriptionsPane.setCollapsible(false); + hiddenDescriptionsPane.setDisable(true); + break; + case DETAIL: + splitPane.setDividerPositions(dividerPosition); + hiddenDescriptionsPane.setDisable(false); + hiddenDescriptionsPane.setCollapsible(true); + hiddenDescriptionsPane.setExpanded(true); + hiddenDescriptionsPane.setCollapsible(false); + break; + default: + throw new UnsupportedOperationException("Unknown ViewMode: " + controller.getViewMode()); } }); } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomSettingsPane.java b/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomSettingsPane.java index 800c132f8d..1b783a6e3d 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomSettingsPane.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomSettingsPane.java @@ -92,6 +92,7 @@ public class ZoomSettingsPane extends TitledPane { EventTypeZoomLevel::ordinal, Function.identity()); typeZoomLabel.setText(Bundle.ZoomSettingsPane_typeZoomLabel_text()); + typeZoomSlider.disableProperty().bind(controller.viewModeProperty().isEqualTo(ViewMode.LIST)); descrLODSlider.setMax(DescriptionLoD.values().length - 1); configureSliderListeners(descrLODSlider, @@ -102,7 +103,7 @@ public class ZoomSettingsPane extends TitledPane { Function.identity()); descrLODLabel.setText(Bundle.ZoomSettingsPane_descrLODLabel_text()); //the description slider is only usefull in the detail view - descrLODSlider.disableProperty().bind(controller.viewModeProperty().isEqualTo(ViewMode.COUNTS)); + descrLODSlider.disableProperty().bind(controller.viewModeProperty().isNotEqualTo(ViewMode.DETAIL)); /** * In order for the selected value in the time unit slider to correspond @@ -121,6 +122,7 @@ public class ZoomSettingsPane extends TitledPane { modelTimeRange -> RangeDivisionInfo.getRangeDivisionInfo(modelTimeRange).getPeriodSize().ordinal() - 1, index -> index + 1); //compensate for the -1 above when mapping to the Enum whose displayName will be shown at index timeUnitLabel.setText(Bundle.ZoomSettingsPane_timeUnitLabel_text()); + timeUnitSlider.disableProperty().bind(controller.viewModeProperty().isEqualTo(ViewMode.LIST)); } /**