From 5bb7332450a16181b531452163579cd5ad0cf046 Mon Sep 17 00:00:00 2001 From: jmillman Date: Mon, 4 Apr 2016 17:03:20 -0400 Subject: [PATCH 1/3] fix copying of filters --- .../sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java | 1 + .../org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java | 1 + Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java | 1 + 3 files changed, 3 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java index 02318310f1..b02279b2e3 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java @@ -37,6 +37,7 @@ public class DataSourcesFilter extends UnionFilter { public DataSourcesFilter copyOf() { final DataSourcesFilter filterCopy = new DataSourcesFilter(); filterCopy.setSelected(isSelected()); + filterCopy.setDisabled(isDisabled()); //add a copy of each subfilter this.getSubFilters().forEach((DataSourceFilter t) -> { filterCopy.addSubFilter(t.copyOf()); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java index b7a13184f7..7404663716 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java @@ -30,6 +30,7 @@ public class HashHitsFilter extends UnionFilter { public HashHitsFilter copyOf() { HashHitsFilter filterCopy = new HashHitsFilter(); filterCopy.setSelected(isSelected()); + filterCopy.setDisabled(isDisabled()); //add a copy of each subfilter this.getSubFilters().forEach((HashSetFilter t) -> { filterCopy.addSubFilter(t.copyOf()); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java index 1ab69a3909..bcf00d2d23 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java @@ -31,6 +31,7 @@ public class TagsFilter extends UnionFilter { public TagsFilter copyOf() { TagsFilter filterCopy = new TagsFilter(); filterCopy.setSelected(isSelected()); + filterCopy.setDisabled(isDisabled()); //add a copy of each subfilter this.getSubFilters().forEach((TagNameFilter t) -> { filterCopy.addSubFilter(t.copyOf()); From 6c08ea496a1586ef354d03afd23538f5e4be6a09 Mon Sep 17 00:00:00 2001 From: jmillman Date: Tue, 5 Apr 2016 15:44:57 -0400 Subject: [PATCH 2/3] fix further bug related filter copying/equality --- .../autopsy/timeline/datamodel/FilteredEventsModel.java | 7 +------ .../sleuthkit/autopsy/timeline/filters/CompoundFilter.java | 4 +--- .../autopsy/timeline/filters/DataSourcesFilter.java | 2 +- .../sleuthkit/autopsy/timeline/filters/HashHitsFilter.java | 2 +- .../org/sleuthkit/autopsy/timeline/filters/TagsFilter.java | 2 +- .../org/sleuthkit/autopsy/timeline/filters/TypeFilter.java | 2 +- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/FilteredEventsModel.java b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/FilteredEventsModel.java index 14a0d878f8..bf161241b1 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/datamodel/FilteredEventsModel.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/datamodel/FilteredEventsModel.java @@ -23,7 +23,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Set; import java.util.logging.Level; import javafx.beans.Observable; @@ -150,11 +149,7 @@ public final class FilteredEventsModel { final ZoomParams zoomParams = requestedZoomParamters.get(); if (zoomParams != null) { - if (zoomParams.getTypeZoomLevel().equals(requestedTypeZoom.get()) == false - || zoomParams.getDescriptionLOD().equals(requestedLOD.get()) == false - || zoomParams.getFilter().equals(requestedFilter.get()) == false - || Objects.equals(zoomParams.getTimeRange(), requestedTimeRange.get()) == false) { - + synchronized (FilteredEventsModel.this) { requestedTypeZoom.set(zoomParams.getTypeZoomLevel()); requestedFilter.set(zoomParams.getFilter()); requestedTimeRange.set(zoomParams.getTimeRange()); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/CompoundFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/CompoundFilter.java index dff26b1e61..9996e0f2c7 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/CompoundFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/CompoundFilter.java @@ -93,9 +93,7 @@ public abstract class CompoundFilter extends Abstr for (int i = 0; i < oneFilter.getSubFilters().size(); i++) { final SubFilterType subFilter = oneFilter.getSubFilters().get(i); final SubFilterType otherSubFilter = otherFilter.getSubFilters().get(i); - if (subFilter.equals(otherSubFilter) == false - || subFilter.isDisabled() != otherSubFilter.isDisabled() - || subFilter.isSelected() != otherSubFilter.isSelected()) { + if (subFilter.equals(otherSubFilter) == false) { return false; } } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java index b02279b2e3..3a52535327 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java @@ -88,7 +88,7 @@ public class DataSourcesFilter extends UnionFilter { } final DataSourcesFilter other = (DataSourcesFilter) obj; - if (isSelected() != other.isSelected()) { + if (isActive() != other.isActive()) { return false; } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java index 7404663716..81b8566860 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java @@ -66,7 +66,7 @@ public class HashHitsFilter extends UnionFilter { } final HashHitsFilter other = (HashHitsFilter) obj; - if (isSelected() != other.isSelected()) { + if (isActive() != other.isActive()) { return false; } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java index bcf00d2d23..4787da89f3 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java @@ -67,7 +67,7 @@ public class TagsFilter extends UnionFilter { } final TagsFilter other = (TagsFilter) obj; - if (isSelected() != other.isSelected()) { + if (isActive() != other.isActive()) { return false; } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/TypeFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/TypeFilter.java index 85a299e5fc..bc2c84bae0 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/TypeFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/TypeFilter.java @@ -126,7 +126,7 @@ public class TypeFilter extends UnionFilter { } final TypeFilter other = (TypeFilter) obj; - if (isSelected() != other.isSelected()) { + if (isActive() != other.isActive()) { return false; } From 4a2753393f0de6e51b3390b5c508a9fdf1517ebc Mon Sep 17 00:00:00 2001 From: jmillman Date: Tue, 5 Apr 2016 16:10:40 -0400 Subject: [PATCH 3/3] update copyright --- .../timeline/filters/CompoundFilter.java | 7 ++----- .../timeline/filters/DataSourcesFilter.java | 2 +- .../timeline/filters/HashHitsFilter.java | 19 ++++++++++++++++--- .../autopsy/timeline/filters/TagsFilter.java | 19 ++++++++++++++++--- .../autopsy/timeline/filters/TypeFilter.java | 2 +- .../autopsy/timeline/filters/UnionFilter.java | 2 +- 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/CompoundFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/CompoundFilter.java index 9996e0f2c7..bd88a6d90b 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/CompoundFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/CompoundFilter.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014-15 Basis Technology Corp. + * Copyright 2014-16 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,10 +33,7 @@ import javafx.collections.ObservableList; * a {@link CompoundFilter} uses listeners to enforce the following * relationships between it and its sub-filters: *
    - * if a filter becomes active, and all its sub-filters were inactive, make - * them all active - * if a filter becomes inactive and all its sub-filters were active, make - * them all inactive + * if a filter becomes inactive disable all of its subfilters * if a sub-filter changes active state set the parent filter active if any * of its sub-filters are active. *
diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java index 3a52535327..0da318e80d 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/DataSourcesFilter.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2015 Basis Technology Corp. + * Copyright 2015-16 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java index 81b8566860..371f32dcdc 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/HashHitsFilter.java @@ -1,7 +1,20 @@ /* - * 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. + * Autopsy Forensic Browser + * + * Copyright 2015-16 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.filters; diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java index 4787da89f3..4c92a3b02a 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/TagsFilter.java @@ -1,7 +1,20 @@ /* - * 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. + * Autopsy Forensic Browser + * + * Copyright 2015-16 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.filters; diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/TypeFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/TypeFilter.java index bc2c84bae0..4968e92e80 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/TypeFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/TypeFilter.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013-15 Basis Technology Corp. + * Copyright 2013-16 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/filters/UnionFilter.java b/Core/src/org/sleuthkit/autopsy/timeline/filters/UnionFilter.java index 07ef904e75..27bec42c72 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/filters/UnionFilter.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/filters/UnionFilter.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014-15 Basis Technology Corp. + * Copyright 2014-16 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License");