Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
SingleEventNode.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2016-2018 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.Collection;
22import java.util.Collections;
23import java.util.List;
24import javafx.event.EventHandler;
25import javafx.geometry.Pos;
26import javafx.scene.Node;
27import javafx.scene.control.OverrunStyle;
28import javafx.scene.input.MouseEvent;
29import javafx.scene.layout.Border;
30import javafx.scene.layout.BorderStroke;
31import javafx.scene.layout.BorderStrokeStyle;
32import javafx.scene.layout.BorderWidths;
33import javafx.scene.layout.CornerRadii;
34import static javafx.scene.layout.Region.USE_PREF_SIZE;
35import org.sleuthkit.autopsy.coreutils.Logger;
36import static org.sleuthkit.autopsy.timeline.ui.EventTypeUtils.getImage;
37import org.sleuthkit.autopsy.timeline.ui.detailview.datamodel.SingleDetailsViewEvent;
38
42final class SingleEventNode extends EventNodeBase<SingleDetailsViewEvent> {
43
44 private static final Logger LOGGER = Logger.getLogger(SingleEventNode.class.getName());
45
46 static void show(Node b, boolean show) {
47 b.setVisible(show);
48 b.setManaged(show);
49 }
50 static final CornerRadii CORNER_RADII_1 = new CornerRadii(1);
51 private static final BorderWidths CLUSTER_BORDER_WIDTHS = new BorderWidths(0, 0, 0, 2);
52
53 @Override
54 EventHandler<MouseEvent> getDoubleClickHandler() {
55 return mouseEvent -> {
56 };
57 }
58
59 SingleEventNode(DetailsChartLane<?> chart, SingleDetailsViewEvent event, MultiEventNodeBase<?, ?, ?> parent) {
60 super(event, parent, chart);
61 this.descrLabel.setText(event.getFullDescription());
62 eventTypeImageView.setImage(getImage(getEventType()));
63 descrLabel.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);
64 descrLabel.setGraphic(eventTypeImageView);
65 descrLabel.setPrefWidth(USE_COMPUTED_SIZE);
66 setMinHeight(24);
67 setAlignment(Pos.CENTER_LEFT);
68
69 final Border clusterBorder = new Border(new BorderStroke(evtColor.deriveColor(0, 1, 1, .4), BorderStrokeStyle.SOLID, CORNER_RADII_1, CLUSTER_BORDER_WIDTHS));
70 setBorder(clusterBorder);
71
72 setMaxWidth(USE_PREF_SIZE);
73 infoHBox.setMaxWidth(USE_PREF_SIZE);
74 getChildren().add(infoHBox);
75 }
76
77 @Override
78 public List<EventNodeBase<?>> getSubNodes() {
79 return Collections.emptyList();
80 }
81
82 @Override
83 protected void layoutChildren() {
84 super.layoutChildren(); //To change body of generated methods, choose Tools | Templates.
85 }
86
87 @Override
88 String getDescription() {
89 return getEvent().getFullDescription();
90 }
91
95 @Override
96 public void setMaxDescriptionWidth(double w) {
97 descrLabel.setMaxWidth(w);
98 }
99
100 @Override
101 Collection<Long> getEventIDs() {
102 return getEvent().getEventIDs();
103 }
104}

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