diff --git a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java index b175c718df..8367066591 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java @@ -80,7 +80,7 @@ import org.sleuthkit.autopsy.timeline.filters.DescriptionFilter; import org.sleuthkit.autopsy.timeline.filters.RootFilter; import org.sleuthkit.autopsy.timeline.filters.TypeFilter; import org.sleuthkit.autopsy.timeline.utils.IntervalUtils; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; import org.sleuthkit.autopsy.timeline.zooming.EventTypeZoomLevel; import org.sleuthkit.autopsy.timeline.zooming.ZoomParams; import org.sleuthkit.datamodel.SleuthkitCase; @@ -138,10 +138,10 @@ public class TimeLineController { private final Case autoCase; @ThreadConfined(type = ThreadConfined.ThreadType.JFX) - private final ObservableList quickHideMasks = FXCollections.observableArrayList(); + private final ObservableList quickHideMaskFilters = FXCollections.observableArrayList(); - public ObservableList getQuickHideMasks() { - return quickHideMasks; + public ObservableList getQuickHideFilters() { + return quickHideMaskFilters; } /** @@ -264,7 +264,7 @@ public class TimeLineController { InitialZoomState = new ZoomParams(filteredEvents.getSpanningInterval(), EventTypeZoomLevel.BASE_TYPE, filteredEvents.filterProperty().get(), - DescriptionLOD.SHORT); + DescriptionLoD.SHORT); historyManager.advance(InitialZoomState); } @@ -564,12 +564,12 @@ 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?"}) - synchronized public boolean pushDescrLOD(DescriptionLOD newLOD) { + synchronized public boolean pushDescrLOD(DescriptionLoD newLOD) { Map eventCounts = filteredEvents.getEventCounts(filteredEvents.zoomParametersProperty().get().getTimeRange()); final Long count = eventCounts.values().stream().reduce(0l, Long::sum); boolean shouldContinue = true; - if (newLOD == DescriptionLOD.FULL && count > 10_000) { + if (newLOD == DescriptionLoD.FULL && count > 10_000) { String format = NumberFormat.getInstance().format(count); int showConfirmDialog = JOptionPane.showConfirmDialog(mainFrame, diff --git a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventBundle.java b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventBundle.java index ddfbcd82e9..8714452725 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventBundle.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventBundle.java @@ -22,7 +22,7 @@ import com.google.common.collect.Range; import java.util.Optional; import java.util.Set; import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; /** * @@ -31,7 +31,7 @@ public interface EventBundle { String getDescription(); - DescriptionLOD getDescriptionLoD(); + DescriptionLoD getDescriptionLoD(); Set getEventIDs(); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventCluster.java b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventCluster.java index 0fc5a7ca42..57d5cec0db 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventCluster.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventCluster.java @@ -28,7 +28,7 @@ import javax.annotation.concurrent.Immutable; import org.joda.time.Interval; import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType; import org.sleuthkit.autopsy.timeline.utils.IntervalUtils; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; /** * Represents a set of other (TimeLineEvent) events clustered together. All the @@ -39,13 +39,13 @@ import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; public class EventCluster implements EventBundle { /** - * merge two aggregate events into one new aggregate event. + * merge two event clusters into one new event cluster. * * @param cluster1 * @param cluster2 * - * @return a new aggregate event that is the result of merging the given - * events + * @return a new event cluster that is the result of merging the given + * events clusters */ public static EventCluster merge(EventCluster cluster1, EventCluster cluster2) { if (cluster1.getEventType() != cluster2.getEventType()) { @@ -82,7 +82,7 @@ public class EventCluster implements EventBundle { /** * the description level of detail that the events were clustered at. */ - private final DescriptionLOD lod; + private final DescriptionLoD lod; /** * the set of ids of the clustered events @@ -101,7 +101,7 @@ public class EventCluster implements EventBundle { */ private final Set hashHits; - private EventCluster(Interval spanningInterval, EventType type, Set eventIDs, Set hashHits, Set tagged, String description, DescriptionLOD lod, EventBundle parent) { + private EventCluster(Interval spanningInterval, EventType type, Set eventIDs, Set hashHits, Set tagged, String description, DescriptionLoD lod, EventBundle parent) { this.span = spanningInterval; this.type = type; @@ -113,7 +113,7 @@ public class EventCluster implements EventBundle { this.parent = parent; } - public EventCluster(Interval spanningInterval, EventType type, Set eventIDs, Set hashHits, Set tagged, String description, DescriptionLOD lod) { + public EventCluster(Interval spanningInterval, EventType type, Set eventIDs, Set hashHits, Set tagged, String description, DescriptionLoD lod) { this(spanningInterval, type, eventIDs, hashHits, tagged, description, lod, null); } @@ -162,7 +162,7 @@ public class EventCluster implements EventBundle { } @Override - public DescriptionLOD getDescriptionLoD() { + public DescriptionLoD getDescriptionLoD() { return lod; } @@ -195,5 +195,4 @@ public class EventCluster implements EventBundle { return new EventCluster(span, type, eventIDs, hashHits, tagged, description, lod, parent); } - } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventStripe.java b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventStripe.java index a3dbb6bc1c..8a465de1cd 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventStripe.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/EventStripe.java @@ -18,7 +18,7 @@ import java.util.Set; import javax.annotation.concurrent.Immutable; import org.python.google.common.base.Objects; import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; /** * A 'collection' of {@link EventCluster}s, all having the same type, @@ -55,7 +55,7 @@ public final class EventStripe implements EventBundle { /** * the description level of detail that the events were clustered at. */ - private final DescriptionLOD lod; + private final DescriptionLoD lod; /** * the set of ids of the events @@ -118,7 +118,7 @@ public final class EventStripe implements EventBundle { } @Override - public DescriptionLOD getDescriptionLoD() { + public DescriptionLoD getDescriptionLoD() { return lod; } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/FilteredEventsModel.java b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/FilteredEventsModel.java index 654c77a3db..6da5fea635 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/FilteredEventsModel.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/FilteredEventsModel.java @@ -56,7 +56,7 @@ import org.sleuthkit.autopsy.timeline.filters.TagNameFilter; import org.sleuthkit.autopsy.timeline.filters.TagsFilter; import org.sleuthkit.autopsy.timeline.filters.TextFilter; import org.sleuthkit.autopsy.timeline.filters.TypeFilter; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; import org.sleuthkit.autopsy.timeline.zooming.EventTypeZoomLevel; import org.sleuthkit.autopsy.timeline.zooming.ZoomParams; import org.sleuthkit.datamodel.BlackboardArtifact; @@ -105,7 +105,7 @@ public final class FilteredEventsModel { private final ReadOnlyObjectWrapper< EventTypeZoomLevel> requestedTypeZoom = new ReadOnlyObjectWrapper<>(EventTypeZoomLevel.BASE_TYPE); @GuardedBy("this") - private final ReadOnlyObjectWrapper< DescriptionLOD> requestedLOD = new ReadOnlyObjectWrapper<>(DescriptionLOD.SHORT); + private final ReadOnlyObjectWrapper< DescriptionLoD> requestedLOD = new ReadOnlyObjectWrapper<>(DescriptionLoD.SHORT); @GuardedBy("this") private final ReadOnlyObjectWrapper requestedZoomParamters = new ReadOnlyObjectWrapper<>(); @@ -180,7 +180,7 @@ public final class FilteredEventsModel { return requestedTimeRange.getReadOnlyProperty(); } - synchronized public ReadOnlyObjectProperty descriptionLODProperty() { + synchronized public ReadOnlyObjectProperty descriptionLODProperty() { return requestedLOD.getReadOnlyProperty(); } @@ -192,7 +192,7 @@ public final class FilteredEventsModel { return requestedTypeZoom.getReadOnlyProperty(); } - synchronized public DescriptionLOD getDescriptionLOD() { + synchronized public DescriptionLoD getDescriptionLOD() { return requestedLOD.get(); } @@ -322,17 +322,15 @@ public final class FilteredEventsModel { } /** - * @param aggregation * - * @return a list of aggregated events that are within the requested time - * range and pass the requested filter, using the given aggregation - * to control the grouping of events + * @return a list of event clusters at the requested zoom levels that are + * within the requested time range and pass the requested filter */ public List getEventClusters() { final Interval range; final RootFilter filter; final EventTypeZoomLevel zoom; - final DescriptionLOD lod; + final DescriptionLoD lod; synchronized (this) { range = requestedTimeRange.get(); filter = requestedFilter.get(); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/TimeLineEvent.java b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/TimeLineEvent.java index 744311c321..2296edfbf8 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/TimeLineEvent.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/TimeLineEvent.java @@ -22,7 +22,7 @@ import com.google.common.collect.ImmutableMap; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; import org.sleuthkit.datamodel.TskData; /** @@ -38,7 +38,7 @@ public class TimeLineEvent { private final long time; private final EventType subType; - private final ImmutableMap descriptions; + private final ImmutableMap descriptions; private final TskData.FileKnown known; private final boolean hashHit; @@ -50,10 +50,9 @@ public class TimeLineEvent { this.artifactID = artifactID == 0 ? null : artifactID; this.time = time; this.subType = type; - descriptions = ImmutableMap.of( - DescriptionLOD.FULL, fullDescription, - DescriptionLOD.MEDIUM, medDescription, - DescriptionLOD.SHORT, shortDescription); + descriptions = ImmutableMap.of(DescriptionLoD.FULL, fullDescription, + DescriptionLoD.MEDIUM, medDescription, + DescriptionLoD.SHORT, shortDescription); this.known = known; this.hashHit = hashHit; @@ -94,22 +93,22 @@ public class TimeLineEvent { } public String getFullDescription() { - return getDescription(DescriptionLOD.FULL); + return getDescription(DescriptionLoD.FULL); } public String getMedDescription() { - return getDescription(DescriptionLOD.MEDIUM); + return getDescription(DescriptionLoD.MEDIUM); } public String getShortDescription() { - return getDescription(DescriptionLOD.SHORT); + return getDescription(DescriptionLoD.SHORT); } public TskData.FileKnown getKnown() { return known; } - public String getDescription(DescriptionLOD lod) { + public String getDescription(DescriptionLoD lod) { return descriptions.get(lod); } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/db/EventDB.java b/Core/src/org/sleuthkit/autopsy/timeline/db/EventDB.java index 35d8a25c5d..ce248a2149 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/db/EventDB.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/db/EventDB.java @@ -64,7 +64,7 @@ import static org.sleuthkit.autopsy.timeline.db.SQLHelper.useTagTablesHelper; import org.sleuthkit.autopsy.timeline.filters.RootFilter; import org.sleuthkit.autopsy.timeline.filters.TagsFilter; import org.sleuthkit.autopsy.timeline.utils.RangeDivisionInfo; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; import org.sleuthkit.autopsy.timeline.zooming.EventTypeZoomLevel; import org.sleuthkit.autopsy.timeline.zooming.ZoomParams; import org.sleuthkit.datamodel.SleuthkitCase; @@ -1046,7 +1046,7 @@ public class EventDB { //unpack params Interval timeRange = params.getTimeRange(); RootFilter filter = params.getFilter(); - DescriptionLOD descriptionLOD = params.getDescriptionLOD(); + DescriptionLoD descriptionLOD = params.getDescriptionLOD(); EventTypeZoomLevel typeZoomLevel = params.getTypeZoomLevel(); //ensure length of querried interval is not 0 @@ -1109,7 +1109,7 @@ public class EventDB { * * @throws SQLException */ - private EventCluster eventClusterHelper(ResultSet rs, boolean useSubTypes, DescriptionLOD descriptionLOD, TagsFilter filter) throws SQLException { + private EventCluster eventClusterHelper(ResultSet rs, boolean useSubTypes, DescriptionLoD descriptionLOD, TagsFilter filter) throws SQLException { Interval interval = new Interval(rs.getLong("min(time)") * 1000, rs.getLong("max(time)") * 1000, TimeLineController.getJodaTimeZone());// NON-NLS String eventIDsString = rs.getString("event_ids");// NON-NLS Set eventIDs = SQLHelper.unGroupConcat(eventIDsString, Long::valueOf); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/db/SQLHelper.java b/Core/src/org/sleuthkit/autopsy/timeline/db/SQLHelper.java index 4c827c401d..65405d7930 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/db/SQLHelper.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/db/SQLHelper.java @@ -43,9 +43,9 @@ import org.sleuthkit.autopsy.timeline.filters.TextFilter; import org.sleuthkit.autopsy.timeline.filters.TypeFilter; import org.sleuthkit.autopsy.timeline.filters.UnionFilter; import org.sleuthkit.autopsy.timeline.utils.RangeDivisionInfo; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; -import static org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD.FULL; -import static org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD.MEDIUM; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; +import static org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD.FULL; +import static org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD.MEDIUM; import static org.sleuthkit.autopsy.timeline.zooming.TimeUnits.DAYS; import static org.sleuthkit.autopsy.timeline.zooming.TimeUnits.HOURS; import static org.sleuthkit.autopsy.timeline.zooming.TimeUnits.MINUTES; @@ -62,12 +62,12 @@ class SQLHelper { static String useHashHitTablesHelper(RootFilter filter) { HashHitsFilter hashHitFilter = filter.getHashHitsFilter(); - return hashHitFilter.isSelected() && false == hashHitFilter.isDisabled() ? " LEFT JOIN hash_set_hits " : " "; + return hashHitFilter.isActive() ? " LEFT JOIN hash_set_hits " : " "; } static String useTagTablesHelper(RootFilter filter) { TagsFilter tagsFilter = filter.getTagsFilter(); - return tagsFilter.isSelected() && false == tagsFilter.isDisabled() ? " LEFT JOIN tags " : " "; + return tagsFilter.isActive() ? " LEFT JOIN tags " : " "; } /** @@ -149,7 +149,7 @@ class SQLHelper { } private static String getSQLWhere(HideKnownFilter filter) { - if (filter.isSelected()) { + if (filter.isActive()) { return "(known_state IS NOT '" + TskData.FileKnown.KNOWN.getFileKnownValue() + "')"; // NON-NLS } else { return "1"; @@ -157,16 +157,16 @@ class SQLHelper { } private static String getSQLWhere(DescriptionFilter filter) { - if (filter.isSelected() && (false == filter.isDisabled())) { - return "(" + getDescriptionColumn(filter.getDescriptionLoD()) + (filter.getFilterMode() == DescriptionFilter.FilterMode.INCLUDE ? "" : " NOT") + " LIKE '" + filter.getDescription() + "' )"; // NON-NLS + if (filter.isActive()) { + String likeOrNotLike = (filter.getFilterMode() == DescriptionFilter.FilterMode.INCLUDE ? "" : " NOT") + " LIKE '"; + return "(" + getDescriptionColumn(filter.getDescriptionLoD()) + likeOrNotLike + filter.getDescription() + "' )"; // NON-NLS } else { return "1"; } } private static String getSQLWhere(TagsFilter filter) { - if (filter.isSelected() - && (false == filter.isDisabled()) + if (filter.isActive() && (filter.getSubFilters().isEmpty() == false)) { String tagNameIDs = filter.getSubFilters().stream() .filter((TagNameFilter t) -> t.isSelected() && !t.isDisabled()) @@ -181,8 +181,7 @@ class SQLHelper { } private static String getSQLWhere(HashHitsFilter filter) { - if (filter.isSelected() - && (false == filter.isDisabled()) + if (filter.isActive() && (filter.getSubFilters().isEmpty() == false)) { String hashSetIDs = filter.getSubFilters().stream() .filter((HashSetFilter t) -> t.isSelected() && !t.isDisabled()) @@ -195,7 +194,7 @@ class SQLHelper { } private static String getSQLWhere(DataSourceFilter filter) { - if (filter.isSelected()) { + if (filter.isActive()) { return "(datasource_id = '" + filter.getDataSourceID() + "')"; } else { return "1"; @@ -203,15 +202,15 @@ class SQLHelper { } private static String getSQLWhere(DataSourcesFilter filter) { - return (filter.isSelected()) ? "(datasource_id in (" + return (filter.isActive()) ? "(datasource_id in (" + filter.getSubFilters().stream() - .filter(AbstractFilter::isSelected) + .filter(AbstractFilter::isActive) .map((dataSourceFilter) -> String.valueOf(dataSourceFilter.getDataSourceID())) .collect(Collectors.joining(", ")) + "))" : "1"; } private static String getSQLWhere(TextFilter filter) { - if (filter.isSelected()) { + if (filter.isActive()) { if (StringUtils.isBlank(filter.getText())) { return "1"; } @@ -237,7 +236,7 @@ class SQLHelper { return "0"; } else if (typeFilter.getEventType() instanceof RootEventType) { if (typeFilter.getSubFilters().stream() - .allMatch(subFilter -> subFilter.isSelected() && subFilter.getSubFilters().stream().allMatch(Filter::isSelected))) { + .allMatch(subFilter -> subFilter.isActive() && subFilter.getSubFilters().stream().allMatch(Filter::isActive))) { return "1"; //then collapse clause to true } } @@ -245,7 +244,7 @@ class SQLHelper { } private static List getActiveSubTypes(TypeFilter filter) { - if (filter.isSelected()) { + if (filter.isActive()) { if (filter.getSubFilters().isEmpty()) { return Collections.singletonList(RootEventType.allTypes.indexOf(filter.getEventType())); } else { @@ -285,7 +284,7 @@ class SQLHelper { } } - static String getDescriptionColumn(DescriptionLOD lod) { + static String getDescriptionColumn(DescriptionLoD lod) { switch (lod) { case FULL: return "full_description"; diff --git a/Core/src/org/sleuthkit/autopsy/timeline/events/FiltersChangedEvent.java b/Core/src/org/sleuthkit/autopsy/timeline/events/FiltersChangedEvent.java deleted file mode 100644 index 6e83ca1306..0000000000 --- a/Core/src/org/sleuthkit/autopsy/timeline/events/FiltersChangedEvent.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -package org.sleuthkit.autopsy.timeline.events; - -/** - * - */ -public class FiltersChangedEvent { - -} diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/DescriptionFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/DescriptionFilter.java index 2bd8d595c2..5ac569c6f9 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/DescriptionFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/DescriptionFilter.java @@ -19,11 +19,11 @@ package org.sleuthkit.autopsy.timeline.filters; import java.util.Objects; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; public class DescriptionFilter extends AbstractFilter { - private final DescriptionLOD descriptionLoD; + private final DescriptionLoD descriptionLoD; private final String description; private final FilterMode filterMode; @@ -31,7 +31,7 @@ public class DescriptionFilter extends AbstractFilter { return filterMode; } - public DescriptionFilter(DescriptionLOD descriptionLoD, String description, FilterMode filterMode) { + public DescriptionFilter(DescriptionLoD descriptionLoD, String description, FilterMode filterMode) { this.descriptionLoD = descriptionLoD; this.description = description; this.filterMode = filterMode; @@ -58,7 +58,7 @@ public class DescriptionFilter extends AbstractFilter { /** * @return the descriptionLoD */ - public DescriptionLOD getDescriptionLoD() { + public DescriptionLoD getDescriptionLoD() { return descriptionLoD; } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/Filter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/Filter.java index 03c1c01efa..dc44c8912b 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/Filter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/Filter.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.timeline.filters; +import javafx.beans.binding.BooleanBinding; import javafx.beans.property.SimpleBooleanProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; @@ -79,4 +80,8 @@ public interface Filter { SimpleBooleanProperty getDisabledProperty(); boolean isDisabled(); + + boolean isActive(); + + BooleanBinding activeProperty(); } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/AbstractFXCellFactory.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/AbstractFXCellFactory.java index 1a049a4e67..dadc14f121 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/AbstractFXCellFactory.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/AbstractFXCellFactory.java @@ -1,14 +1,20 @@ -/** - * ************************************************************************* - ** This data and information is proprietary to, and a valuable trade secret * - * of, Basis Technology Corp. It is given in confidence by Basis Technology * - * and may only be used as permitted under the license agreement under which * - * it has been distributed, and in no other way. * * Copyright (c) 2014 Basis - * Technology Corp. All rights reserved. * * The technical data and information - * provided herein are provided with * `limited rights', and the computer - * software provided herein is provided * with `restricted rights' as those - * terms are defined in DAR and ASPR * 7-104.9(a). - * ************************************************************************* +/* + * Autopsy Forensic Browser + * + * Copyright 2015 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.sleuthkit.autopsy.timeline.ui; diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/DetailViewPane.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/DetailViewPane.java index 744a9a6cb2..517cddde4e 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/DetailViewPane.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/DetailViewPane.java @@ -75,7 +75,7 @@ import org.sleuthkit.autopsy.timeline.datamodel.FilteredEventsModel; import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType; import org.sleuthkit.autopsy.timeline.ui.AbstractVisualization; import org.sleuthkit.autopsy.timeline.utils.RangeDivisionInfo; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; /** * Controller class for a {@link EventDetailChart} based implementation of a @@ -468,11 +468,11 @@ public class DetailViewPane extends AbstractVisualization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventDetailChart.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventDetailChart.java index ce3a210758..da07263e9f 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventDetailChart.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventDetailChart.java @@ -82,7 +82,7 @@ import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType; import org.sleuthkit.autopsy.timeline.filters.AbstractFilter; import org.sleuthkit.autopsy.timeline.filters.DescriptionFilter; import org.sleuthkit.autopsy.timeline.ui.TimeLineChart; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; /** * Custom implementation of {@link XYChart} to graph events on a horizontal @@ -326,7 +326,7 @@ public final class EventDetailChart extends XYChart impl public synchronized void setController(TimeLineController controller) { this.controller = controller; setModel(this.controller.getEventsModel()); - getController().getQuickHideMasks().addListener(layoutInvalidationListener); + getController().getQuickHideFilters().addListener(layoutInvalidationListener); } @Override @@ -478,18 +478,18 @@ public final class EventDetailChart extends XYChart impl double minY = 0; for (Series series : sortedSeriesList) { hiddenPartition = series.getData().stream().map(Data::getNode).map(EventStripeNode.class::cast) - .collect(Collectors.partitioningBy(node -> getController().getQuickHideMasks().stream() + .collect(Collectors.partitioningBy(node -> getController().getQuickHideFilters().stream() .filter(AbstractFilter::isActive) - .anyMatch(mask -> mask.getDescription().equals(node.getDescription())))); + .anyMatch(filter -> filter.getDescription().equals(node.getDescription())))); layoutNodesHelper(hiddenPartition.get(true), hiddenPartition.get(false), minY, 0); minY = maxY.get(); } } else { hiddenPartition = stripeNodeMap.values().stream() - .collect(Collectors.partitioningBy(node -> getController().getQuickHideMasks().stream() + .collect(Collectors.partitioningBy(node -> getController().getQuickHideFilters().stream() .filter(AbstractFilter::isActive) - .anyMatch(mask -> mask.getDescription().equals(node.getDescription())))); + .anyMatch(filter -> filter.getDescription().equals(node.getDescription())))); layoutNodesHelper(hiddenPartition.get(true), hiddenPartition.get(false), 0, 0); } setCursor(null); @@ -607,8 +607,9 @@ public final class EventDetailChart extends XYChart impl List subNodes = stripeNode.getSubNodes(); if (subNodes.isEmpty() == false) { Map> hiddenPartition = subNodes.stream() - .collect(Collectors.partitioningBy(testNode -> getController().getQuickHideMasks().stream() - .anyMatch(mask -> mask.getDescription().equals(testNode.getDescription())))); + .collect(Collectors.partitioningBy(testNode -> getController().getQuickHideFilters().stream() + .filter(AbstractFilter::isActive) + .anyMatch(filter -> filter.getDescription().equals(testNode.getDescription())))); layoutNodesResultHeight = layoutNodesHelper(hiddenPartition.get(true), hiddenPartition.get(false), minY, rawDisplayPosition); } @@ -730,8 +731,6 @@ public final class EventDetailChart extends XYChart impl return alternateLayout; } - - static private class DetailIntervalSelector extends IntervalSelector { DetailIntervalSelector(double x, double height, Axis axis, TimeLineController controller) { @@ -781,7 +780,7 @@ public final class EventDetailChart extends XYChart impl class HideDescriptionAction extends Action { - HideDescriptionAction(String description, DescriptionLOD descriptionLoD) { + HideDescriptionAction(String description, DescriptionLoD descriptionLoD) { super("Hide"); setGraphic(new ImageView(HIDE)); setEventHandler((ActionEvent t) -> { @@ -790,11 +789,11 @@ public final class EventDetailChart extends XYChart impl description, DescriptionFilter.FilterMode.EXCLUDE); - DescriptionFilter descriptionFilter = getController().getQuickHideMasks().stream() + DescriptionFilter descriptionFilter = getController().getQuickHideFilters().stream() .filter(testFilter::equals) .findFirst().orElseGet(() -> { testFilter.selectedProperty().addListener(layoutInvalidationListener); - getController().getQuickHideMasks().add(testFilter); + getController().getQuickHideFilters().add(testFilter); return testFilter; }); descriptionFilter.setSelected(true); @@ -805,12 +804,12 @@ public final class EventDetailChart extends XYChart impl class UnhideDescriptionAction extends Action { - UnhideDescriptionAction(String description, DescriptionLOD descriptionLoD) { + UnhideDescriptionAction(String description, DescriptionLoD descriptionLoD) { super("Unhide"); setGraphic(new ImageView(SHOW)); setEventHandler((ActionEvent t) -> - getController().getQuickHideMasks().stream() + getController().getQuickHideFilters().stream() .filter(descriptionFilter -> descriptionFilter.getDescriptionLoD().equals(descriptionLoD) && descriptionFilter.getDescription().equals(description)) .forEach(descriptionfilter -> descriptionfilter.setSelected(false)) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventStripeNode.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventStripeNode.java index 7188e1bc53..666b0e01c8 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventStripeNode.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/EventStripeNode.java @@ -81,7 +81,7 @@ import org.sleuthkit.autopsy.timeline.datamodel.eventtype.EventType; import org.sleuthkit.autopsy.timeline.filters.DescriptionFilter; import org.sleuthkit.autopsy.timeline.filters.RootFilter; import org.sleuthkit.autopsy.timeline.filters.TypeFilter; -import org.sleuthkit.autopsy.timeline.zooming.DescriptionLOD; +import org.sleuthkit.autopsy.timeline.zooming.DescriptionLoD; import org.sleuthkit.autopsy.timeline.zooming.EventTypeZoomLevel; import org.sleuthkit.autopsy.timeline.zooming.ZoomParams; import org.sleuthkit.datamodel.SleuthkitCase; @@ -116,7 +116,7 @@ final public class EventStripeNode extends StackPane { b.setManaged(show); } - private final SimpleObjectProperty descLOD = new SimpleObjectProperty<>(); + private final SimpleObjectProperty descLOD = new SimpleObjectProperty<>(); private DescriptionVisibility descrVis; private Tooltip tooltip; @@ -398,7 +398,7 @@ final public class EventStripeNode extends StackPane { } } - private DescriptionLOD getDescriptionLoD() { + private DescriptionLoD getDescriptionLoD() { return descLOD.get(); } @@ -409,7 +409,7 @@ final public class EventStripeNode extends StackPane { * @param expand */ @NbBundle.Messages(value = "EventStripeNode.loggedTask.name=Load sub clusters") - private synchronized void loadSubBundles(DescriptionLOD.RelativeDetail relativeDetail) { + private synchronized void loadSubBundles(DescriptionLoD.RelativeDetail relativeDetail) { chart.getEventBundles().removeIf(bundle -> getSubNodes().stream().anyMatch(subNode -> bundle.equals(subNode.getEventStripe())) @@ -436,7 +436,7 @@ final public class EventStripeNode extends StackPane { Task> loggedTask = new Task>() { - private volatile DescriptionLOD loadedDescriptionLoD = getDescriptionLoD().withRelativeDetail(relativeDetail); + private volatile DescriptionLoD loadedDescriptionLoD = getDescriptionLoD().withRelativeDetail(relativeDetail); { updateTitle(Bundle.EventStripeNode_loggedTask_name()); @@ -445,7 +445,7 @@ final public class EventStripeNode extends StackPane { @Override protected Collection call() throws Exception { Collection bundles; - DescriptionLOD next = loadedDescriptionLoD; + DescriptionLoD next = loadedDescriptionLoD; do { loadedDescriptionLoD = next; if (loadedDescriptionLoD == eventStripe.getDescriptionLoD()) { @@ -551,9 +551,9 @@ final public class EventStripeNode extends StackPane { } else if (t.isShortcutDown()) { chart.selectedNodes.removeAll(EventStripeNode.this); } else if (t.getClickCount() > 1) { - final DescriptionLOD next = descLOD.get().moreDetailed(); + final DescriptionLoD next = descLOD.get().moreDetailed(); if (next != null) { - loadSubBundles(DescriptionLOD.RelativeDetail.MORE); + loadSubBundles(DescriptionLoD.RelativeDetail.MORE); } } else { @@ -586,13 +586,13 @@ final public class EventStripeNode extends StackPane { setGraphic(new ImageView(PLUS)); setEventHandler((ActionEvent t) -> { - final DescriptionLOD next = descLOD.get().moreDetailed(); + final DescriptionLoD next = descLOD.get().moreDetailed(); if (next != null) { - loadSubBundles(DescriptionLOD.RelativeDetail.MORE); + loadSubBundles(DescriptionLoD.RelativeDetail.MORE); } }); - disabledProperty().bind(descLOD.isEqualTo(DescriptionLOD.FULL)); + disabledProperty().bind(descLOD.isEqualTo(DescriptionLoD.FULL)); } } @@ -604,9 +604,9 @@ final public class EventStripeNode extends StackPane { setGraphic(new ImageView(MINUS)); setEventHandler((ActionEvent t) -> { - final DescriptionLOD previous = descLOD.get().lessDetailed(); + final DescriptionLoD previous = descLOD.get().lessDetailed(); if (previous != null) { - loadSubBundles(DescriptionLOD.RelativeDetail.LESS); + loadSubBundles(DescriptionLoD.RelativeDetail.LESS); } }); disabledProperty().bind(Bindings.createBooleanBinding(() -> nonNull(eventStripe) && descLOD.get() == eventStripe.getDescriptionLoD(), descLOD)); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/tree/NavPanel.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/tree/NavPanel.java index e16aa157ce..9b8378ed6b 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/tree/NavPanel.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/detailview/tree/NavPanel.java @@ -49,6 +49,7 @@ import org.sleuthkit.autopsy.timeline.TimeLineController; import org.sleuthkit.autopsy.timeline.TimeLineView; import org.sleuthkit.autopsy.timeline.datamodel.EventBundle; import org.sleuthkit.autopsy.timeline.datamodel.FilteredEventsModel; +import org.sleuthkit.autopsy.timeline.filters.AbstractFilter; import org.sleuthkit.autopsy.timeline.filters.DescriptionFilter; import org.sleuthkit.autopsy.timeline.ui.detailview.DetailViewPane; @@ -164,17 +165,17 @@ public class NavPanel extends BorderPane implements TimeLineView { setTooltip(null); setGraphic(null); setContextMenu(null); - deRegisterListeners(controller.getQuickHideMasks()); + deRegisterListeners(controller.getQuickHideFilters()); } else { filterStateChangeListener = (filterState) -> updateHiddenState(item); - controller.getQuickHideMasks().addListener((ListChangeListener.Change listChange) -> { + controller.getQuickHideFilters().addListener((ListChangeListener.Change listChange) -> { while (listChange.next()) { deRegisterListeners(listChange.getRemoved()); registerListeners(listChange.getAddedSubList(), item); } updateHiddenState(item); }); - registerListeners(controller.getQuickHideMasks(), item); + registerListeners(controller.getQuickHideFilters(), item); String text = item.getDescription() + " (" + item.getCount() + ")"; // NON-NLS TreeItem parent = getTreeItem().getParent(); if (parent != null && parent.getValue() != null && (parent instanceof EventDescriptionTreeItem)) { @@ -207,7 +208,9 @@ public class NavPanel extends BorderPane implements TimeLineView { private void updateHiddenState(EventBundle item) { TreeItem treeItem = getTreeItem(); ContextMenu newMenu; - if (controller.getQuickHideMasks().stream().anyMatch((mask) -> mask.isActive() && mask.getDescription().equals(item.getDescription()))) { + if (controller.getQuickHideFilters().stream(). + filter(AbstractFilter::isActive) + .anyMatch(filter -> filter.getDescription().equals(item.getDescription()))) { if (treeItem != null) { treeItem.setExpanded(false); } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java index 6ee97c73a6..506554fbb7 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/filtering/FilterSetPanel.java @@ -201,7 +201,7 @@ final public class FilterSetPanel extends BorderPane implements TimeLineView { defaultButton.disableProperty().bind(defaultFiltersAction.disabledProperty()); this.setModel(timeLineController.getEventsModel()); - hiddenDescriptionsListView.setItems(controller.getQuickHideMasks()); + hiddenDescriptionsListView.setItems(controller.getQuickHideFilters()); hiddenDescriptionsListView.setCellFactory((ListView param) -> { final ListCell forList = new FilterCheckBoxCellFactory().forList(); @@ -217,7 +217,7 @@ final public class FilterSetPanel extends BorderPane implements TimeLineView { configureText(forList.getItem().selectedProperty().get()); setOnAction((ActionEvent event) -> { - controller.getQuickHideMasks().remove(forList.getItem()); + controller.getQuickHideFilters().remove(forList.getItem()); }); } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/zooming/DescriptionLOD.java b/Core/src/org/sleuthkit/autopsy/timeline/zooming/DescriptionLoD.java similarity index 80% rename from Core/src/org/sleuthkit/autopsy/timeline/zooming/DescriptionLOD.java rename to Core/src/org/sleuthkit/autopsy/timeline/zooming/DescriptionLoD.java index 4bb5669f1e..50d612b210 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/zooming/DescriptionLOD.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/zooming/DescriptionLoD.java @@ -23,11 +23,11 @@ import org.openide.util.NbBundle; /** * Enumeration of all description levels of detail. */ -public enum DescriptionLOD { +public enum DescriptionLoD { - SHORT(NbBundle.getMessage(DescriptionLOD.class, "DescriptionLOD.short")), - MEDIUM(NbBundle.getMessage(DescriptionLOD.class, "DescriptionLOD.medium")), - FULL(NbBundle.getMessage(DescriptionLOD.class, "DescriptionLOD.full")); + SHORT(NbBundle.getMessage(DescriptionLoD.class, "DescriptionLOD.short")), + MEDIUM(NbBundle.getMessage(DescriptionLoD.class, "DescriptionLOD.medium")), + FULL(NbBundle.getMessage(DescriptionLoD.class, "DescriptionLOD.full")); private final String displayName; @@ -35,11 +35,11 @@ public enum DescriptionLOD { return displayName; } - private DescriptionLOD(String displayName) { + private DescriptionLoD(String displayName) { this.displayName = displayName; } - public DescriptionLOD moreDetailed() { + public DescriptionLoD moreDetailed() { try { return values()[ordinal() + 1]; } catch (ArrayIndexOutOfBoundsException e) { @@ -47,7 +47,7 @@ public enum DescriptionLOD { } } - public DescriptionLOD lessDetailed() { + public DescriptionLoD lessDetailed() { try { return values()[ordinal() - 1]; } catch (ArrayIndexOutOfBoundsException e) { @@ -55,7 +55,7 @@ public enum DescriptionLOD { } } - public DescriptionLOD withRelativeDetail(RelativeDetail relativeDetail) { + public DescriptionLoD withRelativeDetail(RelativeDetail relativeDetail) { switch (relativeDetail) { case EQUAL: return this; @@ -68,7 +68,7 @@ public enum DescriptionLOD { } } - public RelativeDetail getDetailLevelRelativeTo(DescriptionLOD other) { + public RelativeDetail getDetailLevelRelativeTo(DescriptionLoD other) { int compareTo = this.compareTo(other); if (compareTo < 0) { return RelativeDetail.LESS; diff --git a/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomParams.java b/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomParams.java index 9ee3cd8c96..2bb289f091 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomParams.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomParams.java @@ -35,7 +35,7 @@ public class ZoomParams { private final RootFilter filter; - private final DescriptionLOD descrLOD; + private final DescriptionLoD descrLOD; public Interval getTimeRange() { return timeRange; @@ -49,11 +49,11 @@ public class ZoomParams { return filter; } - public DescriptionLOD getDescriptionLOD() { + public DescriptionLoD getDescriptionLOD() { return descrLOD; } - public ZoomParams(Interval timeRange, EventTypeZoomLevel zoomLevel, RootFilter filter, DescriptionLOD descrLOD) { + public ZoomParams(Interval timeRange, EventTypeZoomLevel zoomLevel, RootFilter filter, DescriptionLoD descrLOD) { this.timeRange = timeRange; this.typeZoomLevel = zoomLevel; this.filter = filter; @@ -72,7 +72,7 @@ public class ZoomParams { return new ZoomParams(timeRange, typeZoomLevel, filter, descrLOD); } - public ZoomParams withDescrLOD(DescriptionLOD descrLOD) { + public ZoomParams withDescrLOD(DescriptionLoD descrLOD) { return new ZoomParams(timeRange, typeZoomLevel, filter, descrLOD); } @@ -92,7 +92,7 @@ public class ZoomParams { return this.timeRange == null ? false : this.timeRange.equals(timeRange); } - public boolean hasDescrLOD(DescriptionLOD newLOD) { + public boolean hasDescrLOD(DescriptionLoD newLOD) { return this.descrLOD.equals(newLOD); } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomSettingsPane.java b/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomSettingsPane.java index 0e93c5f27d..b1c5719625 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomSettingsPane.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/zooming/ZoomSettingsPane.java @@ -97,7 +97,7 @@ public class ZoomSettingsPane extends TitledPane implements TimeLineView { typeZoomSlider.setMin(1); typeZoomSlider.setMax(2); typeZoomSlider.setLabelFormatter(new TypeZoomConverter()); - descrLODSlider.setMax(DescriptionLOD.values().length - 1); + descrLODSlider.setMax(DescriptionLoD.values().length - 1); descrLODSlider.setLabelFormatter(new DescrLODConverter()); descrLODLabel.setText( NbBundle.getMessage(this.getClass(), "ZoomSettingsPane.descrLODLabel.text")); @@ -154,7 +154,7 @@ public class ZoomSettingsPane extends TitledPane implements TimeLineView { initializeSlider(descrLODSlider, () -> { - DescriptionLOD newLOD = DescriptionLOD.values()[Math.round(descrLODSlider.valueProperty().floatValue())]; + DescriptionLoD newLOD = DescriptionLoD.values()[Math.round(descrLODSlider.valueProperty().floatValue())]; if (controller.pushDescrLOD(newLOD) == false) { descrLODSlider.setValue(new DescrLODConverter().fromString(filteredEvents.getDescriptionLOD().toString())); } @@ -244,12 +244,12 @@ public class ZoomSettingsPane extends TitledPane implements TimeLineView { @Override public String toString(Double object) { - return DescriptionLOD.values()[object.intValue()].getDisplayName(); + return DescriptionLoD.values()[object.intValue()].getDisplayName(); } @Override public Double fromString(String string) { - return new Integer(DescriptionLOD.valueOf(string).ordinal()).doubleValue(); + return new Integer(DescriptionLoD.valueOf(string).ordinal()).doubleValue(); } } } diff --git a/CoreLibs/nbproject/project.xml b/CoreLibs/nbproject/project.xml index dfb0eb4c9d..0f07ff2b83 100644 --- a/CoreLibs/nbproject/project.xml +++ b/CoreLibs/nbproject/project.xml @@ -29,13 +29,18 @@ com.apple.eawt com.apple.eawt.event com.apple.eio + com.google.common.annotations com.google.common.base com.google.common.cache com.google.common.collect com.google.common.escape com.google.common.eventbus + com.google.common.hash com.google.common.html com.google.common.io + com.google.common.math + com.google.common.net + com.google.common.primitives com.google.common.reflect com.google.common.util.concurrent com.google.common.xml