Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
ListViewPane.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2016 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.ui.listvew;
20 
21 import com.google.common.collect.ImmutableList;
22 import com.google.common.collect.ImmutableSet;
23 import com.google.common.eventbus.Subscribe;
24 import java.util.List;
25 import java.util.Set;
26 import javafx.application.Platform;
27 import javafx.concurrent.Task;
28 import javafx.scene.Node;
29 import org.joda.time.Interval;
30 import org.openide.util.NbBundle;
37 
41 public class ListViewPane extends AbstractTimeLineView {
42 
43  private final ListTimeline listTimeline;
44 
51  super(controller);
52 
53  listTimeline = new ListTimeline(controller);
54 
55  //initialize chart;
56  setCenter(listTimeline);
57 
58  }
59 
60  @Override
61  protected Task<Boolean> getNewUpdateTask() {
62  return new ListUpdateTask();
63  }
64 
70  @Override
71  protected void clearData() {
72 
73  }
74 
75  @Override
76  final protected ViewMode getViewMode() {
77  return ViewMode.LIST;
78  }
79 
80  @Override
81  protected ImmutableList<Node> getSettingsControls() {
82  return ImmutableList.of();
83  }
84 
85  @Override
86  protected ImmutableList<Node> getTimeNavigationControls() {
87  return ImmutableList.copyOf(listTimeline.getTimeNavigationControls());
88  }
89 
90  @Override
91  protected boolean hasCustomTimeNavigationControls() {
92  return true;
93  }
94 
95  @Subscribe
97  listTimeline.selectEvents(event.getEventIDs());
98  }
99 
100  private class ListUpdateTask extends ViewRefreshTask<Interval> {
101 
102  @NbBundle.Messages({
103  "ListViewPane.loggedTask.queryDb=Retrieving event data",
104  "ListViewPane.loggedTask.name=Updating List View",
105  "ListViewPane.loggedTask.updateUI=Populating view"})
106  ListUpdateTask() {
107  super(Bundle.ListViewPane_loggedTask_name(), true);
108  }
109 
110  @Override
111  protected Boolean call() throws Exception {
112  super.call();
113  if (isCancelled()) {
114  return null;
115  }
116 
117  FilteredEventsModel eventsModel = getEventsModel();
118 
119  Set<Long> selectedEventIDs;
121  //grab the currently selected event
122  synchronized (controller) {
123  selectedEventIDs = ImmutableSet.copyOf(controller.getSelectedEventIDs());
124  }
125 
126  //clear the chart and set the time range.
127  resetView(eventsModel.getTimeRange());
128 
129  //get the combined events to be displayed
130  updateMessage(Bundle.ListViewPane_loggedTask_queryDb());
131  List<CombinedEvent> combinedEvents = eventsModel.getCombinedEvents();
132 
133  updateMessage(Bundle.ListViewPane_loggedTask_updateUI());
134  Platform.runLater(() -> {
135  //put the combined events into the table.
136  listTimeline.setCombinedEvents(combinedEvents);
137  //restore the selected events
138  listTimeline.selectEvents(selectedEventIDs);
139  });
140 
141  return combinedEvents.isEmpty() == false;
142  }
143 
144  @Override
145  protected void cancelled() {
146  super.cancelled();
148  }
149 
150  @Override
151  protected void setDateValues(Interval timeRange) {
152  }
153  }
154 }
void handleViewInTimelineRequested(ViewInTimelineRequestedEvent event)
synchronized ObservableList< Long > getSelectedEventIDs()

Copyright © 2012-2016 Basis Technology. Generated on: Tue Oct 25 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.