19 package org.sleuthkit.autopsy.timeline.ui.detailview;
22 import java.util.concurrent.ConcurrentHashMap;
23 import javafx.collections.ListChangeListener;
24 import javafx.scene.chart.Axis;
25 import javafx.scene.shape.Line;
26 import javafx.scene.shape.StrokeLineCap;
55 super(parentChart, dateAxis, verticalAxis,
true);
60 parentChart.getRootEventStripes().addListener((ListChangeListener.Change<? extends
EventStripe> change) -> {
61 while (change.next()) {
62 change.getAddedSubList().stream().forEach(this::addEvent);
63 change.getRemoved().stream().forEach(this::removeEvent);
67 parentChart.getRootEventStripes().stream().forEach(this::addEvent);
70 getSelectedNodes().addListener((ListChangeListener.Change<? extends
EventNodeBase<?>> change) -> {
71 while (change.next()) {
72 change.getRemoved().forEach(removedNode -> {
73 removedNode.getEvent().getClusters().forEach(cluster -> {
74 Line removedLine = projectionMap.remove(cluster);
75 getChartChildren().removeAll(removedLine);
79 change.getAddedSubList().forEach(addedNode -> {
80 for (EventCluster range : addedNode.getEvent().getClusters()) {
81 double y = dateAxis.getLayoutY() + PROJECTED_LINE_Y_OFFSET;
83 new Line(dateAxis.localToParent(getXForEpochMillis(range.getStartMillis()), 0).getX(), y,
84 dateAxis.localToParent(getXForEpochMillis(range.getEndMillis()), 0).getX(), y);
85 line.setStroke(addedNode.getEventType().getColor().deriveColor(0, 1, 1, .5));
86 line.setStrokeWidth(PROJECTED_LINE_STROKE_WIDTH);
87 line.setStrokeLineCap(StrokeLineCap.ROUND);
88 projectionMap.put(range, line);
89 getChartChildren().add(line);
97 return getXAxis().localToParent(getXForEpochMillis(epochMillis), 0).getX();
101 void doAdditionalLayout() {
102 for (
final Map.Entry<
EventCluster, Line> entry : projectionMap.entrySet()) {
104 final Line line = entry.getValue();
106 line.setStartX(getParentXForEpochMillis(cluster.
getStartMillis()));
107 line.setEndX(getParentXForEpochMillis(cluster.
getEndMillis()));
109 line.setStartY(getXAxis().getLayoutY() + PROJECTED_LINE_Y_OFFSET);
110 line.setEndY(getXAxis().getLayoutY() + PROJECTED_LINE_Y_OFFSET);
static final int PROJECTED_LINE_Y_OFFSET
static final int PROJECTED_LINE_STROKE_WIDTH
ObservableList< DescriptionFilter > getQuickHideFilters()
double getParentXForEpochMillis(Long epochMillis)
final Map< EventCluster, Line > projectionMap