19 package org.sleuthkit.autopsy.timeline.ui.detailview;
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;
41 final class SingleEventNode
extends EventNodeBase<SingleEvent> {
43 private static final Logger LOGGER = Logger.getLogger(SingleEventNode.class.getName());
45 static void show(Node b,
boolean show) {
49 static final CornerRadii CORNER_RADII_1 =
new CornerRadii(1);
50 private static final BorderWidths CLUSTER_BORDER_WIDTHS =
new BorderWidths(0, 0, 0, 2);
53 EventHandler<MouseEvent> getDoubleClickHandler() {
54 return mouseEvent -> {
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);
66 setAlignment(Pos.CENTER_LEFT);
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);
71 setMaxWidth(USE_PREF_SIZE);
72 infoHBox.setMaxWidth(USE_PREF_SIZE);
73 getChildren().add(infoHBox);
77 public List<EventNodeBase<?>> getSubNodes() {
78 return Collections.emptyList();
82 protected void layoutChildren() {
83 super.layoutChildren();
87 String getDescription() {
88 return getEvent().getFullDescription();
95 public void setMaxDescriptionWidth(
double w) {
96 descrLabel.setMaxWidth(w);
100 Collection<Long> getEventIDs() {