mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 02:07:42 +00:00
default to full spanning interval if the requeste dinterval does not overlap the spaning interval
This commit is contained in:
parent
6fc88b5b10
commit
7acee871bc
@ -672,15 +672,35 @@ public class TimeLineController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("AssignmentToMethodParameter") //clamp timerange to case
|
/**
|
||||||
|
* Set the new interval to view, and record it in the history. The interval
|
||||||
|
* will be clamped to the span of events in the current case.
|
||||||
|
*
|
||||||
|
* @param timeRange The Interval to view.
|
||||||
|
*
|
||||||
|
* @return True if the interval was changed. False if the interval was the
|
||||||
|
* same as the existing one and no change happened.
|
||||||
|
*/
|
||||||
synchronized public boolean pushTimeRange(Interval timeRange) {
|
synchronized public boolean pushTimeRange(Interval timeRange) {
|
||||||
timeRange = this.filteredEvents.getSpanningInterval().overlap(timeRange);
|
//clamp timerange to case
|
||||||
|
Interval clampedTimeRange;
|
||||||
|
if (timeRange == null) {
|
||||||
|
clampedTimeRange = this.filteredEvents.getSpanningInterval();
|
||||||
|
} else {
|
||||||
|
Interval spanningInterval = this.filteredEvents.getSpanningInterval();
|
||||||
|
if (spanningInterval.overlaps(timeRange)) {
|
||||||
|
clampedTimeRange = spanningInterval.overlap(timeRange);
|
||||||
|
} else {
|
||||||
|
clampedTimeRange = spanningInterval;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ZoomParams currentZoom = filteredEvents.zoomParametersProperty().get();
|
ZoomParams currentZoom = filteredEvents.zoomParametersProperty().get();
|
||||||
if (currentZoom == null) {
|
if (currentZoom == null) {
|
||||||
advance(InitialZoomState.withTimeRange(timeRange));
|
advance(InitialZoomState.withTimeRange(clampedTimeRange));
|
||||||
return true;
|
return true;
|
||||||
} else if (currentZoom.hasTimeRange(timeRange) == false) {
|
} else if (currentZoom.hasTimeRange(clampedTimeRange) == false) {
|
||||||
advance(currentZoom.withTimeRange(timeRange));
|
advance(currentZoom.withTimeRange(clampedTimeRange));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user