mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
Merge pull request #2140 from millmanorama/TL-dont-refresh-on-zoom-cancel
TL dont refresh on zoom cancel
This commit is contained in:
commit
f5c7faa227
@ -676,9 +676,6 @@ public class TimeLineController {
|
||||
}
|
||||
}
|
||||
|
||||
@NbBundle.Messages({"# {0} - the number of events",
|
||||
"Timeline.pushDescrLOD.confdlg.msg=You are about to show details for {0} events. This might be very slow or even crash Autopsy.\n\nDo you want to continue?",
|
||||
"Timeline.pushDescrLOD.confdlg.title=Change description level of detail?"})
|
||||
synchronized public void pushDescrLOD(DescriptionLoD newLOD) {
|
||||
ZoomParams currentZoom = filteredEvents.zoomParametersProperty().get();
|
||||
if (currentZoom == null) {
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.timeline.ui;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
@ -71,6 +72,7 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined;
|
||||
import org.sleuthkit.autopsy.timeline.TimeLineController;
|
||||
import org.sleuthkit.autopsy.timeline.datamodel.FilteredEventsModel;
|
||||
import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType;
|
||||
import org.sleuthkit.autopsy.timeline.events.RefreshRequestedEvent;
|
||||
|
||||
/**
|
||||
* Abstract base class for TimeLineChart based visualizations.
|
||||
@ -401,6 +403,17 @@ public abstract class AbstractVisualizationPane<X, Y, NodeType extends Node, Cha
|
||||
controller.monitorTask(updateTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a RefreshRequestedEvent from the events model by updating the
|
||||
* visualization.
|
||||
*
|
||||
* @param event The RefreshRequestedEvent to handle.
|
||||
*/
|
||||
@Subscribe
|
||||
public void handleRefreshRequested(RefreshRequestedEvent event) {
|
||||
refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose of this visualization and any resources it holds onto.
|
||||
*/
|
||||
|
@ -382,8 +382,8 @@ final public class VisualizationPanel extends BorderPane {
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a RefreshRequestedEvent from the events model by refreshing the
|
||||
* visualization.
|
||||
* Handle a RefreshRequestedEvent from the events model by clearing the
|
||||
* refresh notification.
|
||||
*
|
||||
* NOTE: This VisualizationPanel must be registered with the
|
||||
* filteredEventsModel's EventBus in order for this handler to be invoked.
|
||||
@ -392,7 +392,6 @@ final public class VisualizationPanel extends BorderPane {
|
||||
*/
|
||||
@Subscribe
|
||||
public void handleRefreshRequested(RefreshRequestedEvent event) {
|
||||
visualization.refresh();
|
||||
Platform.runLater(() -> {
|
||||
if (Bundle.VisualizationPanel_tagsAddedOrDeleted().equals(notificationPane.getText())) {
|
||||
notificationPane.hide();
|
||||
@ -543,22 +542,18 @@ final public class VisualizationPanel extends BorderPane {
|
||||
controller.monitorTask(histogramTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the time selection UI to match the current zoome paramaters.
|
||||
*/
|
||||
private void refreshTimeUI() {
|
||||
refreshTimeUI(filteredEvents.timeRangeProperty().get());
|
||||
}
|
||||
|
||||
private void refreshTimeUI(Interval interval) {
|
||||
|
||||
RangeDivisionInfo rangeDivisionInfo = RangeDivisionInfo.getRangeDivisionInfo(filteredEvents.getSpanningInterval());
|
||||
|
||||
final long minTime = rangeDivisionInfo.getLowerBound();
|
||||
final long maxTime = rangeDivisionInfo.getUpperBound();
|
||||
|
||||
long startMillis = interval.getStartMillis();
|
||||
long endMillis = interval.getEndMillis();
|
||||
long startMillis = filteredEvents.getTimeRange().getStartMillis();
|
||||
long endMillis = filteredEvents.getTimeRange().getEndMillis();
|
||||
|
||||
if (minTime > 0 && maxTime > minTime) {
|
||||
|
||||
Platform.runLater(() -> {
|
||||
startPicker.localDateTimeProperty().removeListener(startListener);
|
||||
endPicker.localDateTimeProperty().removeListener(endListener);
|
||||
|
@ -19,6 +19,7 @@
|
||||
package org.sleuthkit.autopsy.timeline.ui.detailview;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
@ -56,6 +57,7 @@ import org.sleuthkit.autopsy.timeline.datamodel.TimeLineEvent;
|
||||
import org.sleuthkit.autopsy.timeline.ui.AbstractVisualizationPane;
|
||||
import org.sleuthkit.autopsy.timeline.utils.MappedList;
|
||||
import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD;
|
||||
import org.sleuthkit.autopsy.timeline.zooming.ZoomParams;
|
||||
|
||||
/**
|
||||
* Controller class for a DetailsChart based implementation of a timeline view.
|
||||
@ -87,6 +89,12 @@ public class DetailViewPane extends AbstractVisualizationPane<DateTime, EventStr
|
||||
*/
|
||||
private final MappedList<TimeLineEvent, EventNodeBase<?>> selectedEvents;
|
||||
|
||||
/**
|
||||
* Local copy of the zoomParams. Used to backout of a zoomParam change
|
||||
* without needing to requery/redraw the vis.
|
||||
*/
|
||||
private ZoomParams currentZoomParams;
|
||||
|
||||
/**
|
||||
* Constructor for a DetailViewPane
|
||||
*
|
||||
@ -343,7 +351,8 @@ public class DetailViewPane extends AbstractVisualizationPane<DateTime, EventStr
|
||||
"DetailViewPane.loggedTask.continueButton=Continue",
|
||||
"DetailViewPane.loggedTask.backButton=Back (Cancel)",
|
||||
"# {0} - number of events",
|
||||
"DetailViewPane.loggedTask.prompt=You are about to show details for {0} events. This might be very slow or even crash Autopsy.\n\nDo you want to continue?"})
|
||||
|
||||
"DetailViewPane.loggedTask.prompt=You are about to show details for {0} events. This might be very slow and could exhaust available memory.\n\nDo you want to continue?"})
|
||||
private class DetailsUpdateTask extends VisualizationRefreshTask<Interval> {
|
||||
|
||||
DetailsUpdateTask() {
|
||||
@ -353,13 +362,17 @@ public class DetailViewPane extends AbstractVisualizationPane<DateTime, EventStr
|
||||
@Override
|
||||
protected Boolean call() throws Exception {
|
||||
super.call();
|
||||
|
||||
if (isCancelled()) {
|
||||
return null;
|
||||
}
|
||||
FilteredEventsModel eventsModel = getEventsModel();
|
||||
ZoomParams newZoomParams = eventsModel.getZoomParamaters();
|
||||
|
||||
//clear the chart and set the horixontal axis
|
||||
resetChart(eventsModel.getTimeRange());
|
||||
//if the zoomParams haven't actually changed, just bail
|
||||
if (Objects.equals(currentZoomParams, newZoomParams)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
updateMessage(Bundle.DetailViewPane_loggedTask_queryDb());
|
||||
|
||||
@ -378,17 +391,25 @@ public class DetailViewPane extends AbstractVisualizationPane<DateTime, EventStr
|
||||
alert.setHeaderText("");
|
||||
alert.initModality(Modality.APPLICATION_MODAL);
|
||||
alert.initOwner(getScene().getWindow());
|
||||
ButtonType orElse = alert.showAndWait().orElse(back);
|
||||
if (orElse == back) {
|
||||
ButtonType userResponse = alert.showAndWait().orElse(back);
|
||||
if (userResponse == back) {
|
||||
DetailsUpdateTask.this.cancel();
|
||||
}
|
||||
return orElse;
|
||||
return userResponse;
|
||||
}
|
||||
};
|
||||
//show dialog on JFX thread and block this thread until the dialog is dismissed.
|
||||
Platform.runLater(task);
|
||||
task.get();
|
||||
}
|
||||
if (isCancelled()) {
|
||||
return null;
|
||||
}
|
||||
//we are going to accept the new zoomParams
|
||||
currentZoomParams = newZoomParams;
|
||||
|
||||
//clear the chart and set the horixontal axis
|
||||
resetChart(eventsModel.getTimeRange());
|
||||
|
||||
updateMessage(Bundle.DetailViewPane_loggedTask_updateUI());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user