Autopsy  4.12.0
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  */
19 package org.sleuthkit.autopsy.timeline.ui.detailview;
20 
21 import java.util.Collection;
22 import java.util.Collections;
23 import java.util.List;
24 import javafx.event.EventHandler;
25 import javafx.geometry.Pos;
26 import javafx.scene.Node;
27 import javafx.scene.control.OverrunStyle;
28 import javafx.scene.input.MouseEvent;
29 import javafx.scene.layout.Border;
30 import javafx.scene.layout.BorderStroke;
31 import javafx.scene.layout.BorderStrokeStyle;
32 import javafx.scene.layout.BorderWidths;
33 import javafx.scene.layout.CornerRadii;
34 import static javafx.scene.layout.Region.USE_PREF_SIZE;
38 
42 final 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 }
static Image getImage(TimelineEventType type)

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