Merge remote-tracking branch 'upstream/TL-list-view' into 799-tags-and-hashhit-columns-in-list-view

Conflicts:
	Core/src/org/sleuthkit/autopsy/timeline/datamodel/CombinedEvent.java
	Core/src/org/sleuthkit/autopsy/timeline/ui/listvew/ListTimeline.java
This commit is contained in:
jmillman 2016-05-26 15:04:32 -04:00
commit d6167968b5
4 changed files with 61 additions and 47 deletions

View File

@ -24,6 +24,7 @@ import java.io.IOException;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
@ -344,6 +345,9 @@ public class TimeLineController {
filteredEvents.filterProperty().get(), filteredEvents.filterProperty().get(),
DescriptionLoD.SHORT); DescriptionLoD.SHORT);
historyManager.advance(InitialZoomState); historyManager.advance(InitialZoomState);
//clear the selected events when the view mode changes
viewMode.addListener(observable -> selectEventIDs(Collections.emptySet()));
} }
/** /**

View File

@ -35,6 +35,10 @@ public class CombinedEvent {
private final long fileID; private final long fileID;
private final long epochMillis; private final long epochMillis;
private final String description; private final String description;
/**
* A map from EventType to event ID.
*/
private final Map<EventType, Long> eventTypeMap = new HashMap<>(); private final Map<EventType, Long> eventTypeMap = new HashMap<>();
/** /**
@ -43,7 +47,7 @@ public class CombinedEvent {
* @param epochMillis The timestamp for this event, in millis from the Unix * @param epochMillis The timestamp for this event, in millis from the Unix
* epoch. * epoch.
* @param description The full description shared by all the combined events * @param description The full description shared by all the combined events
* @param fileID The ID of the file all the combined events are for. * @param fileID The ID of the file shared by all the combined events.
* @param eventMap A map from EventType to event ID. * @param eventMap A map from EventType to event ID.
*/ */
public CombinedEvent(long epochMillis, String description, long fileID, Map<EventType, Long> eventMap) { public CombinedEvent(long epochMillis, String description, long fileID, Map<EventType, Long> eventMap) {
@ -145,5 +149,4 @@ public class CombinedEvent {
} }
return true; return true;
} }
} }

View File

@ -79,8 +79,8 @@ public abstract class AbstractTimelineChart<X, Y, NodeType extends Node, ChartTy
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)));
/** /**
* Get the tool tip to use for this view when no more specific * Get the tool tip to use for this view when no more specific Tooltip is
* Tooltip is needed. * needed.
* *
* @return The default Tooltip. * @return The default Tooltip.
*/ */
@ -176,8 +176,8 @@ public abstract class AbstractTimelineChart<X, Y, NodeType extends Node, ChartTy
abstract protected Boolean isTickBold(X value); abstract protected Boolean isTickBold(X value);
/** /**
* Apply this view's 'selection effect' to the given node, if * Apply this view's 'selection effect' to the given node, if applied is
* applied is true. If applied is false, remove the affect * true. If applied is false, remove the affect
* *
* @param node The node to apply the 'effect' to * @param node The node to apply the 'effect' to
* @param applied True if the effect should be applied, false if the effect * @param applied True if the effect should be applied, false if the effect

View File

@ -187,7 +187,7 @@ class ListTimeline extends BorderPane {
} }
/** /**
* Set the Collection of events (by ID) to show in the table. * Set the Collection of CombinedEvents to show in the table.
* *
* @param events The Collection of events to sho in the table. * @param events The Collection of events to sho in the table.
*/ */
@ -249,7 +249,7 @@ class ListTimeline extends BorderPane {
} }
/** /**
* Set the combineded events that are selected in this view. * Set the combined events that are selected in this view.
* *
* @param selectedEvents The events that should be selected. * @param selectedEvents The events that should be selected.
*/ */
@ -308,7 +308,7 @@ class ListTimeline extends BorderPane {
} }
/** /**
* TableCell to show text derived from a SingleEvent by the given Funtion. * TableCell to show text derived from a SingleEvent by the given Function.
*/ */
private class TextEventTableCell extends EventTableCell { private class TextEventTableCell extends EventTableCell {
@ -385,9 +385,11 @@ class ListTimeline extends BorderPane {
event = null; event = null;
} else { } else {
event = controller.getEventsModel().getEventById(item.getRepresentativeEventID()); event = controller.getEventsModel().getEventById(item.getRepresentativeEventID());
//make context menu
setOnContextMenuRequested(contextMenuEvent -> {
//make a new context menu on each request in order to include uptodate tag names and hash sets
try { try {
EventNode node = EventNode.createEventNode(event.getEventID(), controller.getEventsModel()); EventNode node = EventNode.createEventNode(item.getRepresentativeEventID(), controller.getEventsModel());
List<MenuItem> menuItems = new ArrayList<>(); List<MenuItem> menuItems = new ArrayList<>();
//for each actions avaialable on node, make a menu item. //for each actions avaialable on node, make a menu item.
@ -401,9 +403,10 @@ class ListTimeline extends BorderPane {
if (Arrays.asList("&Properties", "Tools").contains(actionName) == false) { if (Arrays.asList("&Properties", "Tools").contains(actionName) == false) {
if (action instanceof Presenter.Popup) { if (action instanceof Presenter.Popup) {
/* /*
* If the action is really the root of a set * If the action is really the root of a
* of actions (eg, tagging). Make a menu * set of actions (eg, tagging). Make a
* that parallels the action's menu. * menu that parallels the action's
* menu.
*/ */
JMenuItem submenu = ((Presenter.Popup) action).getPopupPresenter(); JMenuItem submenu = ((Presenter.Popup) action).getPopupPresenter();
menuItems.add(SwingFXMenuUtils.createFXMenu(submenu)); menuItems.add(SwingFXMenuUtils.createFXMenu(submenu));
@ -414,7 +417,9 @@ class ListTimeline extends BorderPane {
} }
}; };
setContextMenu(new ContextMenu(menuItems.toArray(new MenuItem[menuItems.size()]))); //show new context menu.
new ContextMenu(menuItems.toArray(new MenuItem[menuItems.size()]))
.show(this, contextMenuEvent.getScreenX(), contextMenuEvent.getScreenY());
} catch (IllegalStateException ex) { } catch (IllegalStateException ex) {
//Since the case is closed, the user probably doesn't care about this, just log it as a precaution. //Since the case is closed, the user probably doesn't care about this, just log it as a precaution.
LOGGER.log(Level.SEVERE, "There was no case open to lookup the Sleuthkit object backing a SingleEvent.", ex); // NON-NLS LOGGER.log(Level.SEVERE, "There was no case open to lookup the Sleuthkit object backing a SingleEvent.", ex); // NON-NLS
@ -427,6 +432,8 @@ class ListTimeline extends BorderPane {
.showError(); .showError();
}); });
} }
});
} }
} }
} }