Autopsy  4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ZoomToEvents.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2014-15 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.timeline.actions;
20 
21 import javafx.beans.binding.BooleanBinding;
22 import javafx.scene.image.Image;
23 import javafx.scene.image.ImageView;
24 import org.controlsfx.control.action.Action;
25 import org.openide.util.NbBundle;
28 
32 public class ZoomToEvents extends Action {
33 
34  private static final Image MAGNIFIER_OUT = new Image("/org/sleuthkit/autopsy/timeline/images/magnifier-zoom-out-red.png", 16, 16, true, true); //NOI18N NON-NLS
35 
36  @NbBundle.Messages({"ZoomToEvents.action.text=Zoom to events",
37  "ZoomToEvents.longText=Zoom out to show the nearest events."})
38  public ZoomToEvents(final TimeLineController controller) {
39  super(Bundle.ZoomToEvents_action_text());
40  setLongText(Bundle.ZoomToEvents_longText());
41  setGraphic(new ImageView(MAGNIFIER_OUT));
42  setEventHandler(actionEvent -> {
43  controller.zoomOutToActivity();
44  });
45 
46  //disable action when the current time range already encompases the entire case.
47  disabledProperty().bind(new BooleanBinding() {
48  private final FilteredEventsModel eventsModel = controller.getEventsModel();
49 
50  {
51  bind(eventsModel.zoomParametersProperty());
52  }
53 
54  @Override
55  protected boolean computeValue() {
56  //TODO: do a db query to see if using this action will actually result in viewable events
57  return eventsModel.zoomParametersProperty().getValue().getTimeRange().contains(eventsModel.getSpanningInterval());
58  }
59  });
60  }
61 }
synchronized ReadOnlyObjectProperty< ZoomParams > zoomParametersProperty()
ZoomToEvents(final TimeLineController controller)

Copyright © 2012-2016 Basis Technology. Generated on: Mon Jun 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.