Autopsy  4.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 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;
37 
41 final class SingleEventNode extends EventNodeBase<SingleEvent> {
42 
43  private static final Logger LOGGER = Logger.getLogger(SingleEventNode.class.getName());
44 
45  static void show(Node b, boolean show) {
46  b.setVisible(show);
47  b.setManaged(show);
48  }
49  static final CornerRadii CORNER_RADII_1 = new CornerRadii(1);
50  private static final BorderWidths CLUSTER_BORDER_WIDTHS = new BorderWidths(0, 0, 0, 2);
51 
52  @Override
53  EventHandler<MouseEvent> getDoubleClickHandler() {
54  return mouseEvent -> {
55  };
56  }
57 
58  SingleEventNode(DetailsChartLane<?> chart, SingleEvent event, MultiEventNodeBase<?, ?, ?> parent) {
59  super(event, parent, chart);
60  this.descrLabel.setText(event.getFullDescription());
61  eventTypeImageView.setImage(getEventType().getFXImage());
62  descrLabel.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);
63  descrLabel.setGraphic(eventTypeImageView);
64  descrLabel.setPrefWidth(USE_COMPUTED_SIZE);
65  setMinHeight(24);
66  setAlignment(Pos.CENTER_LEFT);
67 
68  final Border clusterBorder = new Border(new BorderStroke(evtColor.deriveColor(0, 1, 1, .4), BorderStrokeStyle.SOLID, CORNER_RADII_1, CLUSTER_BORDER_WIDTHS));
69  setBorder(clusterBorder);
70 
71  setMaxWidth(USE_PREF_SIZE);
72  infoHBox.setMaxWidth(USE_PREF_SIZE);
73  getChildren().add(infoHBox);
74  }
75 
76  @Override
77  public List<EventNodeBase<?>> getSubNodes() {
78  return Collections.emptyList();
79  }
80 
81  @Override
82  protected void layoutChildren() {
83  super.layoutChildren(); //To change body of generated methods, choose Tools | Templates.
84  }
85 
86  @Override
87  String getDescription() {
88  return getEvent().getFullDescription();
89  }
90 
94  @Override
95  public void setMaxDescriptionWidth(double w) {
96  descrLabel.setMaxWidth(w);
97  }
98 
99  @Override
100  Collection<Long> getEventIDs() {
101  return getEvent().getEventIDs();
102  }
103 }

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.