diff --git a/Core/src/org/sleuthkit/autopsy/timeline/actions/Bundle.properties b/Core/src/org/sleuthkit/autopsy/timeline/actions/Bundle.properties index 89f959f6a4..743544c376 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/actions/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/timeline/actions/Bundle.properties @@ -3,4 +3,3 @@ DefaultFilters.action.name.text=apply default filters Forward.action.name.text=Forward SaveSnapshot.action.name.text=save snapshot SaveSnapshot.fileChoose.title.text=Save snapshot to -ZoomOut.action.name.text=apply default filters \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomIn.java b/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomIn.java new file mode 100644 index 0000000000..d1f76c3c7e --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomIn.java @@ -0,0 +1,44 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2015 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.timeline.actions; + +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; +import org.sleuthkit.autopsy.timeline.TimeLineController; + +/** + * + */ +public class ZoomIn extends Action { + + private static final Image MAGNIFIER_IN = new Image("/org/sleuthkit/autopsy/timeline/images/magnifier-zoom-in-green.png"); //NOI18N + + @NbBundle.Messages({"ZoomIn.longText=Zoom in to view half as much time.", + "ZoomIn.action.text=Zoom in"}) + public ZoomIn(TimeLineController controller) { + super(Bundle.ZoomIn_action_text()); + setLongText(Bundle.ZoomIn_longText()); + setGraphic(new ImageView(MAGNIFIER_IN)); + setEventHandler(actionEvent -> { + controller.pushZoomInTime(); + }); + } +} diff --git a/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomOut.java b/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomOut.java index ee362dfc40..8818ff4557 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomOut.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomOut.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014 Basis Technology Corp. + * Copyright 2015 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +19,8 @@ package org.sleuthkit.autopsy.timeline.actions; import javafx.beans.binding.BooleanBinding; -import javafx.event.ActionEvent; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; import org.controlsfx.control.action.Action; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.timeline.TimeLineController; @@ -30,15 +31,22 @@ import org.sleuthkit.autopsy.timeline.datamodel.FilteredEventsModel; */ public class ZoomOut extends Action { - private final TimeLineController controller; + private static final Image MAGNIFIER_OUT = new Image("/org/sleuthkit/autopsy/timeline/images/magnifier-zoom-out-red.png"); //NOI18N - private final FilteredEventsModel eventsModel; + @NbBundle.Messages({"ZoomOut.longText=Zoom out to view 50% more time.", + "ZoomOut.action.text=Zoom out"}) + public ZoomOut(TimeLineController controller) { + super(Bundle.ZoomOut_action_text()); + setLongText(Bundle.ZoomOut_longText()); + setGraphic(new ImageView(MAGNIFIER_OUT)); + setEventHandler(actionEvent -> { + controller.pushZoomOutTime(); + }); - public ZoomOut(final TimeLineController controller) { - super(NbBundle.getMessage(ZoomOut.class, "ZoomOut.action.name.text")); - this.controller = controller; - eventsModel = controller.getEventsModel(); + //disable action when the current time range already encompases the entire case. disabledProperty().bind(new BooleanBinding() { + private final FilteredEventsModel eventsModel = controller.getEventsModel(); + { bind(eventsModel.zoomParametersProperty()); } @@ -48,8 +56,5 @@ public class ZoomOut extends Action { return eventsModel.zoomParametersProperty().getValue().getTimeRange().contains(eventsModel.getSpanningInterval()); } }); - setEventHandler((ActionEvent t) -> { - controller.zoomOutToActivity(); - }); } } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomToEvents.java b/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomToEvents.java new file mode 100644 index 0000000000..7bcc076936 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/timeline/actions/ZoomToEvents.java @@ -0,0 +1,61 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2014-15 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.timeline.actions; + +import javafx.beans.binding.BooleanBinding; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import org.controlsfx.control.action.Action; +import org.openide.util.NbBundle; +import org.sleuthkit.autopsy.timeline.TimeLineController; +import org.sleuthkit.autopsy.timeline.datamodel.FilteredEventsModel; + +/** + * + */ +public class ZoomToEvents extends Action { + + private static final Image MAGNIFIER_OUT = new Image("/org/sleuthkit/autopsy/timeline/images/magnifier-zoom-out-red.png", 16, 16, true, true); //NOI18N + + @NbBundle.Messages({"ZoomToEvents.action.text=Zoom to events", + "ZoomToEvents.longText=Zoom out to show the nearest events."}) + public ZoomToEvents(final TimeLineController controller) { + super(Bundle.ZoomToEvents_action_text()); + setLongText(Bundle.ZoomToEvents_longText()); + setGraphic(new ImageView(MAGNIFIER_OUT)); + setEventHandler(actionEvent -> { + controller.zoomOutToActivity(); + }); + + //disable action when the current time range already encompases the entire case. + disabledProperty().bind(new BooleanBinding() { + private final FilteredEventsModel eventsModel = controller.getEventsModel(); + + { + bind(eventsModel.zoomParametersProperty()); + } + + @Override + protected boolean computeValue() { + //TODO: do a db query to see if using this action will actually result in viewable events + return eventsModel.zoomParametersProperty().getValue().getTimeRange().contains(eventsModel.getSpanningInterval()); + } + }); + } +} diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.fxml b/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.fxml index 912d7e3e01..ac2748668b 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.fxml +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/VisualizationPanel.fxml @@ -9,7 +9,7 @@ - + @@ -115,7 +115,7 @@ - -