fix bugs from merge

This commit is contained in:
jmillman 2016-05-26 13:06:24 -04:00
parent e2856da2e7
commit 620aa4fcab
3 changed files with 43 additions and 4 deletions

View File

@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.timeline.datamodel;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType; import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType;
@ -108,4 +109,42 @@ public class CombinedEvent {
public Long getRepresentitiveEventID() { public Long getRepresentitiveEventID() {
return eventTypeMap.values().stream().findFirst().get(); return eventTypeMap.values().stream().findFirst().get();
} }
@Override
public int hashCode() {
int hash = 3;
hash = 53 * hash + (int) (this.fileID ^ (this.fileID >>> 32));
hash = 53 * hash + (int) (this.epochMillis ^ (this.epochMillis >>> 32));
hash = 53 * hash + Objects.hashCode(this.description);
hash = 53 * hash + Objects.hashCode(this.eventTypeMap);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CombinedEvent other = (CombinedEvent) obj;
if (this.fileID != other.fileID) {
return false;
}
if (this.epochMillis != other.epochMillis) {
return false;
}
if (!Objects.equals(this.description, other.description)) {
return false;
}
if (!Objects.equals(this.eventTypeMap, other.eventTypeMap)) {
return false;
}
return true;
}
} }

View File

@ -75,7 +75,7 @@ public abstract class AbstractTimelineChart<X, Y, NodeType extends Node, ChartTy
private static final Logger LOGGER = Logger.getLogger(AbstractTimelineChart.class.getName()); private static final Logger LOGGER = Logger.getLogger(AbstractTimelineChart.class.getName());
@NbBundle.Messages("AbstractTimelineChart.defaultTooltip.text=Drag the mouse to select a time interval to zoom into.\nRight-click for more actions.") @NbBundle.Messages("AbstractTimelineChart.defaultTooltip.text=Drag the mouse to select a time interval to zoom into.\nRight-click for more actions.")
private static final Tooltip DEFAULT_TOOLTIP = new Tooltip(Bundle.AbstractTimelineChart_Default_Tooltip_text()); private static final Tooltip DEFAULT_TOOLTIP = new Tooltip(Bundle.AbstractTimelineChart_defaultTooltip_text());
private static final Border ONLY_LEFT_BORDER = new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(0, 0, 0, 1))); private static final Border ONLY_LEFT_BORDER = new Border(new BorderStroke(Color.BLACK, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(0, 0, 0, 1)));
/** /**

View File

@ -206,12 +206,12 @@ class ListTimeline extends BorderPane {
} }
/** /**
* Set the ID of the event that is selected. * Set the combineded events that are selected in this view.
* *
* @param selectedEventID The ID of the event that should be selected. * @param selectedEvents The events that should be selected.
*/ */
void selectEvents(Collection<CombinedEvent> selectedEvents) { void selectEvents(Collection<CombinedEvent> selectedEvents) {
CombinedEvent firstSelected = selectedEvents.stream().min(Comparator.comparing(CombinedEvent::getStartMillis)).orElseGet(null); CombinedEvent firstSelected = selectedEvents.stream().min(Comparator.comparing(CombinedEvent::getStartMillis)).orElse(null);
table.getSelectionModel().clearSelection(); table.getSelectionModel().clearSelection();
table.scrollTo(firstSelected); table.scrollTo(firstSelected);
selectedEvents.forEach(table.getSelectionModel()::select); selectedEvents.forEach(table.getSelectionModel()::select);