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;
42 final class SingleEventNode
extends EventNodeBase<SingleDetailsViewEvent> {
44 private static final Logger LOGGER = Logger.getLogger(SingleEventNode.class.getName());
46 static void show(Node b,
boolean show) {
50 static final CornerRadii CORNER_RADII_1 =
new CornerRadii(1);
51 private static final BorderWidths CLUSTER_BORDER_WIDTHS =
new BorderWidths(0, 0, 0, 2);
54 EventHandler<MouseEvent> getDoubleClickHandler() {
55 return mouseEvent -> {
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);
67 setAlignment(Pos.CENTER_LEFT);
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);
72 setMaxWidth(USE_PREF_SIZE);
73 infoHBox.setMaxWidth(USE_PREF_SIZE);
74 getChildren().add(infoHBox);
78 public List<EventNodeBase<?>> getSubNodes() {
79 return Collections.emptyList();
83 protected void layoutChildren() {
84 super.layoutChildren();
88 String getDescription() {
89 return getEvent().getFullDescription();
96 public void setMaxDescriptionWidth(
double w) {
97 descrLabel.setMaxWidth(w);
101 Collection<Long> getEventIDs() {
static Image getImage(TimelineEventType type)