Autopsy 4.22.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 */
19package org.sleuthkit.autopsy.timeline.ui.detailview;
20
21import java.util.logging.Level;
22import javafx.collections.SetChangeListener;
23import javafx.scene.chart.Axis;
24import org.controlsfx.control.Notifications;
25import org.openide.util.NbBundle;
26import org.sleuthkit.autopsy.coreutils.Logger;
27import org.sleuthkit.autopsy.timeline.ui.detailview.datamodel.DetailViewEvent;
28import org.sleuthkit.datamodel.TskCoreException;
29
33public 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
64 for (DetailViewEvent event : getController().getPinnedEvents()) {
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

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.