Autopsy  4.19.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
PinnedEventsChartLane.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2016-18 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.detailview;
20 
21 import java.util.logging.Level;
22 import javafx.collections.SetChangeListener;
23 import javafx.scene.chart.Axis;
24 import org.controlsfx.control.Notifications;
25 import org.openide.util.NbBundle;
28 import org.sleuthkit.datamodel.TskCoreException;
29 
33 public final class PinnedEventsChartLane extends DetailsChartLane<DetailViewEvent> {
34 
35  private static final Logger logger = Logger.getLogger(PinnedEventsChartLane.class.getName());
36 
44  @NbBundle.Messages({"PinnedChartLane.pinnedEventsListener.errorMessage=Error adding pinned event to lane."})
45  PinnedEventsChartLane(DetailsChart parentChart, DateAxis dateAxis, final Axis<DetailViewEvent> verticalAxis) {
46  super(parentChart, dateAxis, verticalAxis, false);
47 
48  getController().getPinnedEvents().addListener((SetChangeListener.Change<? extends DetailViewEvent> change) -> {
49  if (change.wasAdded()) {
50  try {
51  addEvent(change.getElementAdded());
52  } catch (TskCoreException ex) {
53  Notifications.create().owner(getScene().getWindow())
54  .text(Bundle.PinnedChartLane_pinnedEventsListener_errorMessage()).showError();
55  logger.log(Level.SEVERE, "Error adding pinned event to lane.", ex);
56  }
57  }
58  if (change.wasRemoved()) {
59  removeEvent(change.getElementRemoved());
60  }
61  requestChartLayout();
62  });
63 
65  try {
66  addEvent(event);
67  } catch (TskCoreException ex) {
68  Notifications.create().owner(getScene().getWindow())
69  .text(Bundle.PinnedChartLane_pinnedEventsListener_errorMessage())
70  .showError();
71  logger.log(Level.SEVERE, "Error adding pinned event to lane.", ex);
72  }
73  }
74  requestChartLayout();
75  }
76 
77  @Override
78  void doAdditionalLayout() {
79  }
80 
81 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124
ObservableSet< DetailViewEvent > getPinnedEvents()

Copyright © 2012-2021 Basis Technology. Generated on: Thu Sep 30 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.