From 84b129f935600a379ee1177dc6473d48b66f0791 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 6 May 2020 04:24:24 -0400 Subject: [PATCH 01/51] 6305 change name of tool to discovery and refactor package name from filequery --- .../sleuthkit/autopsy/casemodule/Case.java | 6 +- .../Bundle.properties | 0 .../Bundle.properties-MERGED | 0 .../DataSourceModulesWrapper.java | 2 +- .../DiscoveryEventUtils.java | 6 +- .../DiscoveryExtractAction.java | 2 +- .../DiscoveryThumbnailChildren.java | 2 +- .../DiscoveryTopComponent.form | 8 +-- .../DiscoveryTopComponent.java | 4 +- .../DiscoveryUiUtils.java | 4 +- .../DocumentPanel.form | 16 ++--- .../DocumentPanel.java | 14 ++--- .../DocumentPreviewViewer.form | 0 .../DocumentPreviewViewer.java | 2 +- .../DocumentWrapper.java | 2 +- .../{filequery => discovery}/FileGroup.java | 4 +- .../{filequery => discovery}/FileSearch.java | 8 +-- .../FileSearchData.java | 2 +- .../FileSearchException.java | 2 +- .../FileSearchFiltering.java | 10 ++-- .../FileSearchPanel.form | 58 +++++++++---------- .../FileSearchPanel.java | 18 +++--- .../{filequery => discovery}/FileSorter.java | 2 +- .../GroupListPanel.form | 2 +- .../GroupListPanel.java | 6 +- .../ImageThumbnailPanel.form | 14 ++--- .../ImageThumbnailPanel.java | 14 ++--- .../ImageThumbnailViewer.form | 0 .../ImageThumbnailViewer.java | 2 +- .../ImageThumbnailWrapper.java | 2 +- .../OpenDiscoveryAction.java} | 30 +++++----- .../{filequery => discovery}/PageWorker.java | 4 +- .../{filequery => discovery}/ResultFile.java | 4 +- .../ResultsPanel.form | 12 ++-- .../ResultsPanel.java | 8 +-- .../SearchResults.java | 4 +- .../SearchWorker.java | 4 +- .../VideoThumbnailPanel.form | 12 ++-- .../VideoThumbnailPanel.java | 14 ++--- .../VideoThumbnailViewer.form | 4 +- .../VideoThumbnailViewer.java | 6 +- .../VideoThumbnailsWrapper.java | 2 +- 42 files changed, 158 insertions(+), 158 deletions(-) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/Bundle.properties (100%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/Bundle.properties-MERGED (100%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DataSourceModulesWrapper.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DiscoveryEventUtils.java (98%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DiscoveryExtractAction.java (97%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DiscoveryThumbnailChildren.java (98%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DiscoveryTopComponent.form (96%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DiscoveryTopComponent.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DiscoveryUiUtils.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DocumentPanel.form (91%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DocumentPanel.java (93%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DocumentPreviewViewer.form (100%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DocumentPreviewViewer.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/DocumentWrapper.java (98%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/FileGroup.java (98%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/FileSearch.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/FileSearchData.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/FileSearchException.java (96%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/FileSearchFiltering.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/FileSearchPanel.form (96%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/FileSearchPanel.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/FileSorter.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/GroupListPanel.form (98%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/GroupListPanel.java (98%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/ImageThumbnailPanel.form (90%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/ImageThumbnailPanel.java (92%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/ImageThumbnailViewer.form (100%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/ImageThumbnailViewer.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/ImageThumbnailWrapper.java (97%) rename Core/src/org/sleuthkit/autopsy/{filequery/OpenFileDiscoveryAction.java => discovery/OpenDiscoveryAction.java} (81%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/PageWorker.java (97%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/ResultFile.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/ResultsPanel.form (97%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/ResultsPanel.java (99%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/SearchResults.java (98%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/SearchWorker.java (97%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/VideoThumbnailPanel.form (88%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/VideoThumbnailPanel.java (94%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/VideoThumbnailViewer.form (95%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/VideoThumbnailViewer.java (94%) rename Core/src/org/sleuthkit/autopsy/{filequery => discovery}/VideoThumbnailsWrapper.java (98%) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 6c6e102dac..aeb5da195b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -107,7 +107,7 @@ import org.sleuthkit.autopsy.coreutils.Version; import org.sleuthkit.autopsy.events.AutopsyEvent; import org.sleuthkit.autopsy.events.AutopsyEventException; import org.sleuthkit.autopsy.events.AutopsyEventPublisher; -import org.sleuthkit.autopsy.filequery.OpenFileDiscoveryAction; +import org.sleuthkit.autopsy.discovery.OpenDiscoveryAction; import org.sleuthkit.autopsy.ingest.IngestJob; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestServices; @@ -1124,7 +1124,7 @@ public class Case { CallableSystemAction.get(OpenCommVisualizationToolAction.class).setEnabled(true); CallableSystemAction.get(CommonAttributeSearchAction.class).setEnabled(true); CallableSystemAction.get(OpenOutputFolderAction.class).setEnabled(false); - CallableSystemAction.get(OpenFileDiscoveryAction.class).setEnabled(true); + CallableSystemAction.get(OpenDiscoveryAction.class).setEnabled(true); /* * Add the case to the recent cases tracker that supplies a list @@ -1179,7 +1179,7 @@ public class Case { CallableSystemAction.get(OpenCommVisualizationToolAction.class).setEnabled(false); CallableSystemAction.get(OpenOutputFolderAction.class).setEnabled(false); CallableSystemAction.get(CommonAttributeSearchAction.class).setEnabled(false); - CallableSystemAction.get(OpenFileDiscoveryAction.class).setEnabled(false); + CallableSystemAction.get(OpenDiscoveryAction.class).setEnabled(false); /* * Clear the notifications in the notfier component in the lower diff --git a/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties similarity index 100% rename from Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties rename to Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties diff --git a/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED similarity index 100% rename from Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED rename to Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DataSourceModulesWrapper.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceModulesWrapper.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/DataSourceModulesWrapper.java rename to Core/src/org/sleuthkit/autopsy/discovery/DataSourceModulesWrapper.java index 53cabedfb3..b1857c2413 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DataSourceModulesWrapper.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceModulesWrapper.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.modules.exif.ExifParserModuleFactory; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryEventUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/filequery/DiscoveryEventUtils.java rename to Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java index f73cf4171e..bc0c8e32df 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryEventUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java @@ -16,14 +16,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.EventBus; import java.util.Collections; import java.util.List; import java.util.Map; -import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileType; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; /** * Class to handle event bus and events for file discovery tool. diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryExtractAction.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryExtractAction.java similarity index 97% rename from Core/src/org/sleuthkit/autopsy/filequery/DiscoveryExtractAction.java rename to Core/src/org/sleuthkit/autopsy/discovery/DiscoveryExtractAction.java index 27d1d8e401..171b7530ee 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryExtractAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryExtractAction.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import org.sleuthkit.autopsy.directorytree.actionhelpers.ExtractActionHelper; import java.awt.event.ActionEvent; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryThumbnailChildren.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryThumbnailChildren.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/filequery/DiscoveryThumbnailChildren.java rename to Core/src/org/sleuthkit/autopsy/discovery/DiscoveryThumbnailChildren.java index 35ee60ac5c..bdcf2f876f 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryThumbnailChildren.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryThumbnailChildren.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.Arrays; import java.util.HashSet; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form similarity index 96% rename from Core/src/org/sleuthkit/autopsy/filequery/DiscoveryTopComponent.form rename to Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index a97349ea65..a7c22dd434 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -136,7 +136,7 @@ - + @@ -160,7 +160,7 @@ - + @@ -174,7 +174,7 @@ - + @@ -222,7 +222,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/DiscoveryTopComponent.java rename to Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index 91d1db2b12..9c2da771ca 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.Subscribe; import java.awt.Color; @@ -42,7 +42,7 @@ import org.sleuthkit.datamodel.AbstractFile; @TopComponent.Description(preferredID = "DiscoveryTopComponent", persistenceType = TopComponent.PERSISTENCE_NEVER) @TopComponent.Registration(mode = "discovery", openAtStartup = false) @RetainLocation("discovery") -@NbBundle.Messages("DiscoveryTopComponent.name= File Discovery") +@NbBundle.Messages("DiscoveryTopComponent.name= Discovery") public final class DiscoveryTopComponent extends TopComponent { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryUiUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/DiscoveryUiUtils.java rename to Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java index 0a8f93fa92..9923cf2050 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryUiUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.awt.Component; import java.awt.Point; @@ -26,7 +26,7 @@ import org.openide.util.ImageUtilities; import org.openide.util.NbBundle; /** - * Utility class for the various user interface elements used by File Discovery. + * Utility class for the various user interface elements used by Discovery. */ final class DiscoveryUiUtils { diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DocumentPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.form similarity index 91% rename from Core/src/org/sleuthkit/autopsy/filequery/DocumentPanel.form rename to Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.form index beacd1f271..bb29cdb8b4 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DocumentPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.form @@ -80,16 +80,16 @@ - + - + - + - + @@ -100,20 +100,20 @@ - + - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DocumentPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java similarity index 93% rename from Core/src/org/sleuthkit/autopsy/filequery/DocumentPanel.java rename to Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java index 6f6008a053..b76f835659 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DocumentPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.awt.Color; import java.awt.Component; @@ -67,15 +67,15 @@ public class DocumentPanel extends javax.swing.JPanel implements ListCellRendere isDeletedLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/file-icon-deleted.png"))); // NOI18N isDeletedLabel.setToolTipText(org.openide.util.NbBundle.getMessage(DocumentPanel.class, "DocumentPanel.isDeletedLabel.toolTipText")); // NOI18N - isDeletedLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - isDeletedLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - isDeletedLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); + isDeletedLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + isDeletedLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + isDeletedLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); scoreLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/red-circle-exclamation.png"))); // NOI18N scoreLabel.setToolTipText(""); - scoreLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - scoreLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - scoreLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); fileSizeLabel.setToolTipText(org.openide.util.NbBundle.getMessage(DocumentPanel.class, "DocumentPanel.fileSizeLabel.toolTipText")); // NOI18N diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DocumentPreviewViewer.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.form similarity index 100% rename from Core/src/org/sleuthkit/autopsy/filequery/DocumentPreviewViewer.form rename to Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.form diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DocumentPreviewViewer.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/DocumentPreviewViewer.java rename to Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.java index c65287da42..057ee777aa 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DocumentPreviewViewer.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.ArrayList; import java.util.List; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DocumentWrapper.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentWrapper.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/filequery/DocumentWrapper.java rename to Core/src/org/sleuthkit/autopsy/discovery/DocumentWrapper.java index 9bf3b173ff..dd35604a82 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DocumentWrapper.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentWrapper.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.textsummarizer.TextSummary; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileGroup.java b/Core/src/org/sleuthkit/autopsy/discovery/FileGroup.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/filequery/FileGroup.java rename to Core/src/org/sleuthkit/autopsy/discovery/FileGroup.java index 3c69c4c8f3..ad88550df6 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileGroup.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileGroup.java @@ -16,13 +16,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.openide.util.NbBundle.Messages; -import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; /** * Class for storing files that belong to a particular group. diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearch.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearch.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/FileSearch.java rename to Core/src/org/sleuthkit/autopsy/discovery/FileSearch.java index b25f83d195..0590351793 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearch.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearch.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; @@ -66,9 +66,9 @@ import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import static org.sleuthkit.autopsy.coreutils.VideoUtils.getVideoFileInTempDir; import org.sleuthkit.autopsy.datamodel.ContentUtils; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileSize; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileType; -import org.sleuthkit.autopsy.filequery.FileSearchData.Frequency; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; +import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchData.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/FileSearchData.java rename to Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java index 8efabf2704..588fa015da 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchData.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import com.google.common.collect.ImmutableSet; import java.util.ArrayList; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchException.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java similarity index 96% rename from Core/src/org/sleuthkit/autopsy/filequery/FileSearchException.java rename to Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java index 2b9a79b39c..1b2b8fdd2a 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchException.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; /** * Exception type used for FileSearch diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchFiltering.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchFiltering.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/FileSearchFiltering.java rename to Core/src/org/sleuthkit/autopsy/discovery/FileSearchFiltering.java index a96db2fd35..4b4830518b 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchFiltering.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchFiltering.java @@ -16,15 +16,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance; import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeNormalizationException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileSize; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileType; -import org.sleuthkit.autopsy.filequery.FileSearchData.Frequency; -import org.sleuthkit.autopsy.filequery.FileSearchData.Score; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; +import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; +import org.sleuthkit.autopsy.discovery.FileSearchData.Score; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.DataSource; import org.sleuthkit.datamodel.SleuthkitCase; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form similarity index 96% rename from Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.form rename to Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form index 5ea238b49a..27e383ed3b 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form @@ -94,7 +94,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -188,7 +188,7 @@ - + @@ -232,7 +232,7 @@ - + @@ -245,7 +245,7 @@ - + @@ -270,7 +270,7 @@ - + @@ -373,7 +373,7 @@ - + @@ -418,7 +418,7 @@ - + @@ -459,7 +459,7 @@ - + @@ -474,7 +474,7 @@ - + @@ -489,7 +489,7 @@ - + @@ -504,7 +504,7 @@ - + @@ -519,7 +519,7 @@ - + @@ -531,7 +531,7 @@ - + @@ -650,7 +650,7 @@ - + @@ -663,10 +663,10 @@ - + - + @@ -713,7 +713,7 @@ - + @@ -768,7 +768,7 @@ - + @@ -816,7 +816,7 @@ - + @@ -828,7 +828,7 @@ - + @@ -912,7 +912,7 @@ - + @@ -923,7 +923,7 @@ - + @@ -934,7 +934,7 @@ - + @@ -959,7 +959,7 @@ - + @@ -972,7 +972,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.java rename to Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java index eb823f0530..641fb9b5a8 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.Subscribe; import java.awt.Cursor; @@ -38,14 +38,14 @@ import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.filequery.FileGroup.GroupSortingAlgorithm; -import org.sleuthkit.autopsy.filequery.FileSearch.GroupingAttributeType; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileType; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileSize; -import org.sleuthkit.autopsy.filequery.FileSearchData.Frequency; -import org.sleuthkit.autopsy.filequery.FileSearchData.Score; -import org.sleuthkit.autopsy.filequery.FileSearchFiltering.ParentSearchTerm; -import org.sleuthkit.autopsy.filequery.FileSorter.SortingMethod; +import org.sleuthkit.autopsy.discovery.FileGroup.GroupSortingAlgorithm; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupingAttributeType; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; +import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; +import org.sleuthkit.autopsy.discovery.FileSearchData.Score; +import org.sleuthkit.autopsy.discovery.FileSearchFiltering.ParentSearchTerm; +import org.sleuthkit.autopsy.discovery.FileSorter.SortingMethod; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSorter.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSorter.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/FileSorter.java rename to Core/src/org/sleuthkit/autopsy/discovery/FileSorter.java index 6d73c20b01..fc74dd5713 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSorter.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSorter.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.ArrayList; import java.util.Arrays; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.form similarity index 98% rename from Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.form rename to Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.form index 9df241e5ab..be51027b3a 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.form @@ -46,7 +46,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java rename to Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java index 374c079590..46e29ab524 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.Subscribe; import java.util.List; @@ -26,8 +26,8 @@ import javax.swing.DefaultListModel; import javax.swing.JList; import javax.swing.JOptionPane; import org.openide.util.NbBundle.Messages; -import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileType; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; /** * Panel to display the list of groups which are provided by a search diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.form similarity index 90% rename from Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailPanel.form rename to Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.form index b491a2c6de..c3ae30091c 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.form @@ -102,16 +102,16 @@ - + - + - + - + @@ -122,13 +122,13 @@ - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java similarity index 92% rename from Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailPanel.java rename to Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java index 78654296cb..7e44cd345c 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.awt.Color; import java.awt.Component; @@ -76,15 +76,15 @@ public class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellR isDeletedLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/file-icon-deleted.png"))); // NOI18N isDeletedLabel.setToolTipText(org.openide.util.NbBundle.getMessage(ImageThumbnailPanel.class, "ImageThumbnailPanel.isDeletedLabel.toolTipText")); // NOI18N - isDeletedLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - isDeletedLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - isDeletedLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); + isDeletedLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + isDeletedLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + isDeletedLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); scoreLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/red-circle-exclamation.png"))); // NOI18N scoreLabel.setToolTipText(""); - scoreLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - scoreLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - scoreLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailViewer.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.form similarity index 100% rename from Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailViewer.form rename to Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.form diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailViewer.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailViewer.java rename to Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java index e2688359c9..5039464ba9 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailViewer.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.ArrayList; import java.util.List; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailWrapper.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailWrapper.java similarity index 97% rename from Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailWrapper.java rename to Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailWrapper.java index dd1923007d..09eeb913ca 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/ImageThumbnailWrapper.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailWrapper.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.awt.Image; import org.sleuthkit.autopsy.coreutils.ImageUtils; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/OpenFileDiscoveryAction.java b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java similarity index 81% rename from Core/src/org/sleuthkit/autopsy/filequery/OpenFileDiscoveryAction.java rename to Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java index 188939c6b6..091e698a4b 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/OpenFileDiscoveryAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.awt.Component; import java.util.HashMap; @@ -42,26 +42,26 @@ import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; /** - * Class to open the File Discovery top component. Allows the user to run + * Class to open the Discovery top component. Allows the user to run * searches and see results. */ -@ActionID(category = "Tools", id = "org.sleuthkit.autopsy.newpackage.OpenFileDiscoveryAction") +@ActionID(category = "Tools", id = "org.sleuthkit.autopsy.newpackage.OpenDiscoveryAction") @ActionReferences(value = { @ActionReference(path = "Menu/Tools", position = 103) , @ActionReference(path = "Toolbars/Case", position = 105)}) -@ActionRegistration(displayName = "#CTL_OpenFileDiscoveryAction", lazy = false) -@NbBundle.Messages({"CTL_OpenFileDiscoveryAction=File Discovery"}) -public final class OpenFileDiscoveryAction extends CallableSystemAction implements Presenter.Toolbar { +@ActionRegistration(displayName = "#CTL_OpenDiscoveryAction", lazy = false) +@NbBundle.Messages({"CTL_OpenDiscoveryAction=Discovery"}) +public final class OpenDiscoveryAction extends CallableSystemAction implements Presenter.Toolbar { - private static final Logger logger = Logger.getLogger(OpenFileDiscoveryAction.class.getName()); + private static final Logger logger = Logger.getLogger(OpenDiscoveryAction.class.getName()); - private static final String DISPLAY_NAME = Bundle.CTL_OpenFileDiscoveryAction(); + private static final String DISPLAY_NAME = Bundle.CTL_OpenDiscoveryAction(); private static final long serialVersionUID = 1L; private final JButton toolbarButton = new JButton(); - public OpenFileDiscoveryAction() { - toolbarButton.addActionListener(OpenFileDiscoveryAction.this::actionPerformed); + public OpenDiscoveryAction() { + toolbarButton.addActionListener(OpenDiscoveryAction.this::actionPerformed); this.setEnabled(false); } @@ -70,7 +70,7 @@ public final class OpenFileDiscoveryAction extends CallableSystemAction implemen return Case.isCaseOpen(); } - @NbBundle.Messages({"OpenFileDiscoveryAction.resultsIncomplete.text=Results may be incomplete"}) + @NbBundle.Messages({"OpenDiscoveryAction.resultsIncomplete.text=Results may be incomplete"}) @Override @SuppressWarnings("fallthrough") @@ -90,9 +90,9 @@ public final class OpenFileDiscoveryAction extends CallableSystemAction implemen /** * Private helper method to display an error message when the results of the - * File Discovery Top component may be incomplete. + * Discovery Top component may be incomplete. * - * @param tc The File Discovery Top component. + * @param tc The Discovery Top component. */ private void displayErrorMessage(DiscoveryTopComponent tc) { //check if modules run and assemble message @@ -111,10 +111,10 @@ public final class OpenFileDiscoveryAction extends CallableSystemAction implemen message += dsmodulesWrapper.getMessage(); } if (!message.isEmpty()) { - JOptionPane.showMessageDialog(tc, message, Bundle.OpenFileDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(tc, message, Bundle.OpenDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE); } } catch (NoCurrentCaseException | TskCoreException ex) { - logger.log(Level.WARNING, "Exception while determining which modules have been run for File Discovery", ex); + logger.log(Level.WARNING, "Exception while determining which modules have been run for Discovery", ex); } } diff --git a/Core/src/org/sleuthkit/autopsy/filequery/PageWorker.java b/Core/src/org/sleuthkit/autopsy/discovery/PageWorker.java similarity index 97% rename from Core/src/org/sleuthkit/autopsy/filequery/PageWorker.java rename to Core/src/org/sleuthkit/autopsy/discovery/PageWorker.java index 04ee8b05bd..6eda6c6c3a 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/PageWorker.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PageWorker.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.List; import java.util.ArrayList; @@ -24,7 +24,7 @@ import java.util.logging.Level; import javax.swing.SwingWorker; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; /** diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ResultFile.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultFile.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/ResultFile.java rename to Core/src/org/sleuthkit/autopsy/discovery/ResultFile.java index e6b16d34c9..be174dbc6e 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/ResultFile.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultFile.java @@ -16,9 +16,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; -import org.sleuthkit.autopsy.filequery.FileSearchData.FileType; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; import org.sleuthkit.datamodel.AbstractFile; import java.util.ArrayList; import java.util.Collections; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form similarity index 97% rename from Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.form rename to Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form index 09e12b5693..bc265187e9 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form @@ -81,7 +81,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -197,7 +197,7 @@ - + @@ -316,7 +316,7 @@ - + @@ -388,7 +388,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java similarity index 99% rename from Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.java rename to Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 0acc2e1bf3..9a22418fb7 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.Subscribe; import java.awt.Component; @@ -50,7 +50,7 @@ import org.sleuthkit.autopsy.datamodel.FileNode; import org.sleuthkit.autopsy.directorytree.ExternalViewerAction; import org.sleuthkit.autopsy.directorytree.ViewContextAction; import org.sleuthkit.autopsy.timeline.actions.ViewFileInTimelineAction; -import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; import org.sleuthkit.autopsy.modules.hashdatabase.AddContentToHashDbAction; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException; @@ -58,7 +58,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.textsummarizer.TextSummary; /** - * Panel for displaying of file discovery results and handling the paging of + * Panel for displaying of Discovery results and handling the paging of * those results. */ public class ResultsPanel extends javax.swing.JPanel { @@ -376,7 +376,7 @@ public class ResultsPanel extends javax.swing.JPanel { centralRepo = CentralRepository.getInstance(); } catch (CentralRepoException ex) { centralRepo = null; - logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex); + logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for Discovery", ex); } } pageWorker = new PageWorker(searchFilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupKey, startingEntry, pageSize, resultType, centralRepo); diff --git a/Core/src/org/sleuthkit/autopsy/filequery/SearchResults.java b/Core/src/org/sleuthkit/autopsy/discovery/SearchResults.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/filequery/SearchResults.java rename to Core/src/org/sleuthkit/autopsy/discovery/SearchResults.java index 7cc9b8a596..9e2b6f162c 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/SearchResults.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SearchResults.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.ArrayList; import java.util.Collections; @@ -25,7 +25,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; /** * Class to hold the results of the filtering/grouping/sorting operations diff --git a/Core/src/org/sleuthkit/autopsy/filequery/SearchWorker.java b/Core/src/org/sleuthkit/autopsy/discovery/SearchWorker.java similarity index 97% rename from Core/src/org/sleuthkit/autopsy/filequery/SearchWorker.java rename to Core/src/org/sleuthkit/autopsy/discovery/SearchWorker.java index 74196e7b01..feda6671ea 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/SearchWorker.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SearchWorker.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.LinkedHashMap; import javax.swing.SwingWorker; @@ -25,7 +25,7 @@ import java.util.Map; import java.util.logging.Level; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.filequery.FileSearch.GroupKey; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; /** diff --git a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.form similarity index 88% rename from Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailPanel.form rename to Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.form index 222d87dc20..522acb16c8 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.form @@ -78,13 +78,13 @@ - + - + - + @@ -94,13 +94,13 @@ - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.java similarity index 94% rename from Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailPanel.java rename to Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.java index a72400a64c..2fff08f87b 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.awt.Color; import java.awt.Component; @@ -112,14 +112,14 @@ final class VideoThumbnailPanel extends javax.swing.JPanel implements ListCellRe imagePanel.setLayout(new java.awt.GridBagLayout()); scoreLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/red-circle-exclamation.png"))); // NOI18N - scoreLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - scoreLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - scoreLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + scoreLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); deletedLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/file-icon-deleted.png"))); // NOI18N - deletedLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - deletedLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); - deletedLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.filequery.DiscoveryUiUtils.getIconSize())); + deletedLabel.setMaximumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + deletedLabel.setMinimumSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); + deletedLabel.setPreferredSize(new Dimension(org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize(),org.sleuthkit.autopsy.discovery.DiscoveryUiUtils.getIconSize())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); diff --git a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailViewer.form b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.form similarity index 95% rename from Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailViewer.form rename to Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.form index 931f7f1bd1..aa8875a52d 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailViewer.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.form @@ -35,11 +35,11 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailViewer.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java similarity index 94% rename from Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailViewer.java rename to Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java index a1dc742eab..84487ad277 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailViewer.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.util.ArrayList; import java.util.List; @@ -104,7 +104,7 @@ public class VideoThumbnailViewer extends javax.swing.JPanel { thumbnailList.setModel(thumbnailListModel); thumbnailList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); - thumbnailList.setCellRenderer(new VideoThumbnailPanel()); + thumbnailList.setCellRenderer(new org.sleuthkit.autopsy.discovery.VideoThumbnailPanel()); thumbnailListScrollPane.setViewportView(thumbnailList); add(thumbnailListScrollPane, java.awt.BorderLayout.CENTER); @@ -112,7 +112,7 @@ public class VideoThumbnailViewer extends javax.swing.JPanel { // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JList thumbnailList; + private javax.swing.JList thumbnailList; private javax.swing.JScrollPane thumbnailListScrollPane; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailsWrapper.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailsWrapper.java similarity index 98% rename from Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailsWrapper.java rename to Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailsWrapper.java index 08c68611c0..52c188ac80 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/VideoThumbnailsWrapper.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailsWrapper.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.filequery; +package org.sleuthkit.autopsy.discovery; import java.awt.Image; import java.util.ArrayList; From cd17998a8ca593c5748fca847bec07f828597a1b Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 6 May 2020 04:55:21 -0400 Subject: [PATCH 02/51] 6305 add MERGED file back after refactor --- .../sleuthkit/autopsy/discovery/Bundle.properties-MERGED | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index ec44af6ee0..2aced0f0a0 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -1,11 +1,11 @@ -CTL_OpenFileDiscoveryAction=File Discovery +CTL_OpenDiscoveryAction=Discovery # {0} - dataSourceName DataSourceModuleWrapper.exifModule.text=Exif Parser module was not run on data source: {0}\n # {0} - dataSourceName DataSourceModuleWrapper.fileTypeModule.text=File Type Identification module was not run on data source: {0}\n # {0} - dataSourceName DataSourceModuleWrapper.hashModule.text=Hash Lookup module was not run on data source: {0}\n -DiscoveryTopComponent.name=\ File Discovery +DiscoveryTopComponent.name=\ Discovery DiscoveryUiUtility.bytes.text=bytes DiscoveryUiUtility.gigaBytes.text=GB DiscoveryUiUtility.kiloBytes.text=KB @@ -184,7 +184,7 @@ GroupsListPanel.noResults.title.text=No results found ImageThumbnailPanel.isDeleted.text=All instances of file are deleted. # {0} - otherInstanceCount ImageThumbnailPanel.nameLabel.more.text=\ and {0} more -OpenFileDiscoveryAction.resultsIncomplete.text=Results may be incomplete +OpenDiscoveryAction.resultsIncomplete.text=Results may be incomplete ResultFile.score.interestingResult.description=At least one instance of the file has an interesting result associated with it. ResultFile.score.notableFile.description=At least one instance of the file was recognized as notable. ResultFile.score.notableTaggedFile.description=At least one instance of the file is tagged with a notable tag. From f930fa972f296ff58a61a19f7fbe012b31b97d56 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Mon, 11 May 2020 09:48:01 -0400 Subject: [PATCH 03/51] 6305 first batch of UI changes for Discovery --- .../autopsy/discovery/Bundle.properties | 11 +- .../autopsy/discovery/DiscoveryDialog.form | 214 +++++++++++ .../autopsy/discovery/DiscoveryDialog.java | 335 ++++++++++++++++++ .../discovery/DiscoveryTopComponent.form | 183 ---------- .../discovery/DiscoveryTopComponent.java | 246 +------------ .../autopsy/discovery/FileSearchPanel.form | 47 +-- .../autopsy/discovery/FileSearchPanel.java | 82 +---- .../discovery/OpenDiscoveryAction.java | 28 +- 8 files changed, 578 insertions(+), 568 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index 284e78aead..db3f094fc7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -16,7 +16,6 @@ FileSearchDialog.orderSizeRadioButton.text=Group Size FileSearchDialog.jLabel5.text=Order files by: FileSearchDialog.parentCheckBox.text=Parent FileSearchPanel.sortingPanel.border.title=Grouping -FileSearchPanel.searchButton.text=Show FileSearchPanel.addButton.text=Add FileSearchPanel.substringRadioButton.text=Substring FileSearchPanel.fullRadioButton.text=Full @@ -39,7 +38,6 @@ FileSearchDialog.objCheckBox.text=Objects FileSearchDialog.exifCheckBox.text=Must contain EXIF data FileSearchDialog.notableCheckBox.text=Must have been tagged as notable FileSearchDialog.scoreCheckBox.text=Has score -FileSearchPanel.cancelButton.text=Cancel FileSearchPanel.hashSetCheckbox.text=Hash Set: FileSearchPanel.tagsCheckbox.text=Tag: FileSearchPanel.interestingItemsCheckbox.text=Interesting Item: @@ -57,13 +55,14 @@ FileSearchPanel.excludeRadioButton.text=Exclude FileSearchPanel.knownFilesCheckbox.toolTipText= FileSearchPanel.knownFilesCheckbox.text=Hide known files GroupListPanel.groupKeyList.border.title=Groups -DiscoveryTopComponent.imagesButton.text=Images -DiscoveryTopComponent.videosButton.text=Videos ResultsPanel.resultsSplitPane.toolTipText= FileSearchPanel.stepThreeLabel.text=Step 3: Choose display settings -DiscoveryTopComponent.stepOneLabel.text=Step 1: Pick File Type -DiscoveryTopComponent.documentsButton.text=Documents DocumentPanel.fileSizeLabel.toolTipText= DocumentPanel.isDeletedLabel.toolTipText= ImageThumbnailPanel.isDeletedLabel.toolTipText= FileSearchPanel.userCreatedCheckbox.text=Possibly User Created +DiscoveryDialog.documentsButton.text=Documents +DiscoveryDialog.videosButton.text=Videos +DiscoveryDialog.imagesButton.text=Images +DiscoveryDialog.searchButton.text=Show +DiscoveryDialog.cancelButton.text=Cancel diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form new file mode 100644 index 0000000000..0f36d5ae95 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -0,0 +1,214 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java new file mode 100644 index 0000000000..9a1c45ccaa --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -0,0 +1,335 @@ +/* + * Autopsy + * + * Copyright 2020 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.discovery; + +import static java.awt.BorderLayout.CENTER; +import java.awt.Color; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.List; +import java.util.logging.Level; +import org.apache.commons.lang.StringUtils; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; +import org.sleuthkit.autopsy.coreutils.Logger; + +final class DiscoveryDialog extends javax.swing.JDialog { + + private static final long serialVersionUID = 1L; + private final static Logger logger = Logger.getLogger(DiscoveryDialog.class.getName()); + private final FileSearchPanel filterPanel = new FileSearchPanel(); + private static final Color SELECTED_COLOR = new Color(216, 230, 242); + private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); + private SearchWorker searchWorker = null; + + DiscoveryDialog() { + this(null, true); + } + + /** + * Creates new form DiscoveryDialog + */ + private DiscoveryDialog(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + filterPanel.addPropertyChangeListener(new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getNewValue() instanceof String) { + String errorMessage = (String) evt.getNewValue(); + if (StringUtils.isBlank(errorMessage)) { + setValid(); + } else { + setInvalid(errorMessage); + } + } + + } + }); + updateSearchSettings(); + add(filterPanel, CENTER); + } + + /** + * Update the search settings to a default state. + */ + private void updateSearchSettings() { + filterPanel.resetPanel(); + imagesButton.setSelected(true); + imagesButton.setEnabled(false); + imagesButton.setBackground(SELECTED_COLOR); + imagesButton.setForeground(Color.BLACK); + videosButton.setSelected(false); + videosButton.setEnabled(true); + videosButton.setBackground(UNSELECTED_COLOR); + documentsButton.setSelected(false); + documentsButton.setEnabled(true); + documentsButton.setBackground(UNSELECTED_COLOR); + filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.JPanel toolBarPanel = new javax.swing.JPanel(); + imagesButton = new javax.swing.JButton(); + videosButton = new javax.swing.JButton(); + documentsButton = new javax.swing.JButton(); + jPanel1 = new javax.swing.JPanel(); + searchButton = new javax.swing.JButton(); + errorLabel = new javax.swing.JLabel(); + cancelButton = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + imagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/pictures-icon.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(imagesButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.imagesButton.text")); // NOI18N + imagesButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/pictures-icon.png"))); // NOI18N + imagesButton.setFocusable(false); + imagesButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + imagesButton.setMaximumSize(new java.awt.Dimension(90, 43)); + imagesButton.setMinimumSize(new java.awt.Dimension(90, 43)); + imagesButton.setPreferredSize(new java.awt.Dimension(90, 43)); + imagesButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + imagesButtonActionPerformed(evt); + } + }); + + videosButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/video-icon.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(videosButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.videosButton.text")); // NOI18N + videosButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/video-icon.png"))); // NOI18N + videosButton.setDisabledSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/video-icon.png"))); // NOI18N + videosButton.setFocusable(false); + videosButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + videosButton.setMaximumSize(new java.awt.Dimension(90, 43)); + videosButton.setMinimumSize(new java.awt.Dimension(90, 43)); + videosButton.setPreferredSize(new java.awt.Dimension(90, 43)); + videosButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + videosButtonActionPerformed(evt); + } + }); + + documentsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/documents-icon.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(documentsButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.documentsButton.text")); // NOI18N + documentsButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/documents-icon.png"))); // NOI18N + documentsButton.setDisabledSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/documents-icon.png"))); // NOI18N + documentsButton.setFocusable(false); + documentsButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + documentsButtonActionPerformed(evt); + } + }); + + javax.swing.GroupLayout toolBarPanelLayout = new javax.swing.GroupLayout(toolBarPanel); + toolBarPanel.setLayout(toolBarPanelLayout); + toolBarPanelLayout.setHorizontalGroup( + toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(toolBarPanelLayout.createSequentialGroup() + .addContainerGap(99, Short.MAX_VALUE) + .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(documentsButton) + .addContainerGap(88, Short.MAX_VALUE)) + ); + toolBarPanelLayout.setVerticalGroup( + toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(toolBarPanelLayout.createSequentialGroup() + .addContainerGap() + .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(documentsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + + getContentPane().add(toolBarPanel, java.awt.BorderLayout.PAGE_START); + + org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.searchButton.text")); // NOI18N + searchButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + searchButtonActionPerformed(evt); + } + }); + + errorLabel.setForeground(new java.awt.Color(255, 0, 0)); + + org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.cancelButton.text")); // NOI18N + cancelButton.setEnabled(false); + cancelButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cancelButtonActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cancelButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(searchButton) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(cancelButton) + .addComponent(searchButton))) + .addContainerGap()) + ); + + getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_END); + + pack(); + }// //GEN-END:initComponents + + private void imagesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imagesButtonActionPerformed +// resetTopComponent(); + imagesButton.setSelected(true); + imagesButton.setEnabled(false); + imagesButton.setBackground(SELECTED_COLOR); + imagesButton.setForeground(Color.BLACK); + videosButton.setSelected(false); + videosButton.setEnabled(true); + videosButton.setBackground(UNSELECTED_COLOR); + documentsButton.setSelected(false); + documentsButton.setEnabled(true); + documentsButton.setBackground(UNSELECTED_COLOR); + filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); + }//GEN-LAST:event_imagesButtonActionPerformed + + private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed + imagesButton.setSelected(false); + imagesButton.setEnabled(true); + imagesButton.setBackground(UNSELECTED_COLOR); + videosButton.setSelected(true); + videosButton.setEnabled(false); + videosButton.setBackground(SELECTED_COLOR); + videosButton.setForeground(Color.BLACK); + documentsButton.setSelected(false); + documentsButton.setEnabled(true); + documentsButton.setBackground(UNSELECTED_COLOR); + filterPanel.setSelectedType(FileSearchData.FileType.VIDEO); + }//GEN-LAST:event_videosButtonActionPerformed + + private void documentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_documentsButtonActionPerformed + documentsButton.setSelected(true); + documentsButton.setEnabled(false); + documentsButton.setBackground(SELECTED_COLOR); + documentsButton.setForeground(Color.BLACK); + videosButton.setSelected(false); + videosButton.setEnabled(true); + videosButton.setBackground(UNSELECTED_COLOR); + imagesButton.setSelected(false); + imagesButton.setEnabled(true); + imagesButton.setBackground(UNSELECTED_COLOR); + filterPanel.setSelectedType(FileSearchData.FileType.DOCUMENTS); + }//GEN-LAST:event_documentsButtonActionPerformed + + private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed + // Get the selected filters + final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); + if (tc == null) { + setInvalid("No Top Component Found"); + return; + } + + if (tc.isOpened() == false) { + tc.open(); +// tc.updateSearchSettings(); +// displayErrorMessage(tc); + } + tc.resetTopComponent(); + List filters = filterPanel.getFilters(); +// enableSearch(false); + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(filterPanel.getSelectedType())); + + // Get the grouping attribute and group sorting method + FileSearch.AttributeType groupingAttr = filterPanel.getGroupingAttribute(); + FileGroup.GroupSortingAlgorithm groupSortAlgorithm = filterPanel.getGroupSortingMethod(); + + // Get the file sorting method + FileSorter.SortingMethod fileSort = filterPanel.getFileSortingMethod(); + CentralRepository centralRepoDb = null; + if (CentralRepository.isEnabled()) { + try { + centralRepoDb = CentralRepository.getInstance(); + } catch (CentralRepoException ex) { + centralRepoDb = null; + logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex); + } + } + searchWorker = new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort); + searchWorker.execute(); + dispose(); + tc.toFront(); + tc.requestActive(); + }//GEN-LAST:event_searchButtonActionPerformed + + private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed +// cancelSearch(); + }//GEN-LAST:event_cancelButtonActionPerformed + + /** + * The settings are valid so enable the Search button + */ + private void setValid() { + errorLabel.setText(""); + searchButton.setEnabled(true); + } + + /** + * The settings are not valid so disable the search button and display the + * given error message. + * + * @param error + */ + private void setInvalid(String error) { + errorLabel.setText(error); + searchButton.setEnabled(false); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton cancelButton; + private javax.swing.JButton documentsButton; + private javax.swing.JLabel errorLabel; + private javax.swing.JButton imagesButton; + private javax.swing.JPanel jPanel1; + private javax.swing.JButton searchButton; + private javax.swing.JButton videosButton; + // End of variables declaration//GEN-END:variables +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index a7c22dd434..df7946a5c2 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -28,10 +28,6 @@
- - - - @@ -40,22 +36,6 @@ - - - - - - - - - - - - - - - - @@ -75,168 +55,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index 9c2da771ca..f17849c678 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -18,8 +18,6 @@ */ package org.sleuthkit.autopsy.discovery; -import com.google.common.eventbus.Subscribe; -import java.awt.Color; import java.util.List; import java.util.stream.Collectors; import javax.swing.SwingUtilities; @@ -47,8 +45,6 @@ public final class DiscoveryTopComponent extends TopComponent { private static final long serialVersionUID = 1L; private static final String PREFERRED_ID = "DiscoveryTopComponent"; // NON-NLS - private static final Color SELECTED_COLOR = new Color(216, 230, 242); - private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); private final FileSearchPanel fileSearchPanel; private final GroupListPanel groupListPanel; private final DataContentPanel dataContentPanel; @@ -65,8 +61,7 @@ public final class DiscoveryTopComponent extends TopComponent { dataContentPanel = DataContentPanel.createInstance(); resultsPanel = new ResultsPanel(); groupListPanel = new GroupListPanel(); - leftSplitPane.setLeftComponent(fileSearchPanel); - leftSplitPane.setRightComponent(groupListPanel); + mainSplitPane.setLeftComponent(groupListPanel); rightSplitPane.setTopComponent(resultsPanel); rightSplitPane.setBottomComponent(dataContentPanel); //add list selection listener so the content viewer will be updated with the selected file @@ -106,25 +101,6 @@ public final class DiscoveryTopComponent extends TopComponent { groupListPanel.resetGroupList(); } - /** - * Update the search settings to a default state. - */ - void updateSearchSettings() { - resetTopComponent(); - fileSearchPanel.resetPanel(); - imagesButton.setSelected(true); - imagesButton.setEnabled(false); - imagesButton.setBackground(SELECTED_COLOR); - imagesButton.setForeground(Color.BLACK); - videosButton.setSelected(false); - videosButton.setEnabled(true); - videosButton.setBackground(UNSELECTED_COLOR); - documentsButton.setSelected(false); - documentsButton.setEnabled(true); - documentsButton.setBackground(UNSELECTED_COLOR); - fileSearchPanel.setSelectedType(FileSearchData.FileType.IMAGE); - } - @Override public void componentOpened() { super.componentOpened(); @@ -154,15 +130,8 @@ public final class DiscoveryTopComponent extends TopComponent { // //GEN-BEGIN:initComponents private void initComponents() { - javax.swing.JSplitPane mainSplitPane = new javax.swing.JSplitPane(); - leftSplitPane = new javax.swing.JSplitPane(); + mainSplitPane = new javax.swing.JSplitPane(); rightSplitPane = new javax.swing.JSplitPane(); - javax.swing.JPanel toolBarPanel = new javax.swing.JPanel(); - imagesButton = new javax.swing.JButton(); - javax.swing.JLabel stepOneLabel = new javax.swing.JLabel(); - videosButton = new javax.swing.JButton(); - javax.swing.Box.Filler filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(119, 0), new java.awt.Dimension(119, 0), new java.awt.Dimension(119, 32767)); - documentsButton = new javax.swing.JButton(); setPreferredSize(new java.awt.Dimension(1400, 900)); setLayout(new java.awt.BorderLayout()); @@ -170,11 +139,6 @@ public final class DiscoveryTopComponent extends TopComponent { mainSplitPane.setDividerLocation(450); mainSplitPane.setPreferredSize(new java.awt.Dimension(1400, 828)); - leftSplitPane.setDividerLocation(325); - leftSplitPane.setToolTipText(""); - leftSplitPane.setPreferredSize(new java.awt.Dimension(400, 828)); - mainSplitPane.setLeftComponent(leftSplitPane); - rightSplitPane.setDividerLocation(475); rightSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); rightSplitPane.setResizeWeight(0.5); @@ -182,196 +146,8 @@ public final class DiscoveryTopComponent extends TopComponent { mainSplitPane.setRightComponent(rightSplitPane); add(mainSplitPane, java.awt.BorderLayout.CENTER); - - imagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/pictures-icon.png"))); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(imagesButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.imagesButton.text")); // NOI18N - imagesButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/pictures-icon.png"))); // NOI18N - imagesButton.setFocusable(false); - imagesButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); - imagesButton.setMaximumSize(new java.awt.Dimension(90, 43)); - imagesButton.setMinimumSize(new java.awt.Dimension(90, 43)); - imagesButton.setPreferredSize(new java.awt.Dimension(90, 43)); - imagesButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - imagesButtonActionPerformed(evt); - } - }); - - org.openide.awt.Mnemonics.setLocalizedText(stepOneLabel, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.stepOneLabel.text")); // NOI18N - - videosButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/video-icon.png"))); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(videosButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.videosButton.text")); // NOI18N - videosButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/video-icon.png"))); // NOI18N - videosButton.setDisabledSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/video-icon.png"))); // NOI18N - videosButton.setFocusable(false); - videosButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); - videosButton.setMaximumSize(new java.awt.Dimension(90, 43)); - videosButton.setMinimumSize(new java.awt.Dimension(90, 43)); - videosButton.setPreferredSize(new java.awt.Dimension(90, 43)); - videosButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - videosButtonActionPerformed(evt); - } - }); - - documentsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/documents-icon.png"))); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(documentsButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.documentsButton.text")); // NOI18N - documentsButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/documents-icon.png"))); // NOI18N - documentsButton.setDisabledSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/documents-icon.png"))); // NOI18N - documentsButton.setFocusable(false); - documentsButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - documentsButtonActionPerformed(evt); - } - }); - - javax.swing.GroupLayout toolBarPanelLayout = new javax.swing.GroupLayout(toolBarPanel); - toolBarPanel.setLayout(toolBarPanelLayout); - toolBarPanelLayout.setHorizontalGroup( - toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap(414, Short.MAX_VALUE) - .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(toolBarPanelLayout.createSequentialGroup() - .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(documentsButton)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, toolBarPanelLayout.createSequentialGroup() - .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(stepOneLabel) - .addGap(119, 119, 119))) - .addContainerGap(413, Short.MAX_VALUE)) - ); - - toolBarPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {documentsButton, imagesButton, videosButton}); - - toolBarPanelLayout.setVerticalGroup( - toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(toolBarPanelLayout.createSequentialGroup() - .addGap(4, 4, 4) - .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(stepOneLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(filler1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(documentsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(5, 5, 5)) - ); - - toolBarPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {documentsButton, imagesButton, videosButton}); - - add(toolBarPanel, java.awt.BorderLayout.PAGE_START); }// //GEN-END:initComponents - private void imagesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imagesButtonActionPerformed - resetTopComponent(); - imagesButton.setSelected(true); - imagesButton.setEnabled(false); - imagesButton.setBackground(SELECTED_COLOR); - imagesButton.setForeground(Color.BLACK); - videosButton.setSelected(false); - videosButton.setEnabled(true); - videosButton.setBackground(UNSELECTED_COLOR); - documentsButton.setSelected(false); - documentsButton.setEnabled(true); - documentsButton.setBackground(UNSELECTED_COLOR); - fileSearchPanel.setSelectedType(FileSearchData.FileType.IMAGE); - }//GEN-LAST:event_imagesButtonActionPerformed - - private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed - resetTopComponent(); - imagesButton.setSelected(false); - imagesButton.setEnabled(true); - imagesButton.setBackground(UNSELECTED_COLOR); - videosButton.setSelected(true); - videosButton.setEnabled(false); - videosButton.setBackground(SELECTED_COLOR); - videosButton.setForeground(Color.BLACK); - documentsButton.setSelected(false); - documentsButton.setEnabled(true); - documentsButton.setBackground(UNSELECTED_COLOR); - fileSearchPanel.setSelectedType(FileSearchData.FileType.VIDEO); - }//GEN-LAST:event_videosButtonActionPerformed - - private void documentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_documentsButtonActionPerformed - resetTopComponent(); - documentsButton.setSelected(true); - documentsButton.setEnabled(false); - documentsButton.setBackground(SELECTED_COLOR); - documentsButton.setForeground(Color.BLACK); - videosButton.setSelected(false); - videosButton.setEnabled(true); - videosButton.setBackground(UNSELECTED_COLOR); - imagesButton.setSelected(false); - imagesButton.setEnabled(true); - imagesButton.setBackground(UNSELECTED_COLOR); - fileSearchPanel.setSelectedType(FileSearchData.FileType.DOCUMENTS); - }//GEN-LAST:event_documentsButtonActionPerformed - - /** - * Update the user interface in response to a search being cancelled. - * - * @param searchCancelledEvent The SearchCancelledEvent received. - */ - @Subscribe - void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) { - SwingUtilities.invokeLater(() -> { - if (null != fileSearchPanel.getSelectedType()) { - switch (fileSearchPanel.getSelectedType()) { - case VIDEO: - imagesButton.setEnabled(true); - documentsButton.setEnabled(true); - break; - case IMAGE: - videosButton.setEnabled(true); - documentsButton.setEnabled(true); - break; - case DOCUMENTS: - videosButton.setEnabled(true); - imagesButton.setEnabled(true); - break; - default: - break; - } - } - - }); - } - - /** - * Update the user interface in response to a search being completed. - * - * @param searchCompletedEvent The SearchCompletedEvent received. - */ - @Subscribe - void handleSearchCompletedEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompletedEvent) { - SwingUtilities.invokeLater(() -> { - if (null != fileSearchPanel.getSelectedType()) { - switch (fileSearchPanel.getSelectedType()) { - case VIDEO: - imagesButton.setEnabled(true); - documentsButton.setEnabled(true); - break; - case IMAGE: - videosButton.setEnabled(true); - documentsButton.setEnabled(true); - break; - case DOCUMENTS: - videosButton.setEnabled(true); - imagesButton.setEnabled(true); - break; - default: - break; - } - } - }); - } - @Override public List availableModes(List modes) { /* @@ -383,26 +159,10 @@ public final class DiscoveryTopComponent extends TopComponent { .collect(Collectors.toList()); } - /** - * Update the user interface in response to a search being started. - * - * @param searchStartedEvent The SearchStartedEvent received. - */ - @Subscribe - void handleSearchStartedEvent(DiscoveryEventUtils.SearchStartedEvent searchStartedEvent) { - SwingUtilities.invokeLater(() -> { - imagesButton.setEnabled(false); - videosButton.setEnabled(false); - documentsButton.setEnabled(false); - }); - } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton documentsButton; - private javax.swing.JButton imagesButton; - private javax.swing.JSplitPane leftSplitPane; + private javax.swing.JSplitPane mainSplitPane; private javax.swing.JSplitPane rightSplitPane; - private javax.swing.JButton videosButton; // End of variables declaration//GEN-END:variables } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form index 27e383ed3b..8460710c89 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form @@ -47,13 +47,6 @@ - - - - - - - @@ -70,20 +63,12 @@ - + - - - - - - - - - + @@ -813,16 +798,6 @@ - - - - - - - - - - @@ -949,24 +924,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java index 641fb9b5a8..a532afe816 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java @@ -583,9 +583,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener * Reset the panel to its initial configuration. */ void resetPanel() { - - searchButton.setEnabled(false); - // Set up the filters setUpDataSourceFilter(); setUpFrequencyFilter(); @@ -1099,8 +1096,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener * The settings are valid so enable the Search button */ private void setValid() { - errorLabel.setText(""); - searchButton.setEnabled(true); + firePropertyChange("FilterError", null, null); } /** @@ -1110,8 +1106,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener * @param error */ private void setInvalid(String error) { - errorLabel.setText(error); - searchButton.setEnabled(false); + firePropertyChange("FilterError", error, error); } /** @@ -1173,7 +1168,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener includeRadioButton = new javax.swing.JRadioButton(); javax.swing.JPanel parentTextPanel = new javax.swing.JPanel(); parentTextField = new javax.swing.JTextField(); - searchButton = new javax.swing.JButton(); javax.swing.JPanel sortingPanel = new javax.swing.JPanel(); groupByCombobox = new javax.swing.JComboBox<>(); orderByCombobox = new javax.swing.JComboBox<>(); @@ -1181,8 +1175,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener javax.swing.JLabel orderByLabel = new javax.swing.JLabel(); javax.swing.JLabel groupByLabel = new javax.swing.JLabel(); groupSortingComboBox = new javax.swing.JComboBox<>(); - errorLabel = new javax.swing.JLabel(); - cancelButton = new javax.swing.JButton(); stepTwoLabel = new javax.swing.JLabel(); javax.swing.JLabel stepThreeLabel = new javax.swing.JLabel(); @@ -1664,13 +1656,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener filtersScrollPane.setViewportView(filtersPanel); - org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.searchButton.text")); // NOI18N - searchButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - searchButtonActionPerformed(evt); - } - }); - sortingPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.sortingPanel.border.title"))); // NOI18N sortingPanel.setPreferredSize(new java.awt.Dimension(345, 112)); @@ -1717,16 +1702,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener .addContainerGap()) ); - errorLabel.setForeground(new java.awt.Color(255, 0, 0)); - - org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.cancelButton.text")); // NOI18N - cancelButton.setEnabled(false); - cancelButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - cancelButtonActionPerformed(evt); - } - }); - org.openide.awt.Mnemonics.setLocalizedText(stepThreeLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.stepThreeLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -1741,66 +1716,26 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cancelButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(searchButton)) .addComponent(stepThreeLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(filtersScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)) .addGap(6, 6, 6)))) ); - - layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelButton, searchButton}); - layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(6, 6, 6) .addComponent(stepTwoLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE) + .addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(stepThreeLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(cancelButton) - .addComponent(searchButton))) - .addGap(6, 6, 6)) + .addGap(64, 64, 64)) ); }// //GEN-END:initComponents - private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed - // Get the selected filters - List filters = getFilters(); - enableSearch(false); - DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(fileType)); - - // Get the grouping attribute and group sorting method - FileSearch.AttributeType groupingAttr = getGroupingAttribute(); - FileGroup.GroupSortingAlgorithm groupSortAlgorithm = getGroupSortingMethod(); - - // Get the file sorting method - FileSorter.SortingMethod fileSort = getFileSortingMethod(); - CentralRepository centralRepoDb = null; - if (CentralRepository.isEnabled()) { - try { - centralRepoDb = CentralRepository.getInstance(); - } catch (CentralRepoException ex) { - centralRepoDb = null; - logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex); - } - } - searchWorker = new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort); - searchWorker.execute(); - }//GEN-LAST:event_searchButtonActionPerformed - /** * Set the enabled status of the search controls. * @@ -1829,8 +1764,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener break; } } - searchButton.setEnabled(enabled); - cancelButton.setEnabled(!enabled); orderByCombobox.setEnabled(enabled); groupByCombobox.setEnabled(enabled); groupSortingComboBox.setEnabled(enabled); @@ -1915,10 +1848,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener dataSourceList.setEnabled(dataSourceCheckbox.isSelected()); }//GEN-LAST:event_dataSourceCheckboxActionPerformed - private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed - cancelSearch(); - }//GEN-LAST:event_cancelButtonActionPerformed - private void hashSetCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hashSetCheckboxActionPerformed hashSetList.setEnabled(hashSetCheckbox.isSelected()); }//GEN-LAST:event_hashSetCheckboxActionPerformed @@ -1942,7 +1871,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton addButton; - private javax.swing.JButton cancelButton; private javax.swing.JCheckBox crFrequencyCheckbox; private javax.swing.JList crFrequencyList; private javax.swing.JScrollPane crFrequencyScrollPane; @@ -1950,7 +1878,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener private javax.swing.JList dataSourceList; private javax.swing.JScrollPane dataSourceScrollPane; private javax.swing.JButton deleteButton; - private javax.swing.JLabel errorLabel; private javax.swing.JRadioButton excludeRadioButton; private javax.swing.JRadioButton fullRadioButton; private javax.swing.JComboBox groupByCombobox; @@ -1978,7 +1905,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener private javax.swing.JCheckBox scoreCheckbox; private javax.swing.JList scoreList; private javax.swing.JScrollPane scoreScrollPane; - private javax.swing.JButton searchButton; private javax.swing.JCheckBox sizeCheckbox; private javax.swing.JList sizeList; private javax.swing.JScrollPane sizeScrollPane; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java index 091e698a4b..0a69539786 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java @@ -42,8 +42,8 @@ import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; /** - * Class to open the Discovery top component. Allows the user to run - * searches and see results. + * Class to open the Discovery top component. Allows the user to run searches + * and see results. */ @ActionID(category = "Tools", id = "org.sleuthkit.autopsy.newpackage.OpenDiscoveryAction") @ActionReferences(value = { @@ -75,17 +75,19 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P @Override @SuppressWarnings("fallthrough") public void performAction() { - final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); - if (tc != null) { - if (tc.isOpened() == false) { - tc.open(); - tc.updateSearchSettings(); - displayErrorMessage(tc); - } - tc.toFront(); - tc.requestActive(); - - } + final DiscoveryDialog discDialog = new DiscoveryDialog(); + discDialog.setVisible(true); +// final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); +// if (tc != null) { +// if (tc.isOpened() == false) { +// tc.open(); +// tc.updateSearchSettings(); +// displayErrorMessage(tc); +// } +// tc.toFront(); +// tc.requestActive(); +// +// } } /** From c3156be65bd730b8eae664da176acbf91245d297 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 12 May 2020 01:09:47 -0400 Subject: [PATCH 04/51] 6305 animation tools --- .../discovery/Bundle.properties-MERGED | 11 +- .../autopsy/discovery/DetailsPanel.form | 43 ++++ .../autopsy/discovery/DetailsPanel.java | 60 ++++++ .../autopsy/discovery/ResultsPanel.form | 12 +- .../autopsy/discovery/ResultsPanel.java | 179 +++++++++++++++- .../autopsy/discovery/SwingAnimator.java | 193 ++++++++++++++++++ .../discovery/SwingAnimatorCallback.java | 35 ++++ 7 files changed, 509 insertions(+), 24 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 2aced0f0a0..f69686a0ea 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -139,7 +139,6 @@ FileSearchFiltering.TagsFilter.or=\ or FileSearchFiltering.UserCreatedFilter.desc=Files that contain EXIF data FileSearchPanel.dialogTitle.text=Test file search FileSearchPanel.sortingPanel.border.title=Grouping -FileSearchPanel.searchButton.text=Show FileSearchPanel.addButton.text=Add FileSearchPanel.steptwo.documents=Step 2: Filter which documents to show FileSearchPanel.steptwo.images=Step 2: Filter which images to show @@ -165,7 +164,6 @@ FileSearchDialog.objCheckBox.text=Objects FileSearchDialog.exifCheckBox.text=Must contain EXIF data FileSearchDialog.notableCheckBox.text=Must have been tagged as notable FileSearchDialog.scoreCheckBox.text=Has score -FileSearchPanel.cancelButton.text=Cancel FileSearchPanel.hashSetCheckbox.text=Hash Set: FileSearchPanel.tagsCheckbox.text=Tag: FileSearchPanel.interestingItemsCheckbox.text=Interesting Item: @@ -209,16 +207,17 @@ FileSearchPanel.excludeRadioButton.text=Exclude FileSearchPanel.knownFilesCheckbox.toolTipText= FileSearchPanel.knownFilesCheckbox.text=Hide known files GroupListPanel.groupKeyList.border.title=Groups -DiscoveryTopComponent.imagesButton.text=Images -DiscoveryTopComponent.videosButton.text=Videos ResultsPanel.resultsSplitPane.toolTipText= FileSearchPanel.stepThreeLabel.text=Step 3: Choose display settings -DiscoveryTopComponent.stepOneLabel.text=Step 1: Pick File Type -DiscoveryTopComponent.documentsButton.text=Documents DocumentPanel.fileSizeLabel.toolTipText= DocumentPanel.isDeletedLabel.toolTipText= ImageThumbnailPanel.isDeletedLabel.toolTipText= FileSearchPanel.userCreatedCheckbox.text=Possibly User Created +DiscoveryDialog.documentsButton.text=Documents +DiscoveryDialog.videosButton.text=Videos +DiscoveryDialog.imagesButton.text=Images +DiscoveryDialog.searchButton.text=Show +DiscoveryDialog.cancelButton.text=Cancel ResultsPanel.unableToCreate.text=Unable to create summary. ResultsPanel.viewFileInDir.name=View File in Directory VideoThumbnailPanel.bytes.text=bytes diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.form new file mode 100644 index 0000000000..058ed2dd31 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.form @@ -0,0 +1,43 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java new file mode 100644 index 0000000000..c49cbe0edc --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java @@ -0,0 +1,60 @@ +/* + * 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.discovery; + +import org.sleuthkit.autopsy.corecomponents.DataContentPanel; + +/** + * + * @author wschaefer + */ +public class DetailsPanel extends javax.swing.JPanel { + + private final DataContentPanel dataContentPanel; + + /** + * Creates new form DetailsPanel + */ + public DetailsPanel() { + initComponents(); + dataContentPanel = DataContentPanel.createInstance(); + detailsSplitPane.setBottomComponent(dataContentPanel); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + detailsSplitPane = new javax.swing.JSplitPane(); + + detailsSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 667, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(detailsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 667, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 402, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(detailsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JSplitPane detailsSplitPane; + // End of variables declaration//GEN-END:variables +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form index bc265187e9..407e17c946 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form @@ -30,7 +30,7 @@ - + @@ -312,22 +312,16 @@ - - - - - - @@ -358,11 +352,11 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 9a22418fb7..7bd732d18a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -56,10 +56,11 @@ import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.textsummarizer.TextSummary; +import java.awt.Graphics; /** - * Panel for displaying of Discovery results and handling the paging of - * those results. + * Panel for displaying of Discovery results and handling the paging of those + * results. */ public class ResultsPanel extends javax.swing.JPanel { @@ -82,6 +83,14 @@ public class ResultsPanel extends javax.swing.JPanel { private final DefaultListModel instancesListModel = new DefaultListModel<>(); private ListSelectionListener listener = null; + private int dividerLocation = 1; + + private static final int ANIMATION_INCREMENT = 10; + + private SwingAnimator fadeInAnimator = null; + + private SwingAnimator fadeOutAnimator = null; + /** * Creates new form ResultsPanel. */ @@ -164,6 +173,7 @@ public class ResultsPanel extends javax.swing.JPanel { if (files.isEmpty()) { //if there are no files currently remove the current items without removing listener to cause content viewer to reset instancesListModel.removeAllElements(); + fadeOut(); } else { //remove listener so content viewer node is not set multiple times instancesList.removeListSelectionListener(listener); @@ -176,10 +186,12 @@ public class ResultsPanel extends javax.swing.JPanel { if (!instancesListModel.isEmpty()) { instancesList.setSelectedIndex(0); } + fadeIn(); } }); } + /** * Get the AbstractFile for the item currently selected in the instances * list. @@ -425,7 +437,7 @@ public class ResultsPanel extends javax.swing.JPanel { javax.swing.Box.Filler filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); javax.swing.Box.Filler filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); javax.swing.Box.Filler filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); - javax.swing.JSplitPane resultsSplitPane = new javax.swing.JSplitPane(); + resultsSplitPane = new javax.swing.JSplitPane(); javax.swing.JPanel instancesPanel = new javax.swing.JPanel(); javax.swing.JScrollPane instancesScrollPane = new javax.swing.JScrollPane(); instancesList = new javax.swing.JList<>(); @@ -580,11 +592,9 @@ public class ResultsPanel extends javax.swing.JPanel { gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; pagingPanel.add(filler4, gridBagConstraints); - resultsSplitPane.setDividerLocation(380); resultsSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); resultsSplitPane.setResizeWeight(1.0); resultsSplitPane.setToolTipText(org.openide.util.NbBundle.getMessage(ResultsPanel.class, "ResultsPanel.resultsSplitPane.toolTipText")); // NOI18N - resultsSplitPane.setLastDividerLocation(180); resultsSplitPane.setOpaque(false); resultsSplitPane.setPreferredSize(new java.awt.Dimension(777, 440)); @@ -609,11 +619,11 @@ public class ResultsPanel extends javax.swing.JPanel { ); instancesPanelLayout.setVerticalGroup( instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 68, Short.MAX_VALUE) + .addGap(0, 433, Short.MAX_VALUE) .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, instancesPanelLayout.createSequentialGroup() .addGap(0, 0, 0) - .addComponent(instancesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addComponent(instancesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE))) ); resultsSplitPane.setRightComponent(instancesPanel); @@ -627,14 +637,14 @@ public class ResultsPanel extends javax.swing.JPanel { layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pagingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addComponent(resultsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(resultsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(pagingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) - .addComponent(resultsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 436, Short.MAX_VALUE) + .addComponent(resultsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE) .addGap(0, 0, 0)) ); }// //GEN-END:initComponents @@ -723,6 +733,7 @@ public class ResultsPanel extends javax.swing.JPanel { private javax.swing.JButton nextPageButton; private javax.swing.JComboBox pageSizeComboBox; private javax.swing.JButton previousPageButton; + private javax.swing.JSplitPane resultsSplitPane; private javax.swing.JPanel resultsViewerPanel; // End of variables declaration//GEN-END:variables @@ -878,4 +889,154 @@ public class ResultsPanel extends javax.swing.JPanel { } } + + /** + * + * Sets the alpha value + * + * @param a + * + */ + public void setDividerLocation(int a) { + + this.dividerLocation = a; + + } + + /** + * + * Fades this JPanel in. * + */ + public void fadeIn() { + + stop(); + + fadeInAnimator = new SwingAnimator(new FadeInCallback()); + + fadeInAnimator.start(); + + } + + /** + * + * Fades this JPanel out + * + */ + public void fadeOut() { + + stop(); + + fadeOutAnimator = new SwingAnimator(new FadeOutCallback()); + + fadeOutAnimator.start(); + + } + + /** + * + * Stops all animators. * + */ + private void stop() { + + if (fadeOutAnimator != null && fadeOutAnimator.isRunning()) { + + fadeOutAnimator.stop(); + + } + + if (fadeInAnimator != null && fadeInAnimator.isRunning()) { + + fadeInAnimator.stop(); + + } + + } + + @Override + public void paintComponent(Graphics g) { + + if (dividerLocation <= resultsSplitPane.getHeight() && dividerLocation >= (resultsSplitPane.getHeight() - 100)) { + resultsSplitPane.setDividerLocation(dividerLocation); + } + + super.paintComponent(g); + + } + + /** + * + * Callback implementation for fading in + * + * @author Greg Cope + * + * + * + */ + private class FadeInCallback implements SwingAnimatorCallback { + + @Override + + public void callback(Object caller) { + + dividerLocation -= ANIMATION_INCREMENT; + + repaint(); + + } + + @Override + + public boolean hasTerminated() { + + if (dividerLocation <= (resultsSplitPane.getHeight() - 100)) { + + dividerLocation = resultsSplitPane.getHeight() - 100; + System.out.println("FADE IN COMPLETE"); + return true; + + } + + return false; + + } + + } + + /** + * + * Callback implementation to fade out + * + * @author Greg Cope + * + * + * + */ + private class FadeOutCallback implements SwingAnimatorCallback { + + @Override + + public void callback(Object caller) { + + dividerLocation += ANIMATION_INCREMENT; + + repaint(); + + } + + @Override + + public boolean hasTerminated() { + + if (dividerLocation >= resultsSplitPane.getHeight()) { + + dividerLocation = resultsSplitPane.getHeight(); + System.out.println("FADE OUT COMPLETE"); + return true; + } + + return false; + } + + } + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java new file mode 100644 index 0000000000..d744f5c3d8 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java @@ -0,0 +1,193 @@ +/* + * 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.discovery; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.Timer; + +/** + * + * Class to animate Layouts and Fades for a given component. + * + * + * @author Greg Cope + * + * + * + */ +public final class SwingAnimator { + + //callback object + private final SwingAnimatorCallback callback; + + //Timer to animate on the EDT + private Timer timer = null; + + //duration in milliseconds betweeen each firing of the Timer + private static final int INITIAL_DURATION = 10; + private static int duration = INITIAL_DURATION; + + /** + * + * Constructs a new SwingAnimator. + * + * + * @param callback The object to callback to + * + */ + public SwingAnimator(SwingAnimatorCallback callback) { + + this(callback, false); + + } + + /** + * + * + * + * @param callback The object to callback to + * + * @param start true to automatically start the animation, false + * otherwise + * + */ + public SwingAnimator(SwingAnimatorCallback callback, boolean start) { + + this(callback, INITIAL_DURATION, start); + + } + + /** + * + * + * + * @param callback The object to callback to + * + * @param frameTiming Timing between each call to callback. + * + * @param start true to automatically start the animation, false + * otherwise + * + */ + public SwingAnimator(SwingAnimatorCallback callback, int frameTiming, boolean start) { + + this.callback = callback; + + duration = frameTiming; + + if (start) { + + start(); + + } + + } + + /** + * + * + * + * @param callback The object to callback to + * + * @param frameTiming Timing between each call to callback. + * + */ + public SwingAnimator(SwingAnimatorCallback callback, int frameTiming) { + + this(callback, frameTiming, false); + + } + + /** + * + * Checks if this animator is running. + * + * @return + * + */ + public boolean isRunning() { + + if (timer == null) { + + return false; + + } + + return timer.isRunning(); + + } + + /** + * + * Stops the timer + * + */ + public void stop() { + + if (timer != null) { + + timer.stop(); + + } + + } + + /** + * + * Starts the timer to fire. If the current timer is non-null and running, + * this method will first + * + * stop the timer before beginning a new one. * + */ + public void start() { + + if (timer != null && timer.isRunning()) { + + stop(); + + } + + timer = new Timer(duration, new CallbackListener()); + + timer.start(); + + } + + /** + * + * ActionListener implements to be passed to the internal timer instance + * + * @author Greg Cope + * + * + * + */ + private class CallbackListener implements ActionListener { + + @Override + + public void actionPerformed(ActionEvent e) { + + if (callback.hasTerminated()) { + + if (timer == null) { + + throw new IllegalStateException("Callback listener should not be fired outside of SwingAnimator timer control"); + + } + + timer.stop(); + + } + + callback.callback(SwingAnimator.this); + + } + + } + +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java new file mode 100644 index 0000000000..31a8fdba0d --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java @@ -0,0 +1,35 @@ +/* + * 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.discovery; + +/** + * + * Callback interface to be notified by a SwingAnimator of a new time frame. * + * @author Greg Cope + * + * + * + */ +public interface SwingAnimatorCallback { + + /** + * + * Callback method for the SwingAnimator + * + * @param caller + * + */ + public void callback(Object caller); + + /** + * + * Returns true if the SwingAnimator should terminate. * + * @return + * + */ + public boolean hasTerminated(); + +} From eaab28e734d7916a7786c8beaf025d487175c68e Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 12 May 2020 06:03:37 -0400 Subject: [PATCH 05/51] 6305 fixed animating of details area --- .../autopsy/core/discoveryWsmode.xml | 2 +- .../autopsy/discovery/Bundle.properties | 3 +- .../discovery/Bundle.properties-MERGED | 3 +- .../autopsy/discovery/DetailsPanel.form | 96 ++++- .../autopsy/discovery/DetailsPanel.java | 207 +++++++++- .../autopsy/discovery/DiscoveryDialog.form | 5 +- .../autopsy/discovery/DiscoveryDialog.java | 24 +- .../discovery/DiscoveryEventUtils.java | 51 ++- .../discovery/DiscoveryTopComponent.form | 19 +- .../discovery/DiscoveryTopComponent.java | 158 ++++++-- .../discovery/OpenDiscoveryAction.java | 21 +- .../autopsy/discovery/ResultsPanel.form | 147 ++----- .../autopsy/discovery/ResultsPanel.java | 373 ++---------------- 13 files changed, 553 insertions(+), 556 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/core/discoveryWsmode.xml b/Core/src/org/sleuthkit/autopsy/core/discoveryWsmode.xml index ef5da81277..cde1d1b91d 100644 --- a/Core/src/org/sleuthkit/autopsy/core/discoveryWsmode.xml +++ b/Core/src/org/sleuthkit/autopsy/core/discoveryWsmode.xml @@ -3,7 +3,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index db3f094fc7..6adf34c316 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -48,14 +48,12 @@ ResultsPanel.currentPageLabel.text=Page: - ResultsPanel.pageControlsLabel.text=Pages: ResultsPanel.gotoPageLabel.text=Go to Page: ResultsPanel.pageSizeLabel.text=Page Size: -ResultsPanel.instancesList.border.title=Instances DiscoveryExtractAction.title.extractFiles.text=Extract File FileSearchPanel.includeRadioButton.text=Include FileSearchPanel.excludeRadioButton.text=Exclude FileSearchPanel.knownFilesCheckbox.toolTipText= FileSearchPanel.knownFilesCheckbox.text=Hide known files GroupListPanel.groupKeyList.border.title=Groups -ResultsPanel.resultsSplitPane.toolTipText= FileSearchPanel.stepThreeLabel.text=Step 3: Choose display settings DocumentPanel.fileSizeLabel.toolTipText= DocumentPanel.isDeletedLabel.toolTipText= @@ -66,3 +64,4 @@ DiscoveryDialog.videosButton.text=Videos DiscoveryDialog.imagesButton.text=Images DiscoveryDialog.searchButton.text=Show DiscoveryDialog.cancelButton.text=Cancel +DetailsPanel.instancesList.border.title=Instances diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index f69686a0ea..b7dd8cf30a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -200,14 +200,12 @@ ResultsPanel.openInExternalViewer.name=Open in External Viewer ResultsPanel.pageControlsLabel.text=Pages: ResultsPanel.gotoPageLabel.text=Go to Page: ResultsPanel.pageSizeLabel.text=Page Size: -ResultsPanel.instancesList.border.title=Instances DiscoveryExtractAction.title.extractFiles.text=Extract File FileSearchPanel.includeRadioButton.text=Include FileSearchPanel.excludeRadioButton.text=Exclude FileSearchPanel.knownFilesCheckbox.toolTipText= FileSearchPanel.knownFilesCheckbox.text=Hide known files GroupListPanel.groupKeyList.border.title=Groups -ResultsPanel.resultsSplitPane.toolTipText= FileSearchPanel.stepThreeLabel.text=Step 3: Choose display settings DocumentPanel.fileSizeLabel.toolTipText= DocumentPanel.isDeletedLabel.toolTipText= @@ -218,6 +216,7 @@ DiscoveryDialog.videosButton.text=Videos DiscoveryDialog.imagesButton.text=Images DiscoveryDialog.searchButton.text=Show DiscoveryDialog.cancelButton.text=Cancel +DetailsPanel.instancesList.border.title=Instances ResultsPanel.unableToCreate.text=Unable to create summary. ResultsPanel.viewFileInDir.name=View File in Directory VideoThumbnailPanel.bytes.text=bytes diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.form index 058ed2dd31..32f78a9645 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.form @@ -16,9 +16,9 @@ - + - + @@ -26,7 +26,7 @@ - + @@ -34,10 +34,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java index c49cbe0edc..46be9cca8c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java @@ -1,11 +1,48 @@ /* - * 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 + * + * Copyright 2020 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.discovery; +import com.google.common.eventbus.Subscribe; +import java.awt.Component; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.swing.DefaultListCellRenderer; +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import org.sleuthkit.autopsy.actions.AddContentTagAction; +import org.sleuthkit.autopsy.actions.DeleteFileContentTagAction; import org.sleuthkit.autopsy.corecomponents.DataContentPanel; +import org.sleuthkit.autopsy.corecomponents.TableFilterNode; +import org.sleuthkit.autopsy.datamodel.FileNode; +import org.sleuthkit.autopsy.directorytree.ExternalViewerAction; +import org.sleuthkit.autopsy.directorytree.ViewContextAction; +import org.sleuthkit.autopsy.modules.hashdatabase.AddContentToHashDbAction; +import org.sleuthkit.autopsy.timeline.actions.ViewFileInTimelineAction; +import org.sleuthkit.datamodel.AbstractFile; +import org.sleuthkit.datamodel.TskCoreException; /** * @@ -13,7 +50,11 @@ import org.sleuthkit.autopsy.corecomponents.DataContentPanel; */ public class DetailsPanel extends javax.swing.JPanel { + private static final long serialVersionUID = 1L; + private final DataContentPanel dataContentPanel; + private final DefaultListModel instancesListModel = new DefaultListModel<>(); + private ListSelectionListener listener = null; /** * Creates new form DetailsPanel @@ -21,7 +62,95 @@ public class DetailsPanel extends javax.swing.JPanel { public DetailsPanel() { initComponents(); dataContentPanel = DataContentPanel.createInstance(); - detailsSplitPane.setBottomComponent(dataContentPanel); + + detailsSplitPane.setBottomComponent(dataContentPanel); + //Add the context menu when right clicking + instancesList.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + if (SwingUtilities.isRightMouseButton(e)) { + SwingUtilities.invokeLater(() -> { + instancesList.setSelectedIndex(instancesList.locationToIndex(e.getPoint())); + Set files = new HashSet<>(); + files.add(instancesList.getSelectedValue()); + JPopupMenu menu = new JPopupMenu(); + menu.add(new ViewContextAction(Bundle.ResultsPanel_viewFileInDir_name(), instancesList.getSelectedValue())); + menu.add(new ExternalViewerAction(Bundle.ResultsPanel_openInExternalViewer_name(), new FileNode(instancesList.getSelectedValue()))); + menu.add(ViewFileInTimelineAction.createViewFileAction(instancesList.getSelectedValue())); + menu.add(new DiscoveryExtractAction(files)); + menu.add(AddContentTagAction.getInstance().getMenuForContent(files)); + menu.add(DeleteFileContentTagAction.getInstance().getMenuForFiles(files)); + menu.add(AddContentToHashDbAction.getInstance().getMenuForFiles(files)); + menu.show(instancesList, e.getPoint().x, e.getPoint().y); + }); + } + } + }); + listener = new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent e) { + if (!e.getValueIsAdjusting()) { + SwingUtilities.invokeLater(() -> { + AbstractFile file = getSelectedFile(); + if (file != null) { + dataContentPanel.setNode(new TableFilterNode(new FileNode(file), false)); + } else { + dataContentPanel.setNode(null); + } + }); + } + } + }; + instancesList.addListSelectionListener(listener); + } + + @Subscribe + void handleClearSelectionListener(DiscoveryEventUtils.ClearInstanceSelectionEvent clearEvent) { + instancesList.clearSelection(); + } + + /** + * Populate the instances list. + */ + @Subscribe + synchronized void handlePopulateInstancesListEvent(DiscoveryEventUtils.PopulateInstancesListEvent populateEvent) { + SwingUtilities.invokeLater(() -> { + List files = populateEvent.getInstances(); + if (files.isEmpty()) { + //if there are no files currently remove the current items without removing listener to cause content viewer to reset + instancesListModel.removeAllElements(); + //send fade out event + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.DetailsVisibleEvent(false)); + } else { + //remove listener so content viewer node is not set multiple times + instancesList.removeListSelectionListener(listener); + instancesListModel.removeAllElements(); + for (AbstractFile file : files) { + instancesListModel.addElement(file); + } + //add listener back to allow selection of first index to cause content viewer node to be set + instancesList.addListSelectionListener(listener); + if (!instancesListModel.isEmpty()) { + instancesList.setSelectedIndex(0); + } + //send fade in event + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.DetailsVisibleEvent(true)); + } + }); + } + + /** + * Get the AbstractFile for the item currently selected in the instances + * list. + * + * @return The AbstractFile which is currently selected. + */ + synchronized AbstractFile getSelectedFile() { + if (instancesList.getSelectedIndex() == -1) { + return null; + } else { + return instancesListModel.getElementAt(instancesList.getSelectedIndex()); + } } /** @@ -34,27 +163,91 @@ public class DetailsPanel extends javax.swing.JPanel { private void initComponents() { detailsSplitPane = new javax.swing.JSplitPane(); + javax.swing.JPanel instancesPanel = new javax.swing.JPanel(); + javax.swing.JScrollPane instancesScrollPane = new javax.swing.JScrollPane(); + instancesList = new javax.swing.JList<>(); + detailsSplitPane.setDividerLocation(80); detailsSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); + detailsSplitPane.setMinimumSize(new java.awt.Dimension(200, 0)); + detailsSplitPane.setPreferredSize(new java.awt.Dimension(700, 500)); + + instancesPanel.setMinimumSize(new java.awt.Dimension(0, 60)); + instancesPanel.setPreferredSize(new java.awt.Dimension(700, 80)); + + instancesScrollPane.setPreferredSize(new java.awt.Dimension(775, 60)); + + instancesList.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DetailsPanel.class, "DetailsPanel.instancesList.border.title"))); // NOI18N + instancesList.setModel(instancesListModel); + instancesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + instancesList.setCellRenderer(new InstancesCellRenderer()); + instancesList.setVisibleRowCount(2); + instancesScrollPane.setViewportView(instancesList); + + javax.swing.GroupLayout instancesPanelLayout = new javax.swing.GroupLayout(instancesPanel); + instancesPanel.setLayout(instancesPanelLayout); + instancesPanelLayout.setHorizontalGroup( + instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 775, Short.MAX_VALUE) + .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(instancesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + instancesPanelLayout.setVerticalGroup( + instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 79, Short.MAX_VALUE) + .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, instancesPanelLayout.createSequentialGroup() + .addGap(0, 0, 0) + .addComponent(instancesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE))) + ); + + detailsSplitPane.setTopComponent(instancesPanel); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 667, Short.MAX_VALUE) + .addGap(0, 777, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(detailsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 667, Short.MAX_VALUE)) + .addComponent(detailsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 402, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(detailsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)) + .addComponent(detailsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// //GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JSplitPane detailsSplitPane; + private javax.swing.JList instancesList; // End of variables declaration//GEN-END:variables + + /** + * Cell renderer for the instances list. + */ + private class InstancesCellRenderer extends DefaultListCellRenderer { + + private static final long serialVersionUID = 1L; + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + String name = ""; + if (value instanceof AbstractFile) { + AbstractFile file = (AbstractFile) value; + try { + name = file.getUniquePath(); + } catch (TskCoreException ingored) { + name = file.getParentPath() + "/" + file.getName(); + } + + } + setText(name); + return this; + } + + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 0f36d5ae95..4f74b9ff75 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -202,11 +202,14 @@ - + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 9a1c45ccaa..70ca36cb2c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -37,11 +37,19 @@ final class DiscoveryDialog extends javax.swing.JDialog { private static final Color SELECTED_COLOR = new Color(216, 230, 242); private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); private SearchWorker searchWorker = null; + private static DiscoveryDialog discoveryDialog; - DiscoveryDialog() { + private DiscoveryDialog() { this(null, true); } + public static synchronized DiscoveryDialog getDiscoveryDialogInstance() { + if (discoveryDialog == null) { + discoveryDialog = new DiscoveryDialog(); + } + return discoveryDialog; + } + /** * Creates new form DiscoveryDialog */ @@ -100,7 +108,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { jPanel1 = new javax.swing.JPanel(); searchButton = new javax.swing.JButton(); errorLabel = new javax.swing.JLabel(); - cancelButton = new javax.swing.JButton(); + javax.swing.JButton cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); @@ -180,7 +188,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { errorLabel.setForeground(new java.awt.Color(255, 0, 0)); org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.cancelButton.text")); // NOI18N - cancelButton.setEnabled(false); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); @@ -270,12 +277,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { if (tc.isOpened() == false) { tc.open(); -// tc.updateSearchSettings(); -// displayErrorMessage(tc); } tc.resetTopComponent(); List filters = filterPanel.getFilters(); -// enableSearch(false); DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(filterPanel.getSelectedType())); // Get the grouping attribute and group sorting method @@ -300,10 +304,15 @@ final class DiscoveryDialog extends javax.swing.JDialog { tc.requestActive(); }//GEN-LAST:event_searchButtonActionPerformed + private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed -// cancelSearch(); + this.setVisible(false); }//GEN-LAST:event_cancelButtonActionPerformed + void cancelSearch() { + filterPanel.cancelSearch(); + } + /** * The settings are valid so enable the Search button */ @@ -324,7 +333,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton cancelButton; private javax.swing.JButton documentsButton; private javax.swing.JLabel errorLabel; private javax.swing.JButton imagesButton; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java index bc0c8e32df..4151a09c4b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java @@ -1,7 +1,7 @@ /* * Autopsy * - * Copyright 2019 Basis Technology Corp. + * Copyright 2019-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,6 +24,7 @@ import java.util.List; import java.util.Map; import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; +import org.sleuthkit.datamodel.AbstractFile; /** * Class to handle event bus and events for file discovery tool. @@ -70,6 +71,36 @@ final class DiscoveryEventUtils { } } + static final class ClearInstanceSelectionEvent { + + /** + * Construct a new ClearInstanceSelectionEvent. + */ + ClearInstanceSelectionEvent() { + //no arg constructor + } + } + + static final class PopulateInstancesListEvent { + + private final List instances; + + /** + * Construct a new PopulateInstancesListEvent. + */ + PopulateInstancesListEvent(List files) { + instances = files; + //no arg constructor + } + + /** + * @return the instances + */ + List getInstances() { + return Collections.unmodifiableList(instances); + } + } + /** * Event to signal the completion of a search being performed. */ @@ -332,4 +363,22 @@ final class DiscoveryEventUtils { } } + + static class DetailsVisibleEvent { + + private final boolean showDetailsArea; + + DetailsVisibleEvent(boolean isVisible) { + showDetailsArea = isVisible; + //no arg constructor + } + + /** + * @return the showDetailsArea + */ + boolean isShowDetailsArea() { + return showDetailsArea; + } + } + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index df7946a5c2..b5cffa4a96 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -2,8 +2,11 @@
+ + + - + @@ -16,16 +19,16 @@ - + - + - + @@ -38,13 +41,15 @@ - - + - + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index f17849c678..5179a2effd 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -1,7 +1,7 @@ /* * Autopsy * - * Copyright 2019 Basis Technology Corp. + * Copyright 2019-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,21 +18,17 @@ */ package org.sleuthkit.autopsy.discovery; +import com.google.common.eventbus.Subscribe; +import java.awt.Graphics; import java.util.List; import java.util.stream.Collectors; -import javax.swing.SwingUtilities; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; +import javax.swing.JSplitPane; import org.openide.util.NbBundle; import org.openide.windows.Mode; import org.openide.windows.RetainLocation; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; -import org.sleuthkit.autopsy.corecomponents.DataContentPanel; -import org.sleuthkit.autopsy.corecomponents.TableFilterNode; import org.sleuthkit.autopsy.coreutils.ThreadConfined; -import org.sleuthkit.autopsy.datamodel.FileNode; -import org.sleuthkit.datamodel.AbstractFile; /** * Create a dialog for displaying the file discovery tool @@ -45,10 +41,15 @@ public final class DiscoveryTopComponent extends TopComponent { private static final long serialVersionUID = 1L; private static final String PREFERRED_ID = "DiscoveryTopComponent"; // NON-NLS - private final FileSearchPanel fileSearchPanel; private final GroupListPanel groupListPanel; - private final DataContentPanel dataContentPanel; + private final DetailsPanel detailsPanel; private final ResultsPanel resultsPanel; + private int dividerLocation; + + private static final int ANIMATION_INCREMENT = 10; + private static final int RESULTS_AREA_SMALL_SIZE = 200; + + private SwingAnimator animator = null; /** * Creates new form FileDiscoveryDialog @@ -57,31 +58,14 @@ public final class DiscoveryTopComponent extends TopComponent { public DiscoveryTopComponent() { initComponents(); setName(Bundle.DiscoveryTopComponent_name()); - fileSearchPanel = new FileSearchPanel(); - dataContentPanel = DataContentPanel.createInstance(); - resultsPanel = new ResultsPanel(); groupListPanel = new GroupListPanel(); + resultsPanel = new ResultsPanel(); + detailsPanel = new DetailsPanel(); mainSplitPane.setLeftComponent(groupListPanel); rightSplitPane.setTopComponent(resultsPanel); - rightSplitPane.setBottomComponent(dataContentPanel); - //add list selection listener so the content viewer will be updated with the selected file - //when a file is selected in the results panel - resultsPanel.addListSelectionListener(new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent e) { - if (!e.getValueIsAdjusting()) { - SwingUtilities.invokeLater(() -> { - AbstractFile file = resultsPanel.getSelectedFile(); - if (file != null) { - dataContentPanel.setNode(new TableFilterNode(new FileNode(file), false)); - } else { - dataContentPanel.setNode(null); - } - }); - } - } - }); - + rightSplitPane.setBottomComponent(detailsPanel); + rightSplitPane.setDividerLocation(1.0); + dividerLocation = rightSplitPane.getDividerLocation(); } /** @@ -108,19 +92,24 @@ public final class DiscoveryTopComponent extends TopComponent { DiscoveryEventUtils.getDiscoveryEventBus().register(this); DiscoveryEventUtils.getDiscoveryEventBus().register(resultsPanel); DiscoveryEventUtils.getDiscoveryEventBus().register(groupListPanel); - DiscoveryEventUtils.getDiscoveryEventBus().register(fileSearchPanel); + DiscoveryEventUtils.getDiscoveryEventBus().register(detailsPanel); } @Override protected void componentClosed() { - fileSearchPanel.cancelSearch(); + cancelCurrentSearch(); DiscoveryEventUtils.getDiscoveryEventBus().unregister(this); - DiscoveryEventUtils.getDiscoveryEventBus().unregister(fileSearchPanel); DiscoveryEventUtils.getDiscoveryEventBus().unregister(groupListPanel); DiscoveryEventUtils.getDiscoveryEventBus().unregister(resultsPanel); + DiscoveryEventUtils.getDiscoveryEventBus().unregister(detailsPanel); super.componentClosed(); } + private void cancelCurrentSearch() { + final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance(); + discDialog.cancelSearch(); + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -131,18 +120,18 @@ public final class DiscoveryTopComponent extends TopComponent { private void initComponents() { mainSplitPane = new javax.swing.JSplitPane(); - rightSplitPane = new javax.swing.JSplitPane(); + rightSplitPane = new AnimatedSplitPane(); - setPreferredSize(new java.awt.Dimension(1400, 900)); + setMinimumSize(new java.awt.Dimension(199, 200)); + setPreferredSize(new java.awt.Dimension(1100, 700)); setLayout(new java.awt.BorderLayout()); - mainSplitPane.setDividerLocation(450); - mainSplitPane.setPreferredSize(new java.awt.Dimension(1400, 828)); + mainSplitPane.setDividerLocation(250); + mainSplitPane.setPreferredSize(new java.awt.Dimension(1100, 700)); - rightSplitPane.setDividerLocation(475); rightSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); - rightSplitPane.setResizeWeight(0.5); - rightSplitPane.setPreferredSize(new java.awt.Dimension(1000, 828)); + rightSplitPane.setResizeWeight(1.0); + rightSplitPane.setPreferredSize(new java.awt.Dimension(800, 700)); mainSplitPane.setRightComponent(rightSplitPane); add(mainSplitPane, java.awt.BorderLayout.CENTER); @@ -159,10 +148,95 @@ public final class DiscoveryTopComponent extends TopComponent { .collect(Collectors.toList()); } + /** + * + * Fades this JPanel in. * + */ + @Subscribe + void handleDetailsVisibleEvent(DiscoveryEventUtils.DetailsVisibleEvent detailsVisibleEvent) { + if (animator != null && animator.isRunning()) { + animator.stop(); + } + if (detailsVisibleEvent.isShowDetailsArea()) { + animator = new SwingAnimator(new ShowDetailsAreaCallback()); + } else { + animator = new SwingAnimator(new HideDetailsAreaCallback()); + } + animator.start(); + } + /** + * + * Callback implementation for fading in + * + * @author Greg Cope + * + * + * + */ + private class ShowDetailsAreaCallback implements SwingAnimatorCallback { + + @Override + public void callback(Object caller) { + dividerLocation -= ANIMATION_INCREMENT; + repaint(); + } + + @Override + public boolean hasTerminated() { + if (dividerLocation <= RESULTS_AREA_SMALL_SIZE) { + dividerLocation = RESULTS_AREA_SMALL_SIZE; + return true; + } + return false; + } + + } + + /** + * + * Callback implementation to fade out + * + * @author Greg Cope + * + * + * + */ + private class HideDetailsAreaCallback implements SwingAnimatorCallback { + + @Override + public void callback(Object caller) { + dividerLocation += ANIMATION_INCREMENT; + repaint(); + } + + @Override + public boolean hasTerminated() { + if (dividerLocation >= rightSplitPane.getHeight()) { + dividerLocation = rightSplitPane.getHeight(); + return true; + } + return false; + } + + } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JSplitPane mainSplitPane; private javax.swing.JSplitPane rightSplitPane; // End of variables declaration//GEN-END:variables + private class AnimatedSplitPane extends JSplitPane { + + private static final long serialVersionUID = 1L; + + @Override + public void paintComponent(Graphics g) { + if (dividerLocation <= rightSplitPane.getHeight() && dividerLocation >= RESULTS_AREA_SMALL_SIZE) { + rightSplitPane.setDividerLocation(dividerLocation); + } + super.paintComponent(g); + } + + } + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java index 0a69539786..f72d25e22e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java @@ -1,7 +1,7 @@ /* * Autopsy * - * Copyright 2019 Basis Technology Corp. + * Copyright 2019-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -75,19 +75,10 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P @Override @SuppressWarnings("fallthrough") public void performAction() { - final DiscoveryDialog discDialog = new DiscoveryDialog(); + final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance(); + discDialog.cancelSearch(); discDialog.setVisible(true); -// final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); -// if (tc != null) { -// if (tc.isOpened() == false) { -// tc.open(); -// tc.updateSearchSettings(); -// displayErrorMessage(tc); -// } -// tc.toFront(); -// tc.requestActive(); -// -// } + displayErrorMessage(discDialog); } /** @@ -96,7 +87,7 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P * * @param tc The Discovery Top component. */ - private void displayErrorMessage(DiscoveryTopComponent tc) { + private void displayErrorMessage(DiscoveryDialog discDialog) { //check if modules run and assemble message try { SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); @@ -113,7 +104,7 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P message += dsmodulesWrapper.getMessage(); } if (!message.isEmpty()) { - JOptionPane.showMessageDialog(tc, message, Bundle.OpenDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(discDialog, message, Bundle.OpenDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE); } } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.WARNING, "Exception while determining which modules have been run for Discovery", ex); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form index 407e17c946..723888f04f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form @@ -2,8 +2,11 @@ + + + - + @@ -18,24 +21,7 @@ - - - - - - - - - - - - - - - - - - + @@ -44,11 +30,22 @@ + + + + + + + + + + + @@ -310,114 +307,22 @@ - + - - - - + + - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 7bd732d18a..3a82dd8d47 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -19,44 +19,25 @@ package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.Subscribe; -import java.awt.Component; import java.awt.Image; import java.awt.event.ItemEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.logging.Level; import javax.swing.DefaultComboBoxModel; -import javax.swing.DefaultListCellRenderer; -import javax.swing.DefaultListModel; -import javax.swing.JList; import javax.swing.JOptionPane; -import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; -import javax.swing.event.ListSelectionListener; import org.openide.util.NbBundle.Messages; -import org.sleuthkit.autopsy.actions.AddContentTagAction; -import org.sleuthkit.autopsy.actions.DeleteFileContentTagAction; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.datamodel.FileNode; -import org.sleuthkit.autopsy.directorytree.ExternalViewerAction; -import org.sleuthkit.autopsy.directorytree.ViewContextAction; -import org.sleuthkit.autopsy.timeline.actions.ViewFileInTimelineAction; import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; -import org.sleuthkit.autopsy.modules.hashdatabase.AddContentToHashDbAction; import org.sleuthkit.datamodel.AbstractFile; -import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.textsummarizer.TextSummary; -import java.awt.Graphics; /** * Panel for displaying of Discovery results and handling the paging of those @@ -80,16 +61,6 @@ public class ResultsPanel extends javax.swing.JPanel { private int groupSize = 0; private PageWorker pageWorker; private final List> resultContentWorkers = new ArrayList<>(); - private final DefaultListModel instancesListModel = new DefaultListModel<>(); - private ListSelectionListener listener = null; - - private int dividerLocation = 1; - - private static final int ANIMATION_INCREMENT = 10; - - private SwingAnimator fadeInAnimator = null; - - private SwingAnimator fadeOutAnimator = null; /** * Creates new form ResultsPanel. @@ -104,108 +75,42 @@ public class ResultsPanel extends javax.swing.JPanel { videoThumbnailViewer.addListSelectionListener((e) -> { if (resultType == FileSearchData.FileType.VIDEO) { if (!e.getValueIsAdjusting()) { - populateInstancesList(); + //send populateMesage + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.PopulateInstancesListEvent(getInstancesForSelected())); } else { - instancesList.clearSelection(); + //send clearSelection message + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.ClearInstanceSelectionEvent()); } } }); imageThumbnailViewer.addListSelectionListener((e) -> { if (resultType == FileSearchData.FileType.IMAGE) { if (!e.getValueIsAdjusting()) { - populateInstancesList(); + List files = getInstancesForSelected(); + //send populateMesage + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.PopulateInstancesListEvent(getInstancesForSelected())); } else { - instancesList.clearSelection(); + //send clearSelection message + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.ClearInstanceSelectionEvent()); } + } }); documentPreviewViewer.addListSelectionListener((e) -> { if (resultType == FileSearchData.FileType.DOCUMENTS) { if (!e.getValueIsAdjusting()) { - populateInstancesList(); + List files = getInstancesForSelected(); + //send populateMesage + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.PopulateInstancesListEvent(getInstancesForSelected())); } else { - instancesList.clearSelection(); - } - } - }); - //Add the context menu when right clicking - instancesList.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent e) { - if (SwingUtilities.isRightMouseButton(e)) { - SwingUtilities.invokeLater(() -> { - instancesList.setSelectedIndex(instancesList.locationToIndex(e.getPoint())); - Set files = new HashSet<>(); - files.add(instancesList.getSelectedValue()); - JPopupMenu menu = new JPopupMenu(); - menu.add(new ViewContextAction(Bundle.ResultsPanel_viewFileInDir_name(), instancesList.getSelectedValue())); - menu.add(new ExternalViewerAction(Bundle.ResultsPanel_openInExternalViewer_name(), new FileNode(instancesList.getSelectedValue()))); - menu.add(ViewFileInTimelineAction.createViewFileAction(instancesList.getSelectedValue())); - menu.add(new DiscoveryExtractAction(files)); - menu.add(AddContentTagAction.getInstance().getMenuForContent(files)); - menu.add(DeleteFileContentTagAction.getInstance().getMenuForFiles(files)); - menu.add(AddContentToHashDbAction.getInstance().getMenuForFiles(files)); - menu.show(instancesList, e.getPoint().x, e.getPoint().y); - }); + //send clearSelection message + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.ClearInstanceSelectionEvent()); } } }); } - /** - * Add a list selection listener to the instances list. - * - * @param listener The ListSelectionListener to add to the instances list. - */ - void addListSelectionListener(ListSelectionListener newListener) { - instancesList.removeListSelectionListener(listener); - listener = newListener; - instancesList.addListSelectionListener(listener); - } - - /** - * Populate the instances list. - */ - synchronized void populateInstancesList() { - SwingUtilities.invokeLater(() -> { - List files = getInstancesForSelected(); - if (files.isEmpty()) { - //if there are no files currently remove the current items without removing listener to cause content viewer to reset - instancesListModel.removeAllElements(); - fadeOut(); - } else { - //remove listener so content viewer node is not set multiple times - instancesList.removeListSelectionListener(listener); - instancesListModel.removeAllElements(); - for (AbstractFile file : files) { - instancesListModel.addElement(file); - } - //add listener back to allow selection of first index to cause content viewer node to be set - instancesList.addListSelectionListener(listener); - if (!instancesListModel.isEmpty()) { - instancesList.setSelectedIndex(0); - } - fadeIn(); - } - }); - } - - - /** - * Get the AbstractFile for the item currently selected in the instances - * list. - * - * @return The AbstractFile which is currently selected. - */ - synchronized AbstractFile getSelectedFile() { - if (instancesList.getSelectedIndex() == -1) { - return null; - } else { - return instancesListModel.getElementAt(instancesList.getSelectedIndex()); - } - } - /** * Get the list of all instances for the the currently selected item in the * results viewer area. @@ -237,7 +142,9 @@ public class ResultsPanel extends javax.swing.JPanel { @Subscribe void handlePageRetrievedEvent(DiscoveryEventUtils.PageRetrievedEvent pageRetrievedEvent) { SwingUtilities.invokeLater(() -> { - populateInstancesList(); + //send populateMesage + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.PopulateInstancesListEvent(getInstancesForSelected())); + currentPage = pageRetrievedEvent.getPageNumber(); updateControls(); resetResultViewer(); @@ -437,15 +344,15 @@ public class ResultsPanel extends javax.swing.JPanel { javax.swing.Box.Filler filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); javax.swing.Box.Filler filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); javax.swing.Box.Filler filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); - resultsSplitPane = new javax.swing.JSplitPane(); - javax.swing.JPanel instancesPanel = new javax.swing.JPanel(); - javax.swing.JScrollPane instancesScrollPane = new javax.swing.JScrollPane(); - instancesList = new javax.swing.JList<>(); resultsViewerPanel = new javax.swing.JPanel(); - setPreferredSize(new java.awt.Dimension(777, 475)); + setMinimumSize(new java.awt.Dimension(700, 200)); + setPreferredSize(new java.awt.Dimension(700, 700)); + setLayout(new java.awt.BorderLayout()); pagingPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + pagingPanel.setMinimumSize(new java.awt.Dimension(400, 39)); + pagingPanel.setPreferredSize(new java.awt.Dimension(700, 39)); pagingPanel.setLayout(new java.awt.GridBagLayout()); previousPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N @@ -592,61 +499,12 @@ public class ResultsPanel extends javax.swing.JPanel { gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; pagingPanel.add(filler4, gridBagConstraints); - resultsSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); - resultsSplitPane.setResizeWeight(1.0); - resultsSplitPane.setToolTipText(org.openide.util.NbBundle.getMessage(ResultsPanel.class, "ResultsPanel.resultsSplitPane.toolTipText")); // NOI18N - resultsSplitPane.setOpaque(false); - resultsSplitPane.setPreferredSize(new java.awt.Dimension(777, 440)); + add(pagingPanel, java.awt.BorderLayout.PAGE_START); - instancesPanel.setPreferredSize(new java.awt.Dimension(775, 68)); - - instancesScrollPane.setPreferredSize(new java.awt.Dimension(775, 60)); - - instancesList.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ResultsPanel.class, "ResultsPanel.instancesList.border.title"))); // NOI18N - instancesList.setModel(instancesListModel); - instancesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); - instancesList.setCellRenderer(new InstancesCellRenderer()); - instancesList.setVisibleRowCount(2); - instancesScrollPane.setViewportView(instancesList); - - javax.swing.GroupLayout instancesPanelLayout = new javax.swing.GroupLayout(instancesPanel); - instancesPanel.setLayout(instancesPanelLayout); - instancesPanelLayout.setHorizontalGroup( - instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 779, Short.MAX_VALUE) - .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(instancesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - instancesPanelLayout.setVerticalGroup( - instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 433, Short.MAX_VALUE) - .addGroup(instancesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, instancesPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(instancesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE))) - ); - - resultsSplitPane.setRightComponent(instancesPanel); - - resultsViewerPanel.setPreferredSize(new java.awt.Dimension(0, 380)); + resultsViewerPanel.setMinimumSize(new java.awt.Dimension(0, 160)); + resultsViewerPanel.setPreferredSize(new java.awt.Dimension(700, 700)); resultsViewerPanel.setLayout(new java.awt.BorderLayout()); - resultsSplitPane.setLeftComponent(resultsViewerPanel); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(pagingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addComponent(resultsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(pagingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(resultsSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE) - .addGap(0, 0, 0)) - ); + add(resultsViewerPanel, java.awt.BorderLayout.CENTER); }// //GEN-END:initComponents /** @@ -729,11 +587,9 @@ public class ResultsPanel extends javax.swing.JPanel { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel currentPageLabel; private javax.swing.JTextField gotoPageField; - private javax.swing.JList instancesList; private javax.swing.JButton nextPageButton; private javax.swing.JComboBox pageSizeComboBox; private javax.swing.JButton previousPageButton; - private javax.swing.JSplitPane resultsSplitPane; private javax.swing.JPanel resultsViewerPanel; // End of variables declaration//GEN-END:variables @@ -864,179 +720,4 @@ public class ResultsPanel extends javax.swing.JPanel { } - /** - * Cell renderer for the instances list. - */ - private class InstancesCellRenderer extends DefaultListCellRenderer { - - private static final long serialVersionUID = 1L; - - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - String name = ""; - if (value instanceof AbstractFile) { - AbstractFile file = (AbstractFile) value; - try { - name = file.getUniquePath(); - } catch (TskCoreException ingored) { - name = file.getParentPath() + "/" + file.getName(); - } - - } - setText(name); - return this; - } - - } - - /** - * - * Sets the alpha value - * - * @param a - * - */ - public void setDividerLocation(int a) { - - this.dividerLocation = a; - - } - - /** - * - * Fades this JPanel in. * - */ - public void fadeIn() { - - stop(); - - fadeInAnimator = new SwingAnimator(new FadeInCallback()); - - fadeInAnimator.start(); - - } - - /** - * - * Fades this JPanel out - * - */ - public void fadeOut() { - - stop(); - - fadeOutAnimator = new SwingAnimator(new FadeOutCallback()); - - fadeOutAnimator.start(); - - } - - /** - * - * Stops all animators. * - */ - private void stop() { - - if (fadeOutAnimator != null && fadeOutAnimator.isRunning()) { - - fadeOutAnimator.stop(); - - } - - if (fadeInAnimator != null && fadeInAnimator.isRunning()) { - - fadeInAnimator.stop(); - - } - - } - - @Override - public void paintComponent(Graphics g) { - - if (dividerLocation <= resultsSplitPane.getHeight() && dividerLocation >= (resultsSplitPane.getHeight() - 100)) { - resultsSplitPane.setDividerLocation(dividerLocation); - } - - super.paintComponent(g); - - } - - /** - * - * Callback implementation for fading in - * - * @author Greg Cope - * - * - * - */ - private class FadeInCallback implements SwingAnimatorCallback { - - @Override - - public void callback(Object caller) { - - dividerLocation -= ANIMATION_INCREMENT; - - repaint(); - - } - - @Override - - public boolean hasTerminated() { - - if (dividerLocation <= (resultsSplitPane.getHeight() - 100)) { - - dividerLocation = resultsSplitPane.getHeight() - 100; - System.out.println("FADE IN COMPLETE"); - return true; - - } - - return false; - - } - - } - - /** - * - * Callback implementation to fade out - * - * @author Greg Cope - * - * - * - */ - private class FadeOutCallback implements SwingAnimatorCallback { - - @Override - - public void callback(Object caller) { - - dividerLocation += ANIMATION_INCREMENT; - - repaint(); - - } - - @Override - - public boolean hasTerminated() { - - if (dividerLocation >= resultsSplitPane.getHeight()) { - - dividerLocation = resultsSplitPane.getHeight(); - System.out.println("FADE OUT COMPLETE"); - return true; - } - - return false; - } - - } - } From 7957c437ea00dcc554beca4e6c9dcce99333afee Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 12 May 2020 13:33:43 -0400 Subject: [PATCH 06/51] 6305 Fix initial animating to hide --- .../discovery/DiscoveryTopComponent.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index 5179a2effd..aa4b4e991b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -44,10 +44,10 @@ public final class DiscoveryTopComponent extends TopComponent { private final GroupListPanel groupListPanel; private final DetailsPanel detailsPanel; private final ResultsPanel resultsPanel; - private int dividerLocation; + private int dividerLocation = -1; private static final int ANIMATION_INCREMENT = 10; - private static final int RESULTS_AREA_SMALL_SIZE = 200; + private static final int RESULTS_AREA_SMALL_SIZE = 250; private SwingAnimator animator = null; @@ -64,8 +64,6 @@ public final class DiscoveryTopComponent extends TopComponent { mainSplitPane.setLeftComponent(groupListPanel); rightSplitPane.setTopComponent(resultsPanel); rightSplitPane.setBottomComponent(detailsPanel); - rightSplitPane.setDividerLocation(1.0); - dividerLocation = rightSplitPane.getDividerLocation(); } /** @@ -174,7 +172,7 @@ public final class DiscoveryTopComponent extends TopComponent { * * */ - private class ShowDetailsAreaCallback implements SwingAnimatorCallback { + private final class ShowDetailsAreaCallback implements SwingAnimatorCallback { @Override public void callback(Object caller) { @@ -184,7 +182,7 @@ public final class DiscoveryTopComponent extends TopComponent { @Override public boolean hasTerminated() { - if (dividerLocation <= RESULTS_AREA_SMALL_SIZE) { + if (dividerLocation != JSplitPane.UNDEFINED_CONDITION && dividerLocation < RESULTS_AREA_SMALL_SIZE) { dividerLocation = RESULTS_AREA_SMALL_SIZE; return true; } @@ -202,7 +200,7 @@ public final class DiscoveryTopComponent extends TopComponent { * * */ - private class HideDetailsAreaCallback implements SwingAnimatorCallback { + private final class HideDetailsAreaCallback implements SwingAnimatorCallback { @Override public void callback(Object caller) { @@ -212,8 +210,8 @@ public final class DiscoveryTopComponent extends TopComponent { @Override public boolean hasTerminated() { - if (dividerLocation >= rightSplitPane.getHeight()) { - dividerLocation = rightSplitPane.getHeight(); + if (dividerLocation > rightSplitPane.getHeight() || dividerLocation == JSplitPane.UNDEFINED_CONDITION) { + dividerLocation = JSplitPane.UNDEFINED_CONDITION; return true; } return false; @@ -225,13 +223,13 @@ public final class DiscoveryTopComponent extends TopComponent { private javax.swing.JSplitPane rightSplitPane; // End of variables declaration//GEN-END:variables - private class AnimatedSplitPane extends JSplitPane { + private final class AnimatedSplitPane extends JSplitPane { private static final long serialVersionUID = 1L; @Override public void paintComponent(Graphics g) { - if (dividerLocation <= rightSplitPane.getHeight() && dividerLocation >= RESULTS_AREA_SMALL_SIZE) { + if ((dividerLocation == JSplitPane.UNDEFINED_CONDITION) || (dividerLocation <= rightSplitPane.getHeight() && dividerLocation >= RESULTS_AREA_SMALL_SIZE)) { rightSplitPane.setDividerLocation(dividerLocation); } super.paintComponent(g); From 2101d828437f4a1ff91bfd65e4169eeba49e77cd Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 13 May 2020 14:47:20 -0400 Subject: [PATCH 07/51] 6305 fix new bug introduced with bug fix of panel never expanding --- .../org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index aa4b4e991b..1fcf108c9f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -155,6 +155,7 @@ public final class DiscoveryTopComponent extends TopComponent { if (animator != null && animator.isRunning()) { animator.stop(); } + dividerLocation = rightSplitPane.getDividerLocation(); if (detailsVisibleEvent.isShowDetailsArea()) { animator = new SwingAnimator(new ShowDetailsAreaCallback()); } else { @@ -211,7 +212,7 @@ public final class DiscoveryTopComponent extends TopComponent { @Override public boolean hasTerminated() { if (dividerLocation > rightSplitPane.getHeight() || dividerLocation == JSplitPane.UNDEFINED_CONDITION) { - dividerLocation = JSplitPane.UNDEFINED_CONDITION; + dividerLocation = rightSplitPane.getHeight(); return true; } return false; From a6bb47dcd7db54e9542d05b6f6e0604b45a3c2df Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 14 May 2020 15:34:52 -0400 Subject: [PATCH 08/51] 6305 rework size and data source filter panels --- .../discovery/AbstractFilterPanel.java | 82 +++++++++ .../autopsy/discovery/Bundle.properties | 2 + .../discovery/DataSourceFilterPanel.form | 63 +++++++ .../discovery/DataSourceFilterPanel.java | 166 ++++++++++++++++++ .../autopsy/discovery/DiscoveryDialog.form | 8 +- .../autopsy/discovery/DiscoveryDialog.java | 6 +- .../autopsy/discovery/ImageFilterPanel.form | 17 ++ .../autopsy/discovery/ImageFilterPanel.java | 95 ++++++++++ .../autopsy/discovery/ResultsPanel.form | 5 + .../autopsy/discovery/ResultsPanel.java | 2 + .../discovery/SearchFilterInterface.java | 47 +++++ .../autopsy/discovery/SizeFilterPanel.form | 66 +++++++ .../autopsy/discovery/SizeFilterPanel.java | 158 +++++++++++++++++ 13 files changed, 710 insertions(+), 7 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/SearchFilterInterface.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java new file mode 100644 index 0000000000..3662138c47 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java @@ -0,0 +1,82 @@ +/* + * 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.discovery; + +import java.awt.Component; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.event.ActionListener; + +/** + * + * @author wschaefer + */ +abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionListener { + + private static final double LABEL_WEIGHT = 0; + private static final double PANEL_WEIGHT = 0; + private static final int LABEL_WIDTH = 1; + private static final int PANEL_WIDTH = 2; + private static final int NUMBER_OF_COLUMNS = 4; + private static final long serialVersionUID = 1L; + private final GridBagLayout layout = new GridBagLayout(); + private final GridBagConstraints constraints = new GridBagConstraints(); + + void initConstraints() { + constraints.fill = GridBagConstraints.HORIZONTAL; + constraints.gridx = 0; + constraints.gridy = 0; + constraints.gridheight = 2; + constraints.gridwidth = LABEL_WIDTH; + constraints.weightx = LABEL_WEIGHT; + constraints.anchor = GridBagConstraints.LINE_START; + } + + final void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd) { + constraints.gridx = (constraints.gridx + 1) % NUMBER_OF_COLUMNS; + if (constraints.gridx == 0) { + constraints.gridy++; + } + if (constraints.gridx % 2 == 0) { + constraints.weightx = LABEL_WEIGHT; + constraints.gridwidth = LABEL_WIDTH; + } else { + constraints.weightx = PANEL_WEIGHT; + constraints.gridwidth = PANEL_WIDTH; + } + if (additionalComponentToAdd != null) { + constraints.gridheight = 1; + add(componentToAdd, constraints); + constraints.gridy++; + add(additionalComponentToAdd, constraints); + constraints.gridheight = 2; + constraints.gridy--; + } else { + add(componentToAdd, constraints); + } + } + + final void updateLayout() { + setLayout(layout); + } + + /** + * The settings are not valid so disable the search button and display the + * given error message. + * + * @param error + */ + void setInvalid(String error) { + firePropertyChange("FilterError", error, error); + } + + /** + * The settings are valid so enable the Search button + */ + void setValid() { + firePropertyChange("FilterError", null, null); + } +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index 6adf34c316..06e382e230 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -65,3 +65,5 @@ DiscoveryDialog.imagesButton.text=Images DiscoveryDialog.searchButton.text=Show DiscoveryDialog.cancelButton.text=Cancel DetailsPanel.instancesList.border.title=Instances +SizeFilterPanel.sizeCheckbox.text=File Size: +DataSourceFilterPanel.dataSourceCheckbox.text=Data Source: diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form new file mode 100644 index 0000000000..ad6bd7c576 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form @@ -0,0 +1,63 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java new file mode 100644 index 0000000000..40ba80fd33 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -0,0 +1,166 @@ +/* + * 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.discovery; + +import java.awt.event.ActionListener; +import java.util.logging.Level; +import javax.swing.DefaultListModel; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.event.ListSelectionListener; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.DataSource; +import org.sleuthkit.datamodel.TskCoreException; + +/** + * + * @author wschaefer + */ +final class DataSourceFilterPanel extends SearchFilterInterface { + + private static final long serialVersionUID = 1L; + private final static Logger logger = Logger.getLogger(DataSourceFilterPanel.class.getName()); + + /** + * Creates new form DataSourceFilterPanel + */ + DataSourceFilterPanel() { + initComponents(); + setUpDataSourceFilter(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + dataSourceCheckbox = new javax.swing.JCheckBox(); + dataSourceScrollPane = new javax.swing.JScrollPane(); + dataSourceList = new javax.swing.JList<>(); + + org.openide.awt.Mnemonics.setLocalizedText(dataSourceCheckbox, org.openide.util.NbBundle.getMessage(DataSourceFilterPanel.class, "DataSourceFilterPanel.dataSourceCheckbox.text")); // NOI18N + dataSourceCheckbox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + dataSourceCheckboxActionPerformed(evt); + } + }); + + dataSourceList.setModel(new DefaultListModel()); + dataSourceList.setEnabled(false); + dataSourceList.setVisibleRowCount(5); + dataSourceScrollPane.setViewportView(dataSourceList); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(dataSourceScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(dataSourceScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + }// //GEN-END:initComponents + + private void dataSourceCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourceCheckboxActionPerformed + dataSourceList.setEnabled(dataSourceCheckbox.isSelected()); + }//GEN-LAST:event_dataSourceCheckboxActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox dataSourceCheckbox; + private javax.swing.JList dataSourceList; + private javax.swing.JScrollPane dataSourceScrollPane; + // End of variables declaration//GEN-END:variables + + @Override + public void configurePanel(boolean selected, int[] indicesSelected) { + dataSourceCheckbox.setSelected(selected); + if (dataSourceCheckbox.isEnabled() && dataSourceCheckbox.isSelected()) { + dataSourceScrollPane.setEnabled(true); + dataSourceList.setEnabled(true); + if (indicesSelected != null) { + dataSourceList.setSelectedIndices(indicesSelected); + } + } else { + dataSourceScrollPane.setEnabled(false); + dataSourceList.setEnabled(false); + } + } + + @Override + public JCheckBox getCheckbox() { + return dataSourceCheckbox; + } + + @Override + public JLabel getAdditionalLabel() { + return null; + } + + /** + * Initialize the data source filter + */ + private void setUpDataSourceFilter() { + int count = 0; + try { + DefaultListModel dsListModel = (DefaultListModel) dataSourceList.getModel(); + dsListModel.removeAllElements(); + for (DataSource ds : Case.getCurrentCase().getSleuthkitCase().getDataSources()) { + dsListModel.add(count, new DataSourceItem(ds)); + } + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error loading data sources", ex); + dataSourceCheckbox.setEnabled(false); + dataSourceList.setEnabled(false); + } + } + + @Override + void addListeners(ActionListener actionListener, ListSelectionListener listListener) { + if (dataSourceCheckbox != null) { + dataSourceCheckbox.addActionListener(actionListener); + } + if (dataSourceList != null) { + dataSourceList.addListSelectionListener(listListener); + } + } + + /** + * Utility class to allow us to display the data source ID along with the + * name + */ + private class DataSourceItem { + + private final DataSource ds; + + DataSourceItem(DataSource ds) { + this.ds = ds; + } + + DataSource getDataSource() { + return ds; + } + + @Override + public String toString() { + return ds.getName() + " (ID: " + ds.getId() + ")"; + } + } + + @Override + String checkForError() { + if (dataSourceCheckbox.isSelected() && dataSourceList.getSelectedValuesList().isEmpty()) { + return "At least one size must be selected"; + } + return null; + } +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 4f74b9ff75..5d22e3351d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -18,7 +18,7 @@ - + @@ -38,13 +38,13 @@ - + - + @@ -154,7 +154,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 70ca36cb2c..e0eadc7d15 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -157,13 +157,13 @@ final class DiscoveryDialog extends javax.swing.JDialog { toolBarPanelLayout.setHorizontalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap(99, Short.MAX_VALUE) + .addContainerGap(98, Short.MAX_VALUE) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(documentsButton) - .addContainerGap(88, Short.MAX_VALUE)) + .addContainerGap(87, Short.MAX_VALUE)) ); toolBarPanelLayout.setVerticalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -200,7 +200,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cancelButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form new file mode 100644 index 0000000000..7545cb2a78 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form @@ -0,0 +1,17 @@ + + +
+ + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java new file mode 100644 index 0000000000..b315b63f70 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -0,0 +1,95 @@ +/* + * 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.discovery; + +import java.awt.event.ActionEvent; +import java.util.ArrayList; +import java.util.List; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; + +/** + * + * @author wschaefer + */ +final class ImageFilterPanel extends AbstractFilterPanel { + + private static final long serialVersionUID = 1L; + + private final List filters = new ArrayList<>(); + + /** + * Creates new form ImageFilterPanel + */ + ImageFilterPanel() { + initComponents(); + initConstraints(); + addSizeFilter(); + addDataSourceFilter(); + } + + private void addDataSourceFilter() { + DataSourceFilterPanel dataSourceFilter = new DataSourceFilterPanel(); + dataSourceFilter.configurePanel(true, null); + dataSourceFilter.addListeners(this, new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent evt) { + if (!evt.getValueIsAdjusting()) { + validateFields(); + } + } + }); + filters.add(dataSourceFilter); + } + + private void addSizeFilter() { + SizeFilterPanel sizeFilter = new SizeFilterPanel(FileSearchData.FileType.IMAGE); + int[] indicesSelected = {1, 2, 3, 4, 5}; + sizeFilter.configurePanel(true, indicesSelected); + sizeFilter.addListeners(this, new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent evt) { + if (!evt.getValueIsAdjusting()) { + validateFields(); + } + } + }); + filters.add(sizeFilter); + addToGridBagLayout(sizeFilter.getCheckbox(), null); + addToGridBagLayout(sizeFilter, null); + updateLayout(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + }// //GEN-END:initComponents + + + private void validateFields() { + String errorString; + for (SearchFilterInterface filterPanel : filters) { + errorString = filterPanel.checkForError(); + if (errorString != null) { + setInvalid(errorString); + return; + } + } + setValid(); + } + + @Override + public void actionPerformed(ActionEvent e) { + validateFields(); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form index 723888f04f..d35521df46 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.form @@ -19,6 +19,7 @@ + @@ -177,6 +178,10 @@ + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 3a82dd8d47..94883b9ea8 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -435,6 +435,8 @@ public class ResultsPanel extends javax.swing.JPanel { pagingPanel.add(gotoPageLabel, gridBagConstraints); gotoPageField.setEnabled(false); + gotoPageField.setMinimumSize(new java.awt.Dimension(30, 22)); + gotoPageField.setName(""); // NOI18N gotoPageField.setPreferredSize(new java.awt.Dimension(26, 22)); gotoPageField.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SearchFilterInterface.java b/Core/src/org/sleuthkit/autopsy/discovery/SearchFilterInterface.java new file mode 100644 index 0000000000..afc1dc7e50 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/SearchFilterInterface.java @@ -0,0 +1,47 @@ +/* + * 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.discovery; + +import java.awt.event.ActionListener; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.event.ListSelectionListener; + +/** + * + * @author wschaefer + */ +abstract class SearchFilterInterface extends javax.swing.JPanel { + + private static final long serialVersionUID = 1L; + + /** + * Setup the file filter settings. + * + * @param selected Boolean indicating if the filter should be + * selected. + * @param indicesSelected Array of integers indicating which list items are + * selected, null to indicate leaving selected items + * unchanged or that there are no items to select. + */ + abstract void configurePanel(boolean selected, int[] indicesSelected); + + abstract JCheckBox getCheckbox(); + + abstract JLabel getAdditionalLabel(); + + abstract String checkForError(); + + /** + * Add listeners to the checkbox/list set if listeners have not already been + * added. Either can be null. + * + * @param checkBox + * @param list + */ + abstract void addListeners(ActionListener listener, ListSelectionListener listListener); + +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form new file mode 100644 index 0000000000..de6233f517 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form @@ -0,0 +1,66 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java new file mode 100644 index 0000000000..c4436efc79 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -0,0 +1,158 @@ +/* + * 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.discovery; + +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; +import javax.swing.DefaultListModel; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.event.ListSelectionListener; +import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; + +/** + * + * @author wschaefer + */ +final class SizeFilterPanel extends SearchFilterInterface { + + private static final long serialVersionUID = 1L; + /** + * Creates new form SizeFilterPanel + */ + SizeFilterPanel(FileSearchData.FileType type) { + initComponents(); + setUpSizeFilter(type); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + sizeCheckbox = new javax.swing.JCheckBox(); + sizeScrollPane = new javax.swing.JScrollPane(); + sizeList = new javax.swing.JList<>(); + + org.openide.awt.Mnemonics.setLocalizedText(sizeCheckbox, org.openide.util.NbBundle.getMessage(SizeFilterPanel.class, "SizeFilterPanel.sizeCheckbox.text")); // NOI18N + sizeCheckbox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + sizeCheckboxActionPerformed(evt); + } + }); + + sizeList.setModel(new DefaultListModel()); + sizeList.setEnabled(false); + sizeList.setVisibleRowCount(5); + sizeScrollPane.setViewportView(sizeList); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(sizeScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(sizeScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0)) + ); + }// //GEN-END:initComponents + + private void sizeCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sizeCheckboxActionPerformed + sizeList.setEnabled(sizeCheckbox.isSelected()); + }//GEN-LAST:event_sizeCheckboxActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox sizeCheckbox; + private javax.swing.JList sizeList; + private javax.swing.JScrollPane sizeScrollPane; + // End of variables declaration//GEN-END:variables + + @Override + public void configurePanel(boolean selected, int[] indicesSelected) { + sizeCheckbox.setSelected(selected); + if (sizeCheckbox.isEnabled() && sizeCheckbox.isSelected()) { + sizeScrollPane.setEnabled(true); + sizeList.setEnabled(true); + if (indicesSelected != null) { + sizeList.setSelectedIndices(indicesSelected); + } + } else { + sizeScrollPane.setEnabled(false); + sizeList.setEnabled(false); + } + } + + @Override + public JCheckBox getCheckbox() { + return sizeCheckbox; + } + + @Override + public JLabel getAdditionalLabel() { + return null; + } + + /** + * Initialize the file size filter + */ + private void setUpSizeFilter(FileSearchData.FileType fileType) { + int count = 0; + DefaultListModel sizeListModel = (DefaultListModel) sizeList.getModel(); + sizeListModel.removeAllElements(); + if (null == fileType) { + for (FileSize size : FileSize.values()) { + sizeListModel.add(count, size); + } + } else { + List sizes; + switch (fileType) { + case VIDEO: + sizes = FileSize.getOptionsForVideos(); + break; + case IMAGE: + sizes = FileSize.getOptionsForImages(); + break; + case DOCUMENTS: + sizes = FileSize.getOptionsForImages(); + break; + default: + sizes = new ArrayList<>(); + break; + } + for (FileSize size : sizes) { + sizeListModel.add(count, size); + } + } + } + + @Override + String checkForError() { + if (sizeCheckbox.isSelected() && sizeList.getSelectedValuesList().isEmpty()) { + return "At least one size must be selected"; + } + return null; + + } + + @Override + void addListeners(ActionListener actionListener, ListSelectionListener listListener) { + if (sizeCheckbox != null) { + sizeCheckbox.addActionListener(actionListener); + } + if (sizeList != null) { + sizeList.addListSelectionListener(listListener); + } + } +} From a4bd743be57bc2c0b9618b76c5d45c497afe3587 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 15 May 2020 10:25:18 -0400 Subject: [PATCH 09/51] 6305 past occurrences panel created --- ...ava => AbstractDiscoveryFiltersPanel.java} | 8 +- .../discovery/AbstractFilterPanel.java | 16 ++-- .../discovery/Bundle.properties-MERGED | 2 + .../discovery/DataSourceFilterPanel.java | 2 +- .../autopsy/discovery/DiscoveryDialog.form | 8 +- .../autopsy/discovery/DiscoveryDialog.java | 86 +++++++++---------- .../autopsy/discovery/FileSearchPanel.form | 6 +- .../autopsy/discovery/FileSearchPanel.java | 6 +- .../autopsy/discovery/ImageFilterPanel.form | 3 +- .../autopsy/discovery/ImageFilterPanel.java | 10 ++- .../discovery/PastOccurrencesFilterPanel.form | 28 ++++++ .../discovery/PastOccurrencesFilterPanel.java | 45 ++++++++++ .../autopsy/discovery/SizeFilterPanel.java | 2 +- 13 files changed, 151 insertions(+), 71 deletions(-) rename Core/src/org/sleuthkit/autopsy/discovery/{SearchFilterInterface.java => AbstractDiscoveryFiltersPanel.java} (89%) create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SearchFilterInterface.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java similarity index 89% rename from Core/src/org/sleuthkit/autopsy/discovery/SearchFilterInterface.java rename to Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java index afc1dc7e50..686e768d4b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SearchFilterInterface.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java @@ -14,7 +14,7 @@ import javax.swing.event.ListSelectionListener; * * @author wschaefer */ -abstract class SearchFilterInterface extends javax.swing.JPanel { +abstract class AbstractDiscoveryFiltersPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; @@ -37,10 +37,10 @@ abstract class SearchFilterInterface extends javax.swing.JPanel { /** * Add listeners to the checkbox/list set if listeners have not already been - * added. Either can be null. + * added. * - * @param checkBox - * @param list + * @param listener + * @param listListener */ abstract void addListeners(ActionListener listener, ListSelectionListener listListener); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java index 3662138c47..06876d5d3f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java @@ -20,26 +20,22 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL private static final double PANEL_WEIGHT = 0; private static final int LABEL_WIDTH = 1; private static final int PANEL_WIDTH = 2; - private static final int NUMBER_OF_COLUMNS = 4; + private static final int NUMBER_OF_COLUMNS = 6; private static final long serialVersionUID = 1L; private final GridBagLayout layout = new GridBagLayout(); private final GridBagConstraints constraints = new GridBagConstraints(); - void initConstraints() { + final void initConstraints() { constraints.fill = GridBagConstraints.HORIZONTAL; constraints.gridx = 0; constraints.gridy = 0; constraints.gridheight = 2; constraints.gridwidth = LABEL_WIDTH; constraints.weightx = LABEL_WEIGHT; - constraints.anchor = GridBagConstraints.LINE_START; + constraints.anchor = GridBagConstraints.NORTHWEST; } final void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd) { - constraints.gridx = (constraints.gridx + 1) % NUMBER_OF_COLUMNS; - if (constraints.gridx == 0) { - constraints.gridy++; - } if (constraints.gridx % 2 == 0) { constraints.weightx = LABEL_WEIGHT; constraints.gridwidth = LABEL_WIDTH; @@ -52,11 +48,15 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL add(componentToAdd, constraints); constraints.gridy++; add(additionalComponentToAdd, constraints); - constraints.gridheight = 2; constraints.gridy--; + constraints.gridheight = 2; } else { add(componentToAdd, constraints); } + constraints.gridx = (constraints.gridx + LABEL_WIDTH) % NUMBER_OF_COLUMNS; + if (constraints.gridx == 0) { + constraints.gridy += constraints.gridheight; + } } final void updateLayout() { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index b7dd8cf30a..6c463a1778 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -219,6 +219,8 @@ DiscoveryDialog.cancelButton.text=Cancel DetailsPanel.instancesList.border.title=Instances ResultsPanel.unableToCreate.text=Unable to create summary. ResultsPanel.viewFileInDir.name=View File in Directory +SizeFilterPanel.sizeCheckbox.text=File Size: +DataSourceFilterPanel.dataSourceCheckbox.text=Data Source: VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index 40ba80fd33..98471c6663 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -20,7 +20,7 @@ import org.sleuthkit.datamodel.TskCoreException; * * @author wschaefer */ -final class DataSourceFilterPanel extends SearchFilterInterface { +final class DataSourceFilterPanel extends AbstractDiscoveryFiltersPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DataSourceFilterPanel.class.getName()); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 5d22e3351d..3fa2ef600d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -18,7 +18,7 @@ - + @@ -38,13 +38,13 @@ - + - + @@ -154,7 +154,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index e0eadc7d15..4d000498f1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -33,7 +33,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DiscoveryDialog.class.getName()); - private final FileSearchPanel filterPanel = new FileSearchPanel(); + private final ImageFilterPanel filterPanel = new ImageFilterPanel(); private static final Color SELECTED_COLOR = new Color(216, 230, 242); private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); private SearchWorker searchWorker = null; @@ -78,7 +78,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { * Update the search settings to a default state. */ private void updateSearchSettings() { - filterPanel.resetPanel(); +// filterPanel.resetPanel(); imagesButton.setSelected(true); imagesButton.setEnabled(false); imagesButton.setBackground(SELECTED_COLOR); @@ -89,7 +89,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); - filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); +// filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); } /** @@ -157,13 +157,13 @@ final class DiscoveryDialog extends javax.swing.JDialog { toolBarPanelLayout.setHorizontalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap(98, Short.MAX_VALUE) + .addContainerGap(328, Short.MAX_VALUE) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(documentsButton) - .addContainerGap(87, Short.MAX_VALUE)) + .addContainerGap(317, Short.MAX_VALUE)) ); toolBarPanelLayout.setVerticalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -200,7 +200,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE) + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 838, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cancelButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -236,7 +236,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); - filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); +// filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); }//GEN-LAST:event_imagesButtonActionPerformed private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed @@ -250,7 +250,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); - filterPanel.setSelectedType(FileSearchData.FileType.VIDEO); +// filterPanel.setSelectedType(FileSearchData.FileType.VIDEO); }//GEN-LAST:event_videosButtonActionPerformed private void documentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_documentsButtonActionPerformed @@ -264,44 +264,44 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton.setSelected(false); imagesButton.setEnabled(true); imagesButton.setBackground(UNSELECTED_COLOR); - filterPanel.setSelectedType(FileSearchData.FileType.DOCUMENTS); +// filterPanel.setSelectedType(FileSearchData.FileType.DOCUMENTS); }//GEN-LAST:event_documentsButtonActionPerformed private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed // Get the selected filters - final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); - if (tc == null) { - setInvalid("No Top Component Found"); - return; - } - - if (tc.isOpened() == false) { - tc.open(); - } - tc.resetTopComponent(); - List filters = filterPanel.getFilters(); - DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(filterPanel.getSelectedType())); - - // Get the grouping attribute and group sorting method - FileSearch.AttributeType groupingAttr = filterPanel.getGroupingAttribute(); - FileGroup.GroupSortingAlgorithm groupSortAlgorithm = filterPanel.getGroupSortingMethod(); - - // Get the file sorting method - FileSorter.SortingMethod fileSort = filterPanel.getFileSortingMethod(); - CentralRepository centralRepoDb = null; - if (CentralRepository.isEnabled()) { - try { - centralRepoDb = CentralRepository.getInstance(); - } catch (CentralRepoException ex) { - centralRepoDb = null; - logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex); - } - } - searchWorker = new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort); - searchWorker.execute(); - dispose(); - tc.toFront(); - tc.requestActive(); +// final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); +// if (tc == null) { +// setInvalid("No Top Component Found"); +// return; +// } +// +// if (tc.isOpened() == false) { +// tc.open(); +// } +// tc.resetTopComponent(); +// List filters = filterPanel.getFilters(); +// DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(filterPanel.getSelectedType())); +// +// // Get the grouping attribute and group sorting method +// FileSearch.AttributeType groupingAttr = filterPanel.getGroupingAttribute(); +// FileGroup.GroupSortingAlgorithm groupSortAlgorithm = filterPanel.getGroupSortingMethod(); +// +// // Get the file sorting method +// FileSorter.SortingMethod fileSort = filterPanel.getFileSortingMethod(); +// CentralRepository centralRepoDb = null; +// if (CentralRepository.isEnabled()) { +// try { +// centralRepoDb = CentralRepository.getInstance(); +// } catch (CentralRepoException ex) { +// centralRepoDb = null; +// logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex); +// } +// } +// searchWorker = new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort); +// searchWorker.execute(); +// dispose(); +// tc.toFront(); +// tc.requestActive(); }//GEN-LAST:event_searchButtonActionPerformed @@ -310,7 +310,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { }//GEN-LAST:event_cancelButtonActionPerformed void cancelSearch() { - filterPanel.cancelSearch(); +// filterPanel.cancelSearch(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form index 8460710c89..59ca312e81 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form @@ -675,7 +675,7 @@ - + @@ -721,7 +721,7 @@ - + @@ -776,7 +776,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java index a532afe816..6b983a4014 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java @@ -1583,7 +1583,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener fullRadioPanelLayout.setHorizontalGroup( fullRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fullRadioPanelLayout.createSequentialGroup() - .addContainerGap(58, Short.MAX_VALUE) + .addContainerGap(310, Short.MAX_VALUE) .addComponent(fullRadioButton) .addGap(20, 20, 20)) ); @@ -1613,7 +1613,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener includeRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(includeRadioPanelLayout.createSequentialGroup() .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 310, Short.MAX_VALUE) .addComponent(includeRadioButton)) ); includeRadioPanelLayout.setVerticalGroup( @@ -1638,7 +1638,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, parentTextPanelLayout.createSequentialGroup() .addGap(0, 0, 0) - .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)) + .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)) ); parentTextPanelLayout.setVerticalGroup( parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form index 7545cb2a78..8458b286d7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form @@ -11,7 +11,8 @@ + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index b315b63f70..cceec905cf 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -19,7 +19,7 @@ final class ImageFilterPanel extends AbstractFilterPanel { private static final long serialVersionUID = 1L; - private final List filters = new ArrayList<>(); + private final List filters = new ArrayList<>(); /** * Creates new form ImageFilterPanel @@ -43,6 +43,9 @@ final class ImageFilterPanel extends AbstractFilterPanel { } }); filters.add(dataSourceFilter); + addToGridBagLayout(dataSourceFilter.getCheckbox(), null); + addToGridBagLayout(dataSourceFilter, null); + updateLayout(); } private void addSizeFilter() { @@ -71,12 +74,13 @@ final class ImageFilterPanel extends AbstractFilterPanel { @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents private void initComponents() { - }// //GEN-END:initComponents + setLayout(new java.awt.GridBagLayout()); + }// //GEN-END:initComponents private void validateFields() { String errorString; - for (SearchFilterInterface filterPanel : filters) { + for (AbstractDiscoveryFiltersPanel filterPanel : filters) { errorString = filterPanel.checkForError(); if (errorString != null) { setInvalid(errorString); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form new file mode 100644 index 0000000000..4f9abb50dc --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java new file mode 100644 index 0000000000..b4cd90a9f9 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -0,0 +1,45 @@ +/* + * 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.discovery; + +/** + * + * @author wschaefer + */ +public class PastOccurrencesFilterPanel extends javax.swing.JPanel { + + /** + * Creates new form PastOccurrencesFilterPanel + */ + public PastOccurrencesFilterPanel() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index c4436efc79..9c7dd8d22e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -18,7 +18,7 @@ import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; * * @author wschaefer */ -final class SizeFilterPanel extends SearchFilterInterface { +final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { private static final long serialVersionUID = 1L; /** From f0a47b552a7cf6df007a1660d2fe75b1363b3932 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Mon, 18 May 2020 10:11:01 -0400 Subject: [PATCH 10/51] 6305 finish implementing abstraction of UI filter panels for images --- .../AbstractDiscoveryFiltersPanel.java | 12 +- .../autopsy/discovery/Bundle.properties | 26 ++ .../discovery/Bundle.properties-MERGED | 2 + .../discovery/DataSourceFilterPanel.java | 12 +- .../autopsy/discovery/DiscoveryDialog.form | 8 +- .../autopsy/discovery/DiscoveryDialog.java | 86 +++--- .../autopsy/discovery/DiscoveryUiUtils.java | 36 +++ .../autopsy/discovery/FileSearchPanel.form | 6 +- .../autopsy/discovery/FileSearchPanel.java | 7 +- .../autopsy/discovery/HashSetFilterPanel.form | 63 ++++ .../autopsy/discovery/HashSetFilterPanel.java | 144 +++++++++ .../autopsy/discovery/ImageFilterPanel.java | 2 + .../InterestingItemsFilterPanel.form | 63 ++++ .../InterestingItemsFilterPanel.java | 144 +++++++++ .../discovery/ObjectDetectedFilterPanel.form | 63 ++++ .../discovery/ObjectDetectedFilterPanel.java | 144 +++++++++ .../discovery/ParentFolderFilterPanel.form | 197 +++++++++++++ .../discovery/ParentFolderFilterPanel.java | 276 ++++++++++++++++++ .../discovery/PastOccurrencesFilterPanel.form | 41 ++- .../discovery/PastOccurrencesFilterPanel.java | 62 +++- .../autopsy/discovery/SizeFilterPanel.java | 13 +- .../discovery/UserCreatedFilterPanel.form | 37 +++ .../discovery/UserCreatedFilterPanel.java | 81 +++++ 23 files changed, 1446 insertions(+), 79 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java index 686e768d4b..1d700e84d7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java @@ -8,6 +8,7 @@ package org.sleuthkit.autopsy.discovery; import java.awt.event.ActionListener; import javax.swing.JCheckBox; import javax.swing.JLabel; +import javax.swing.JList; import javax.swing.event.ListSelectionListener; /** @@ -31,6 +32,8 @@ abstract class AbstractDiscoveryFiltersPanel extends javax.swing.JPanel { abstract JCheckBox getCheckbox(); + abstract JList getList(); + abstract JLabel getAdditionalLabel(); abstract String checkForError(); @@ -42,6 +45,13 @@ abstract class AbstractDiscoveryFiltersPanel extends javax.swing.JPanel { * @param listener * @param listListener */ - abstract void addListeners(ActionListener listener, ListSelectionListener listListener); + void addListeners(ActionListener actionListener, ListSelectionListener listListener) { + if (getCheckbox() != null) { + getCheckbox().addActionListener(actionListener); + } + if (getList() != null) { + getList().addListSelectionListener(listListener); + } + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index 06e382e230..326ca1a482 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -67,3 +67,29 @@ DiscoveryDialog.cancelButton.text=Cancel DetailsPanel.instancesList.border.title=Instances SizeFilterPanel.sizeCheckbox.text=File Size: DataSourceFilterPanel.dataSourceCheckbox.text=Data Source: +PastOccurrencesFilterPanel.crFrequencyCheckbox.text=Past Occurrences: +UserCreatedFilterPanel.userCreatedCheckbox.text=Possibly User Created +# 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. +HashSetFilterPanel.hashSetCheckbox.text=Hash Set: +InterestingItemFilterPanel.interestingItemsCheckbox.text=Interesting Item: +ObjectDetectedFilterPanel.objectsCheckbox.text=Object Detected: +ParentFolderFilterPanel.parentCheckbox.text=Parent Folder: +ParentFolderFilterPanel.deleteButton.text=Delete +ParentFolderFilterPanel.excludeRadioButton.text=Exclude +ParentFolderFilterPanel.includeRadioButton.text=Include +ParentFolderFilterPanel.substringRadioButton.text=Substring +ParentFolderFilterPanel.fullRadioButton.text=Full +ParentFolderFilterPanel.parentLabel.text=(All will be used) +ParentFolderFilterPanel.addButton.text=Add +ParentFolderFilterPanel.parentCheckbox.text_1=Parent Folder: +ParentFolderFilterPanel.addButton.text_1=Add +ParentFolderFilterPanel.deleteButton.text_1=Delete +ParentFolderFilterPanel.excludeRadioButton.text_1=Exclude +ParentFolderFilterPanel.substringRadioButton.text_1=Substring +ParentFolderFilterPanel.includeRadioButton.text_1=Include +ParentFolderFilterPanel.fullRadioButton.text_1=Full +ParentFolderFilterPanel.parentLabel.text_1=(All will be used) +InterestingItemsFilterPanel.interestingItemsCheckbox.text=Interesting Item: +UserCreatedFilterPanel.userCreatedCheckbox.text_1=Possibly User Created diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 6c463a1778..1ac925a90c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -221,6 +221,8 @@ ResultsPanel.unableToCreate.text=Unable to create summary. ResultsPanel.viewFileInDir.name=View File in Directory SizeFilterPanel.sizeCheckbox.text=File Size: DataSourceFilterPanel.dataSourceCheckbox.text=Data Source: +PastOccurrencesFilterPanel.crFrequencyCheckbox.text=Past Occurrences: +UserCreatedFilterPanel.userCreatedCheckbox.text=Possibly User Created VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index 98471c6663..59da46f937 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -5,12 +5,11 @@ */ package org.sleuthkit.autopsy.discovery; -import java.awt.event.ActionListener; import java.util.logging.Level; import javax.swing.DefaultListModel; import javax.swing.JCheckBox; import javax.swing.JLabel; -import javax.swing.event.ListSelectionListener; +import javax.swing.JList; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.DataSource; @@ -125,13 +124,8 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFiltersPanel { } @Override - void addListeners(ActionListener actionListener, ListSelectionListener listListener) { - if (dataSourceCheckbox != null) { - dataSourceCheckbox.addActionListener(actionListener); - } - if (dataSourceList != null) { - dataSourceList.addListSelectionListener(listListener); - } + JList getList() { + return dataSourceList; } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 3fa2ef600d..5d22e3351d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -18,7 +18,7 @@ - + @@ -38,13 +38,13 @@ - + - + @@ -154,7 +154,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 4d000498f1..e0eadc7d15 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -33,7 +33,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DiscoveryDialog.class.getName()); - private final ImageFilterPanel filterPanel = new ImageFilterPanel(); + private final FileSearchPanel filterPanel = new FileSearchPanel(); private static final Color SELECTED_COLOR = new Color(216, 230, 242); private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); private SearchWorker searchWorker = null; @@ -78,7 +78,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { * Update the search settings to a default state. */ private void updateSearchSettings() { -// filterPanel.resetPanel(); + filterPanel.resetPanel(); imagesButton.setSelected(true); imagesButton.setEnabled(false); imagesButton.setBackground(SELECTED_COLOR); @@ -89,7 +89,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); -// filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); + filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); } /** @@ -157,13 +157,13 @@ final class DiscoveryDialog extends javax.swing.JDialog { toolBarPanelLayout.setHorizontalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap(328, Short.MAX_VALUE) + .addContainerGap(98, Short.MAX_VALUE) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(documentsButton) - .addContainerGap(317, Short.MAX_VALUE)) + .addContainerGap(87, Short.MAX_VALUE)) ); toolBarPanelLayout.setVerticalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -200,7 +200,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 838, Short.MAX_VALUE) + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cancelButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -236,7 +236,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); -// filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); + filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); }//GEN-LAST:event_imagesButtonActionPerformed private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed @@ -250,7 +250,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); -// filterPanel.setSelectedType(FileSearchData.FileType.VIDEO); + filterPanel.setSelectedType(FileSearchData.FileType.VIDEO); }//GEN-LAST:event_videosButtonActionPerformed private void documentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_documentsButtonActionPerformed @@ -264,44 +264,44 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton.setSelected(false); imagesButton.setEnabled(true); imagesButton.setBackground(UNSELECTED_COLOR); -// filterPanel.setSelectedType(FileSearchData.FileType.DOCUMENTS); + filterPanel.setSelectedType(FileSearchData.FileType.DOCUMENTS); }//GEN-LAST:event_documentsButtonActionPerformed private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed // Get the selected filters -// final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); -// if (tc == null) { -// setInvalid("No Top Component Found"); -// return; -// } -// -// if (tc.isOpened() == false) { -// tc.open(); -// } -// tc.resetTopComponent(); -// List filters = filterPanel.getFilters(); -// DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(filterPanel.getSelectedType())); -// -// // Get the grouping attribute and group sorting method -// FileSearch.AttributeType groupingAttr = filterPanel.getGroupingAttribute(); -// FileGroup.GroupSortingAlgorithm groupSortAlgorithm = filterPanel.getGroupSortingMethod(); -// -// // Get the file sorting method -// FileSorter.SortingMethod fileSort = filterPanel.getFileSortingMethod(); -// CentralRepository centralRepoDb = null; -// if (CentralRepository.isEnabled()) { -// try { -// centralRepoDb = CentralRepository.getInstance(); -// } catch (CentralRepoException ex) { -// centralRepoDb = null; -// logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex); -// } -// } -// searchWorker = new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort); -// searchWorker.execute(); -// dispose(); -// tc.toFront(); -// tc.requestActive(); + final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); + if (tc == null) { + setInvalid("No Top Component Found"); + return; + } + + if (tc.isOpened() == false) { + tc.open(); + } + tc.resetTopComponent(); + List filters = filterPanel.getFilters(); + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(filterPanel.getSelectedType())); + + // Get the grouping attribute and group sorting method + FileSearch.AttributeType groupingAttr = filterPanel.getGroupingAttribute(); + FileGroup.GroupSortingAlgorithm groupSortAlgorithm = filterPanel.getGroupSortingMethod(); + + // Get the file sorting method + FileSorter.SortingMethod fileSort = filterPanel.getFileSortingMethod(); + CentralRepository centralRepoDb = null; + if (CentralRepository.isEnabled()) { + try { + centralRepoDb = CentralRepository.getInstance(); + } catch (CentralRepoException ex) { + centralRepoDb = null; + logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex); + } + } + searchWorker = new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort); + searchWorker.execute(); + dispose(); + tc.toFront(); + tc.requestActive(); }//GEN-LAST:event_searchButtonActionPerformed @@ -310,7 +310,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { }//GEN-LAST:event_cancelButtonActionPerformed void cancelSearch() { -// filterPanel.cancelSearch(); + filterPanel.cancelSearch(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java index 9923cf2050..b844f7613c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java @@ -20,10 +20,17 @@ package org.sleuthkit.autopsy.discovery; import java.awt.Component; import java.awt.Point; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import javax.swing.ImageIcon; import javax.swing.JComponent; import org.openide.util.ImageUtilities; import org.openide.util.NbBundle; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.datamodel.BlackboardArtifact; +import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.TskCoreException; /** * Utility class for the various user interface elements used by Discovery. @@ -95,6 +102,35 @@ final class DiscoveryUiUtils { return UNSUPPORTED_DOCUMENT_THUMBNAIL; } + /** + * Get the names of the sets which exist in the case database for the + * specified artifact and attribute types. + * + * @param artifactType The artifact type to get the list of sets for. + * @param setNameAttribute The attribute type which contains the set names. + * + * @return A list of set names which exist in the case for the specified + * artifact and attribute types. + * + * @throws TskCoreException + */ + static List getSetNames(BlackboardArtifact.ARTIFACT_TYPE artifactType, BlackboardAttribute.ATTRIBUTE_TYPE setNameAttribute) throws TskCoreException { + List arts = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(artifactType); + List setNames = new ArrayList<>(); + for (BlackboardArtifact art : arts) { + for (BlackboardAttribute attr : art.getAttributes()) { + if (attr.getAttributeType().getTypeID() == setNameAttribute.getTypeID()) { + String setName = attr.getValueString(); + if (!setNames.contains(setName)) { + setNames.add(setName); + } + } + } + } + Collections.sort(setNames); + return setNames; + } + /** * Helper method to see if point is on the icon. * diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form index 59ca312e81..e2c333ba66 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form @@ -675,7 +675,7 @@ - + @@ -721,7 +721,7 @@ - + @@ -776,7 +776,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java index 6b983a4014..1fce33132c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java @@ -36,7 +36,6 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.discovery.FileGroup.GroupSortingAlgorithm; import org.sleuthkit.autopsy.discovery.FileSearch.GroupingAttributeType; @@ -1583,7 +1582,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener fullRadioPanelLayout.setHorizontalGroup( fullRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fullRadioPanelLayout.createSequentialGroup() - .addContainerGap(310, Short.MAX_VALUE) + .addContainerGap(299, Short.MAX_VALUE) .addComponent(fullRadioButton) .addGap(20, 20, 20)) ); @@ -1613,7 +1612,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener includeRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(includeRadioPanelLayout.createSequentialGroup() .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 310, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 299, Short.MAX_VALUE) .addComponent(includeRadioButton)) ); includeRadioPanelLayout.setVerticalGroup( @@ -1638,7 +1637,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, parentTextPanelLayout.createSequentialGroup() .addGap(0, 0, 0) - .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)) + .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE)) ); parentTextPanelLayout.setVerticalGroup( parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form new file mode 100644 index 0000000000..f81e9f814f --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form @@ -0,0 +1,63 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java new file mode 100644 index 0000000000..95e6c73048 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -0,0 +1,144 @@ +package org.sleuthkit.autopsy.discovery; + +import java.util.List; +import java.util.logging.Level; +import javax.swing.DefaultListModel; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JList; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.BlackboardArtifact; +import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.TskCoreException; + +/* + * 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. + */ +/** + * + * @author wschaefer + */ +public class HashSetFilterPanel extends AbstractDiscoveryFiltersPanel { + + private static final long serialVersionUID = 1L; + private final static Logger logger = Logger.getLogger(HashSetFilterPanel.class.getName()); + + /** + * Creates new form HashSetFilterPaenl + */ + public HashSetFilterPanel() { + initComponents(); + setUpHashFilter(); + } + + /** + * Initialize the hash filter. + */ + private void setUpHashFilter() { + int count = 0; + try { + DefaultListModel hashListModel = (DefaultListModel) hashSetList.getModel(); + hashListModel.removeAllElements(); + List setNames = DiscoveryUiUtils.getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT, + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME); + for (String name : setNames) { + hashListModel.add(count, name); + count++; + } + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error loading hash set names", ex); + hashSetCheckbox.setEnabled(false); + hashSetList.setEnabled(false); + } + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + hashSetCheckbox = new javax.swing.JCheckBox(); + hashSetScrollPane = new javax.swing.JScrollPane(); + hashSetList = new javax.swing.JList<>(); + + org.openide.awt.Mnemonics.setLocalizedText(hashSetCheckbox, org.openide.util.NbBundle.getMessage(HashSetFilterPanel.class, "HashSetFilterPanel.hashSetCheckbox.text")); // NOI18N + hashSetCheckbox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + hashSetCheckboxActionPerformed(evt); + } + }); + + hashSetList.setModel(new DefaultListModel()); + hashSetList.setEnabled(false); + hashSetList.setVisibleRowCount(3); + hashSetScrollPane.setViewportView(hashSetList); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(hashSetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(hashSetScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + }// //GEN-END:initComponents + + private void hashSetCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hashSetCheckboxActionPerformed + hashSetList.setEnabled(hashSetCheckbox.isSelected()); + }//GEN-LAST:event_hashSetCheckboxActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox hashSetCheckbox; + private javax.swing.JList hashSetList; + private javax.swing.JScrollPane hashSetScrollPane; + // End of variables declaration//GEN-END:variables + + @Override + void configurePanel(boolean selected, int[] indicesSelected) { + boolean hasHashSets = hashSetList.getModel().getSize() > 0; + hashSetCheckbox.setEnabled(hasHashSets); + hashSetCheckbox.setSelected(selected && hasHashSets); + if (hashSetCheckbox.isEnabled() && hashSetCheckbox.isSelected()) { + hashSetScrollPane.setEnabled(true); + hashSetList.setEnabled(true); + if (indicesSelected != null) { + hashSetList.setSelectedIndices(indicesSelected); + } + } else { + hashSetScrollPane.setEnabled(false); + hashSetList.setEnabled(false); + } + } + + @Override + JCheckBox getCheckbox() { + return hashSetCheckbox; + } + + @Override + JLabel getAdditionalLabel() { + return null; + } + + @Override + String checkForError() { + if (hashSetCheckbox.isSelected() && hashSetList.getSelectedValuesList().isEmpty()) { + return "At least one hash set name must be selected"; + } + return null; + } + + @Override + JList getList() { + return hashSetList; + } +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index cceec905cf..92bd4437f7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -65,6 +65,8 @@ final class ImageFilterPanel extends AbstractFilterPanel { addToGridBagLayout(sizeFilter, null); updateLayout(); } + + /** * This method is called from within the constructor to initialize the form. diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form new file mode 100644 index 0000000000..a3512b66f5 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form @@ -0,0 +1,63 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java new file mode 100644 index 0000000000..e6cb46b27e --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java @@ -0,0 +1,144 @@ +/* + * 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.discovery; + +import java.util.List; +import java.util.logging.Level; +import javax.swing.DefaultListModel; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JList; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.BlackboardArtifact; +import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.TskCoreException; + +/** + * + * @author wschaefer + */ +public class InterestingItemsFilterPanel extends AbstractDiscoveryFiltersPanel { + + private static final long serialVersionUID = 1L; + private final static Logger logger = Logger.getLogger(InterestingItemsFilterPanel.class.getName()); + + /** + * Creates new form InterestingItemsFilterPanel + */ + public InterestingItemsFilterPanel() { + initComponents(); + setUpInterestingItemsFilter(); + } + + /** + * Initialize the interesting items filter. + */ + private void setUpInterestingItemsFilter() { + int count = 0; + try { + DefaultListModel intListModel = (DefaultListModel) interestingItemsList.getModel(); + intListModel.removeAllElements(); + List setNames = DiscoveryUiUtils.getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT, + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME); + for (String name : setNames) { + intListModel.add(count, name); + count++; + } + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error loading interesting file set names", ex); + interestingItemsCheckbox.setEnabled(false); + interestingItemsList.setEnabled(false); + } + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + interestingItemsCheckbox = new javax.swing.JCheckBox(); + interestingItemsScrollPane = new javax.swing.JScrollPane(); + interestingItemsList = new javax.swing.JList<>(); + + org.openide.awt.Mnemonics.setLocalizedText(interestingItemsCheckbox, org.openide.util.NbBundle.getMessage(InterestingItemsFilterPanel.class, "InterestingItemsFilterPanel.interestingItemsCheckbox.text")); // NOI18N + interestingItemsCheckbox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + interestingItemsCheckboxActionPerformed(evt); + } + }); + + interestingItemsList.setModel(new DefaultListModel()); + interestingItemsList.setEnabled(false); + interestingItemsList.setVisibleRowCount(2); + interestingItemsScrollPane.setViewportView(interestingItemsList); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(interestingItemsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 491, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(interestingItemsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + }// //GEN-END:initComponents + + private void interestingItemsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_interestingItemsCheckboxActionPerformed + interestingItemsList.setEnabled(interestingItemsCheckbox.isSelected()); + }//GEN-LAST:event_interestingItemsCheckboxActionPerformed + + @Override + void configurePanel(boolean selected, int[] indicesSelected) { + boolean hasInterestingItems = interestingItemsList.getModel().getSize() > 0; + interestingItemsCheckbox.setEnabled(hasInterestingItems); + interestingItemsCheckbox.setSelected(selected && hasInterestingItems); + if (interestingItemsCheckbox.isEnabled() && interestingItemsCheckbox.isSelected()) { + interestingItemsScrollPane.setEnabled(true); + interestingItemsList.setEnabled(true); + if (indicesSelected != null) { + interestingItemsList.setSelectedIndices(indicesSelected); + } + } else { + interestingItemsScrollPane.setEnabled(false); + interestingItemsList.setEnabled(false); + } + } + + @Override + JCheckBox getCheckbox() { + return interestingItemsCheckbox; + } + + @Override + JLabel getAdditionalLabel() { + return null; + } + + @Override + String checkForError() { + if (interestingItemsCheckbox.isSelected() && interestingItemsList.getSelectedValuesList().isEmpty()) { + return "At least one interesting file set name must be selected"; + } + return null; + } + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox interestingItemsCheckbox; + private javax.swing.JList interestingItemsList; + private javax.swing.JScrollPane interestingItemsScrollPane; + // End of variables declaration//GEN-END:variables + + @Override + JList getList() { + return interestingItemsList; + } +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form new file mode 100644 index 0000000000..ad4fb7938b --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form @@ -0,0 +1,63 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java new file mode 100644 index 0000000000..60996eaf94 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java @@ -0,0 +1,144 @@ +/* + * 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.discovery; + +import java.util.List; +import java.util.logging.Level; +import javax.swing.DefaultListModel; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JList; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.BlackboardArtifact; +import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.TskCoreException; + +/** + * + * @author wschaefer + */ +public class ObjectDetectedFilterPanel extends AbstractDiscoveryFiltersPanel { + + private static final long serialVersionUID = 1L; + private final static Logger logger = Logger.getLogger(ObjectDetectedFilterPanel.class.getName()); + + /** + * Creates new form ObjectDetectedFilter + */ + public ObjectDetectedFilterPanel() { + initComponents(); + setUpObjectFilter(); + } + + /** + * Initialize the object filter + */ + private void setUpObjectFilter() { + int count = 0; + try { + DefaultListModel objListModel = (DefaultListModel) objectsList.getModel(); + objListModel.removeAllElements(); + List setNames = DiscoveryUiUtils.getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION); + for (String name : setNames) { + objListModel.add(count, name); + count++; + } + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error loading object detected set names", ex); + objectsCheckbox.setEnabled(false); + objectsList.setEnabled(false); + } + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + objectsCheckbox = new javax.swing.JCheckBox(); + objectsScrollPane = new javax.swing.JScrollPane(); + objectsList = new javax.swing.JList<>(); + + org.openide.awt.Mnemonics.setLocalizedText(objectsCheckbox, org.openide.util.NbBundle.getMessage(ObjectDetectedFilterPanel.class, "ObjectDetectedFilterPanel.objectsCheckbox.text")); // NOI18N + objectsCheckbox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + objectsCheckboxActionPerformed(evt); + } + }); + + objectsList.setModel(new DefaultListModel()); + objectsList.setEnabled(false); + objectsList.setVisibleRowCount(2); + objectsScrollPane.setViewportView(objectsList); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(objectsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(objectsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + }// //GEN-END:initComponents + + private void objectsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_objectsCheckboxActionPerformed + objectsList.setEnabled(objectsCheckbox.isSelected()); + }//GEN-LAST:event_objectsCheckboxActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox objectsCheckbox; + private javax.swing.JList objectsList; + private javax.swing.JScrollPane objectsScrollPane; + // End of variables declaration//GEN-END:variables + + @Override + void configurePanel(boolean selected, int[] indicesSelected) { + boolean hasObjects = objectsList.getModel().getSize() > 0; + objectsCheckbox.setEnabled(hasObjects); + objectsCheckbox.setSelected(selected && hasObjects); + if (objectsCheckbox.isEnabled() && objectsCheckbox.isSelected()) { + objectsScrollPane.setEnabled(true); + objectsList.setEnabled(true); + if (indicesSelected != null) { + objectsList.setSelectedIndices(indicesSelected); + } + } else { + objectsScrollPane.setEnabled(false); + objectsList.setEnabled(false); + } + } + + @Override + JCheckBox getCheckbox() { + return objectsCheckbox; + } + + @Override + JLabel getAdditionalLabel() { + return null; + } + + @Override + String checkForError() { + if (objectsCheckbox.isSelected() && objectsList.getSelectedValuesList().isEmpty()) { + return "At least one object type name must be selected"; + } + return null; + } + + @Override + JList getList() { + return objectsList; + } + +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form new file mode 100644 index 0000000000..b3b238dbeb --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form @@ -0,0 +1,197 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java new file mode 100644 index 0000000000..02702d2d5f --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -0,0 +1,276 @@ +/* + * 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.discovery; + +import java.util.ArrayList; +import java.util.List; +import javax.swing.DefaultListModel; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JList; +import org.sleuthkit.autopsy.discovery.FileSearchFiltering.ParentSearchTerm; + +/** + * + * @author wschaefer + */ +public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { + + private static final long serialVersionUID = 1L; + private DefaultListModel parentListModel; + + /** + * Creates new form ParentFolderFilterPanel + */ + public ParentFolderFilterPanel() { + initComponents(); + setUpParentPathFilter(); + } + + + /** + * Initialize the parent path filter + */ + private void setUpParentPathFilter() { + fullRadioButton.setSelected(true); + includeRadioButton.setSelected(true); + parentListModel = (DefaultListModel) parentList.getModel(); + } + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + parentCheckbox = new javax.swing.JCheckBox(); + parentLabel = new javax.swing.JLabel(); + parentScrollPane = new javax.swing.JScrollPane(); + parentList = new javax.swing.JList<>(); + fullRadioButton = new javax.swing.JRadioButton(); + includeRadioButton = new javax.swing.JRadioButton(); + substringRadioButton = new javax.swing.JRadioButton(); + excludeRadioButton = new javax.swing.JRadioButton(); + deleteButton = new javax.swing.JButton(); + addButton = new javax.swing.JButton(); + parentTextField = new javax.swing.JTextField(); + + org.openide.awt.Mnemonics.setLocalizedText(parentCheckbox, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.parentCheckbox.text_1")); // NOI18N + parentCheckbox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + parentCheckboxActionPerformed(evt); + } + }); + + org.openide.awt.Mnemonics.setLocalizedText(parentLabel, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.parentLabel.text_1")); // NOI18N + + parentList.setModel(new DefaultListModel()); + parentList.setEnabled(false); + parentList.setVisibleRowCount(4); + parentList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { + public void valueChanged(javax.swing.event.ListSelectionEvent evt) { + parentListValueChanged(evt); + } + }); + parentScrollPane.setViewportView(parentList); + + fullRadioButton.setSelected(true); + org.openide.awt.Mnemonics.setLocalizedText(fullRadioButton, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.fullRadioButton.text_1")); // NOI18N + fullRadioButton.setEnabled(false); + + includeRadioButton.setSelected(true); + org.openide.awt.Mnemonics.setLocalizedText(includeRadioButton, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.includeRadioButton.text_1")); // NOI18N + includeRadioButton.setEnabled(false); + + org.openide.awt.Mnemonics.setLocalizedText(substringRadioButton, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.substringRadioButton.text_1")); // NOI18N + substringRadioButton.setEnabled(false); + + org.openide.awt.Mnemonics.setLocalizedText(excludeRadioButton, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.excludeRadioButton.text_1")); // NOI18N + excludeRadioButton.setEnabled(false); + + org.openide.awt.Mnemonics.setLocalizedText(deleteButton, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.deleteButton.text_1")); // NOI18N + deleteButton.setEnabled(false); + deleteButton.setMaximumSize(new java.awt.Dimension(70, 23)); + deleteButton.setMinimumSize(new java.awt.Dimension(70, 23)); + deleteButton.setPreferredSize(new java.awt.Dimension(70, 23)); + deleteButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + deleteButtonActionPerformed(evt); + } + }); + + org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.addButton.text_1")); // NOI18N + addButton.setEnabled(false); + addButton.setMaximumSize(new java.awt.Dimension(70, 23)); + addButton.setMinimumSize(new java.awt.Dimension(70, 23)); + addButton.setPreferredSize(new java.awt.Dimension(70, 23)); + addButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + addButtonActionPerformed(evt); + } + }); + + parentTextField.setEnabled(false); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(0, 0, 0) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(fullRadioButton) + .addComponent(includeRadioButton)) + .addGap(31, 31, 31) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(excludeRadioButton) + .addGap(176, 176, 176) + .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(substringRadioButton))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(parentScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 429, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(parentScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(fullRadioButton) + .addComponent(substringRadioButton)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(includeRadioButton) + .addComponent(excludeRadioButton) + .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + ); + }// //GEN-END:initComponents + + private void parentCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_parentCheckboxActionPerformed +// parentFilterSettings(true, true, parentCheckbox.isSelected(), null); + }//GEN-LAST:event_parentCheckboxActionPerformed + + private void parentListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_parentListValueChanged + if (parentList.getSelectedValuesList().isEmpty()) { + deleteButton.setEnabled(false); + } else { + deleteButton.setEnabled(true); + } + }//GEN-LAST:event_parentListValueChanged + + private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed + int index = parentList.getSelectedIndex(); + if (index >= 0) { + parentListModel.remove(index); + } +// validateFields(); + }//GEN-LAST:event_deleteButtonActionPerformed + + private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed + if (!parentTextField.getText().isEmpty()) { + ParentSearchTerm searchTerm; + searchTerm = new ParentSearchTerm(parentTextField.getText(), fullRadioButton.isSelected(), includeRadioButton.isSelected()); + parentListModel.add(parentListModel.size(), searchTerm); +// validateFields(); + parentTextField.setText(""); + } + }//GEN-LAST:event_addButtonActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton addButton; + private javax.swing.JButton deleteButton; + private javax.swing.JRadioButton excludeRadioButton; + private javax.swing.JRadioButton fullRadioButton; + private javax.swing.JRadioButton includeRadioButton; + private javax.swing.JCheckBox parentCheckbox; + private javax.swing.JLabel parentLabel; + private javax.swing.JList parentList; + private javax.swing.JScrollPane parentScrollPane; + private javax.swing.JTextField parentTextField; + private javax.swing.JRadioButton substringRadioButton; + // End of variables declaration//GEN-END:variables + + @Override + void configurePanel(boolean selected, int[] indicesSelected) { + parentCheckbox.setSelected(selected); + if (parentCheckbox.isEnabled() && parentCheckbox.isSelected()) { + parentScrollPane.setEnabled(true); + includeRadioButton.setEnabled(true); + excludeRadioButton.setEnabled(true); + fullRadioButton.setEnabled(true); + substringRadioButton.setEnabled(true); + addButton.setEnabled(true); + deleteButton.setEnabled(!parentListModel.isEmpty()); + parentList.setEnabled(true); + parentTextField.setEnabled(true); + if (indicesSelected != null) { + parentList.setSelectedIndices(indicesSelected); + } + } else { + parentScrollPane.setEnabled(false); + parentList.setEnabled(false); + includeRadioButton.setEnabled(false); + excludeRadioButton.setEnabled(false); + fullRadioButton.setEnabled(false); + substringRadioButton.setEnabled(false); + addButton.setEnabled(false); + deleteButton.setEnabled(false); + parentTextField.setEnabled(false); + } + } + + @Override + JCheckBox getCheckbox() { + return parentCheckbox; + } + + @Override + JLabel getAdditionalLabel() { + return parentLabel; + } + + @Override + String checkForError() { + // Parent uses everything in the box + if (parentCheckbox.isSelected() && getParentPaths().isEmpty()) { + return "At least one parent path must be entered"; + } + return null; + } + + /** + * Utility method to get the parent path objects out of the JList. + * + * @return The list of entered ParentSearchTerm objects + */ + private List getParentPaths() { + List results = new ArrayList<>(); + for (int i = 0; i < parentListModel.getSize(); i++) { + results.add(parentListModel.get(i)); + } + return results; + } + + @Override + JList getList() { + return parentList; + } + +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form index 4f9abb50dc..b3d477420c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form @@ -1,6 +1,18 @@ -
+ + + + + + + + + + + + + @@ -16,13 +28,36 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index b4cd90a9f9..9be4f0a615 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -5,11 +5,19 @@ */ package org.sleuthkit.autopsy.discovery; +import javax.swing.DefaultListModel; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JList; +import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; + /** * * @author wschaefer */ -public class PastOccurrencesFilterPanel extends javax.swing.JPanel { +public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { + + private static final long serialVersionUID = 1L; /** * Creates new form PastOccurrencesFilterPanel @@ -27,19 +35,67 @@ public class PastOccurrencesFilterPanel extends javax.swing.JPanel { // //GEN-BEGIN:initComponents private void initComponents() { + crFrequencyCheckbox = new javax.swing.JCheckBox(); + crFrequencyScrollPane = new javax.swing.JScrollPane(); + crFrequencyList = new javax.swing.JList<>(); + + org.openide.awt.Mnemonics.setLocalizedText(crFrequencyCheckbox, org.openide.util.NbBundle.getMessage(PastOccurrencesFilterPanel.class, "PastOccurrencesFilterPanel.crFrequencyCheckbox.text")); // NOI18N + crFrequencyCheckbox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + crFrequencyCheckboxActionPerformed(evt); + } + }); + + crFrequencyList.setModel(new DefaultListModel()); + crFrequencyList.setEnabled(false); + crFrequencyList.setVisibleRowCount(5); + crFrequencyScrollPane.setViewportView(crFrequencyList); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 400, Short.MAX_VALUE) + .addComponent(crFrequencyScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 300, Short.MAX_VALUE) + .addComponent(crFrequencyScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); }// //GEN-END:initComponents + private void crFrequencyCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crFrequencyCheckboxActionPerformed + crFrequencyList.setEnabled(crFrequencyCheckbox.isSelected()); + }//GEN-LAST:event_crFrequencyCheckboxActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox crFrequencyCheckbox; + private javax.swing.JList crFrequencyList; + private javax.swing.JScrollPane crFrequencyScrollPane; // End of variables declaration//GEN-END:variables + + @Override + void configurePanel(boolean selected, int[] indicesSelected) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + JCheckBox getCheckbox() { + return crFrequencyCheckbox; + } + + @Override + JLabel getAdditionalLabel() { + return null; + } + + @Override + String checkForError() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + JList getList() { + return crFrequencyList; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index 9c7dd8d22e..f368371b18 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -5,13 +5,12 @@ */ package org.sleuthkit.autopsy.discovery; -import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; import javax.swing.DefaultListModel; import javax.swing.JCheckBox; import javax.swing.JLabel; -import javax.swing.event.ListSelectionListener; +import javax.swing.JList; import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; /** @@ -21,6 +20,7 @@ import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { private static final long serialVersionUID = 1L; + /** * Creates new form SizeFilterPanel */ @@ -147,12 +147,7 @@ final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { } @Override - void addListeners(ActionListener actionListener, ListSelectionListener listListener) { - if (sizeCheckbox != null) { - sizeCheckbox.addActionListener(actionListener); - } - if (sizeList != null) { - sizeList.addListSelectionListener(listListener); - } + JList getList() { + return sizeList; } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form new file mode 100644 index 0000000000..3463d0c1ea --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form @@ -0,0 +1,37 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java new file mode 100644 index 0000000000..f3074deace --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java @@ -0,0 +1,81 @@ +/* + * 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.discovery; + +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JList; + +/** + * + * @author wschaefer + */ +public class UserCreatedFilterPanel extends AbstractDiscoveryFiltersPanel { + + private static final long serialVersionUID = 1L; + + /** + * Creates new form UserCreatedFilterPanel + */ + public UserCreatedFilterPanel() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + userCreatedCheckbox = new javax.swing.JCheckBox(); + + org.openide.awt.Mnemonics.setLocalizedText(userCreatedCheckbox, org.openide.util.NbBundle.getMessage(UserCreatedFilterPanel.class, "UserCreatedFilterPanel.userCreatedCheckbox.text_1")); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + @Override + void configurePanel(boolean selected, int[] indicesSelected) { + userCreatedCheckbox.setSelected(selected); + } + + @Override + JCheckBox getCheckbox() { + return userCreatedCheckbox; + } + + @Override + JLabel getAdditionalLabel() { + return null; + } + + @Override + String checkForError() { + //this filter currently has no errors it generates + return null; + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox userCreatedCheckbox; + // End of variables declaration//GEN-END:variables + + @Override + JList getList() { + return null; + } +} From a7ad8b5a20c1b367fb72cb2d62955f8421b351ac Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Mon, 18 May 2020 10:40:21 -0400 Subject: [PATCH 11/51] 6305 changes to abstract a bit more code --- .../AbstractDiscoveryFiltersPanel.java | 2 + .../discovery/AbstractFilterPanel.java | 51 +++++++++++++++++++ .../autopsy/discovery/Bundle.properties | 2 +- .../discovery/Bundle.properties-MERGED | 27 +++++++++- .../discovery/DataSourceFilterPanel.java | 11 ++++ .../autopsy/discovery/HashSetFilterPanel.java | 8 +++ .../autopsy/discovery/ImageFilterPanel.java | 27 +--------- .../InterestingItemsFilterPanel.java | 8 +++ .../discovery/ObjectDetectedFilterPanel.java | 8 +++ .../discovery/ParentFolderFilterPanel.java | 11 +++- .../discovery/PastOccurrencesFilterPanel.form | 6 +-- .../discovery/PastOccurrencesFilterPanel.java | 26 ++++++---- .../autopsy/discovery/SizeFilterPanel.java | 8 +++ .../discovery/UserCreatedFilterPanel.java | 8 +++ 14 files changed, 162 insertions(+), 41 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java index 1d700e84d7..1e12f4e685 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java @@ -54,4 +54,6 @@ abstract class AbstractDiscoveryFiltersPanel extends javax.swing.JPanel { } } + abstract FileSearchFiltering.FileFilter getFilter(); + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java index 06876d5d3f..235a78a420 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java @@ -8,7 +8,10 @@ package org.sleuthkit.autopsy.discovery; import java.awt.Component; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; /** * @@ -24,6 +27,7 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL private static final long serialVersionUID = 1L; private final GridBagLayout layout = new GridBagLayout(); private final GridBagConstraints constraints = new GridBagConstraints(); + private final List filters = new ArrayList<>(); final void initConstraints() { constraints.fill = GridBagConstraints.HORIZONTAL; @@ -35,6 +39,14 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL constraints.anchor = GridBagConstraints.NORTHWEST; } + void addFilter(AbstractDiscoveryFiltersPanel filterPanel) { + filters.add(filterPanel); + } + + void clearFilters() { + filters.clear(); + } + final void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd) { if (constraints.gridx % 2 == 0) { constraints.weightx = LABEL_WEIGHT; @@ -79,4 +91,43 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL void setValid() { firePropertyChange("FilterError", null, null); } + + void validateFields() { + String errorString; + for (AbstractDiscoveryFiltersPanel filterPanel : filters) { + errorString = filterPanel.checkForError(); + if (errorString != null) { + setInvalid(errorString); + return; + } + } + setValid(); + } + + @Override + public void actionPerformed(ActionEvent e) { + validateFields(); + } + + /** + * Get a list of all filters selected by the user. + * + * @return the list of filters + */ + /** + * Get a list of all filters selected by the user. + * + * @return the list of filters + */ + List getFilters() { + List filtersToUse = new ArrayList<>(); + + for (AbstractDiscoveryFiltersPanel filterPanel : filters) { + FileSearchFiltering.FileFilter filter = filterPanel.getFilter(); + if (filter != null) { + filtersToUse.add(filter); + } + } + return filtersToUse; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index 326ca1a482..fb326d2d47 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -67,7 +67,6 @@ DiscoveryDialog.cancelButton.text=Cancel DetailsPanel.instancesList.border.title=Instances SizeFilterPanel.sizeCheckbox.text=File Size: DataSourceFilterPanel.dataSourceCheckbox.text=Data Source: -PastOccurrencesFilterPanel.crFrequencyCheckbox.text=Past Occurrences: UserCreatedFilterPanel.userCreatedCheckbox.text=Possibly User Created # To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates @@ -93,3 +92,4 @@ ParentFolderFilterPanel.fullRadioButton.text_1=Full ParentFolderFilterPanel.parentLabel.text_1=(All will be used) InterestingItemsFilterPanel.interestingItemsCheckbox.text=Interesting Item: UserCreatedFilterPanel.userCreatedCheckbox.text_1=Possibly User Created +PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text=Past Occurrences: diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 1ac925a90c..fd0eea5829 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -183,6 +183,7 @@ ImageThumbnailPanel.isDeleted.text=All instances of file are deleted. # {0} - otherInstanceCount ImageThumbnailPanel.nameLabel.more.text=\ and {0} more OpenDiscoveryAction.resultsIncomplete.text=Results may be incomplete +PastOccurrencesFilterPanel.crFrequencyCheckbox.text=Past Occurrences: ResultFile.score.interestingResult.description=At least one instance of the file has an interesting result associated with it. ResultFile.score.notableFile.description=At least one instance of the file was recognized as notable. ResultFile.score.notableTaggedFile.description=At least one instance of the file is tagged with a notable tag. @@ -221,8 +222,32 @@ ResultsPanel.unableToCreate.text=Unable to create summary. ResultsPanel.viewFileInDir.name=View File in Directory SizeFilterPanel.sizeCheckbox.text=File Size: DataSourceFilterPanel.dataSourceCheckbox.text=Data Source: -PastOccurrencesFilterPanel.crFrequencyCheckbox.text=Past Occurrences: UserCreatedFilterPanel.userCreatedCheckbox.text=Possibly User Created +# 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. +HashSetFilterPanel.hashSetCheckbox.text=Hash Set: +InterestingItemFilterPanel.interestingItemsCheckbox.text=Interesting Item: +ObjectDetectedFilterPanel.objectsCheckbox.text=Object Detected: +ParentFolderFilterPanel.parentCheckbox.text=Parent Folder: +ParentFolderFilterPanel.deleteButton.text=Delete +ParentFolderFilterPanel.excludeRadioButton.text=Exclude +ParentFolderFilterPanel.includeRadioButton.text=Include +ParentFolderFilterPanel.substringRadioButton.text=Substring +ParentFolderFilterPanel.fullRadioButton.text=Full +ParentFolderFilterPanel.parentLabel.text=(All will be used) +ParentFolderFilterPanel.addButton.text=Add +ParentFolderFilterPanel.parentCheckbox.text_1=Parent Folder: +ParentFolderFilterPanel.addButton.text_1=Add +ParentFolderFilterPanel.deleteButton.text_1=Delete +ParentFolderFilterPanel.excludeRadioButton.text_1=Exclude +ParentFolderFilterPanel.substringRadioButton.text_1=Substring +ParentFolderFilterPanel.includeRadioButton.text_1=Include +ParentFolderFilterPanel.fullRadioButton.text_1=Full +ParentFolderFilterPanel.parentLabel.text_1=(All will be used) +InterestingItemsFilterPanel.interestingItemsCheckbox.text=Interesting Item: +UserCreatedFilterPanel.userCreatedCheckbox.text_1=Possibly User Created +PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text=Past Occurrences: VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index 59da46f937..7e74d50d38 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -5,7 +5,9 @@ */ package org.sleuthkit.autopsy.discovery; +import java.util.List; import java.util.logging.Level; +import java.util.stream.Collectors; import javax.swing.DefaultListModel; import javax.swing.JCheckBox; import javax.swing.JLabel; @@ -157,4 +159,13 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFiltersPanel { } return null; } + + @Override + FileSearchFiltering.FileFilter getFilter() { + if (dataSourceCheckbox.isSelected()) { + List dataSources = dataSourceList.getSelectedValuesList().stream().map(t -> t.getDataSource()).collect(Collectors.toList()); + return new FileSearchFiltering.DataSourceFilter(dataSources); + } + return null; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index 95e6c73048..b74f6650bc 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -141,4 +141,12 @@ public class HashSetFilterPanel extends AbstractDiscoveryFiltersPanel { JList getList() { return hashSetList; } + + @Override + FileSearchFiltering.FileFilter getFilter() { + if (hashSetCheckbox.isSelected()) { + return new FileSearchFiltering.HashSetFilter(hashSetList.getSelectedValuesList()); + } + return null; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index 92bd4437f7..1c62d061b7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -5,9 +5,6 @@ */ package org.sleuthkit.autopsy.discovery; -import java.awt.event.ActionEvent; -import java.util.ArrayList; -import java.util.List; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; @@ -19,8 +16,6 @@ final class ImageFilterPanel extends AbstractFilterPanel { private static final long serialVersionUID = 1L; - private final List filters = new ArrayList<>(); - /** * Creates new form ImageFilterPanel */ @@ -42,7 +37,7 @@ final class ImageFilterPanel extends AbstractFilterPanel { } } }); - filters.add(dataSourceFilter); + addFilter(dataSourceFilter); addToGridBagLayout(dataSourceFilter.getCheckbox(), null); addToGridBagLayout(dataSourceFilter, null); updateLayout(); @@ -60,13 +55,11 @@ final class ImageFilterPanel extends AbstractFilterPanel { } } }); - filters.add(sizeFilter); + addFilter(sizeFilter); addToGridBagLayout(sizeFilter.getCheckbox(), null); addToGridBagLayout(sizeFilter, null); updateLayout(); } - - /** * This method is called from within the constructor to initialize the form. @@ -80,22 +73,6 @@ final class ImageFilterPanel extends AbstractFilterPanel { setLayout(new java.awt.GridBagLayout()); }// //GEN-END:initComponents - private void validateFields() { - String errorString; - for (AbstractDiscoveryFiltersPanel filterPanel : filters) { - errorString = filterPanel.checkForError(); - if (errorString != null) { - setInvalid(errorString); - return; - } - } - setValid(); - } - - @Override - public void actionPerformed(ActionEvent e) { - validateFields(); - } // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java index e6cb46b27e..65915d2a43 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java @@ -141,4 +141,12 @@ public class InterestingItemsFilterPanel extends AbstractDiscoveryFiltersPanel { JList getList() { return interestingItemsList; } + + @Override + FileSearchFiltering.FileFilter getFilter() { + if (interestingItemsCheckbox.isSelected()) { + return new FileSearchFiltering.InterestingFileSetFilter(interestingItemsList.getSelectedValuesList()); + } + return null; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java index 60996eaf94..aa53fbe00c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java @@ -141,4 +141,12 @@ public class ObjectDetectedFilterPanel extends AbstractDiscoveryFiltersPanel { return objectsList; } + @Override + FileSearchFiltering.FileFilter getFilter() { + if (objectsCheckbox.isSelected()) { + return new FileSearchFiltering.ObjectDetectionFilter(objectsList.getSelectedValuesList()); + } + return null; + } + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index 02702d2d5f..cbf4e4dd96 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -30,8 +30,7 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { setUpParentPathFilter(); } - - /** + /** * Initialize the parent path filter */ private void setUpParentPathFilter() { @@ -39,6 +38,7 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { includeRadioButton.setSelected(true); parentListModel = (DefaultListModel) parentList.getModel(); } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -273,4 +273,11 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { return parentList; } + @Override + FileSearchFiltering.FileFilter getFilter() { + if (parentCheckbox.isSelected()) { + return new FileSearchFiltering.ParentFilter(getParentPaths()); + } + return null; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form index b3d477420c..3b5ec6f5d5 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form @@ -2,14 +2,14 @@
- + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index 9be4f0a615..e186617168 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -35,14 +35,14 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { // //GEN-BEGIN:initComponents private void initComponents() { - crFrequencyCheckbox = new javax.swing.JCheckBox(); + pastOccurrencesCheckbox = new javax.swing.JCheckBox(); crFrequencyScrollPane = new javax.swing.JScrollPane(); crFrequencyList = new javax.swing.JList<>(); - org.openide.awt.Mnemonics.setLocalizedText(crFrequencyCheckbox, org.openide.util.NbBundle.getMessage(PastOccurrencesFilterPanel.class, "PastOccurrencesFilterPanel.crFrequencyCheckbox.text")); // NOI18N - crFrequencyCheckbox.addActionListener(new java.awt.event.ActionListener() { + org.openide.awt.Mnemonics.setLocalizedText(pastOccurrencesCheckbox, org.openide.util.NbBundle.getMessage(PastOccurrencesFilterPanel.class, "PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text")); // NOI18N + pastOccurrencesCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - crFrequencyCheckboxActionPerformed(evt); + pastOccurrencesCheckboxActionPerformed(evt); } }); @@ -63,15 +63,15 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { ); }// //GEN-END:initComponents - private void crFrequencyCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crFrequencyCheckboxActionPerformed - crFrequencyList.setEnabled(crFrequencyCheckbox.isSelected()); - }//GEN-LAST:event_crFrequencyCheckboxActionPerformed + private void pastOccurrencesCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pastOccurrencesCheckboxActionPerformed + crFrequencyList.setEnabled(pastOccurrencesCheckbox.isSelected()); + }//GEN-LAST:event_pastOccurrencesCheckboxActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JCheckBox crFrequencyCheckbox; private javax.swing.JList crFrequencyList; private javax.swing.JScrollPane crFrequencyScrollPane; + private javax.swing.JCheckBox pastOccurrencesCheckbox; // End of variables declaration//GEN-END:variables @Override @@ -81,7 +81,7 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { @Override JCheckBox getCheckbox() { - return crFrequencyCheckbox; + return pastOccurrencesCheckbox; } @Override @@ -98,4 +98,12 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { JList getList() { return crFrequencyList; } + + @Override + FileSearchFiltering.FileFilter getFilter() { + if (pastOccurrencesCheckbox.isSelected()) { + return new FileSearchFiltering.FrequencyFilter(crFrequencyList.getSelectedValuesList()); + } + return null; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index f368371b18..2bdd591bb0 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -150,4 +150,12 @@ final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { JList getList() { return sizeList; } + + @Override + FileSearchFiltering.FileFilter getFilter() { + if (sizeCheckbox.isSelected()) { + return new FileSearchFiltering.SizeFilter(sizeList.getSelectedValuesList()); + } + return null; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java index f3074deace..ea07b5b757 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java @@ -78,4 +78,12 @@ public class UserCreatedFilterPanel extends AbstractDiscoveryFiltersPanel { JList getList() { return null; } + + @Override + FileSearchFiltering.FileFilter getFilter() { + if (userCreatedCheckbox.isSelected()) { + return new FileSearchFiltering.UserCreatedFilter(); + } + return null; + } } From fd630b59dc16847a3bc3ae9c3cf8545ec4e72801 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Mon, 18 May 2020 11:42:54 -0400 Subject: [PATCH 12/51] 6305 implement document and video panel --- .../discovery/AbstractFilterPanel.java | 27 ++++++-- .../discovery/Bundle.properties-MERGED | 1 - .../autopsy/discovery/DiscoveryDialog.java | 57 +++++++++++----- .../discovery/DocumentFilterPanel.form | 28 ++++++++ .../discovery/DocumentFilterPanel.java | 64 ++++++++++++++++++ .../autopsy/discovery/FileSearchPanel.java | 1 + .../autopsy/discovery/ImageFilterPanel.java | 56 +++++----------- .../discovery/PastOccurrencesFilterPanel.java | 12 +++- .../autopsy/discovery/VideoFilterPanel.form | 28 ++++++++ .../autopsy/discovery/VideoFilterPanel.java | 65 +++++++++++++++++++ 10 files changed, 277 insertions(+), 62 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form create mode 100644 Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java index 235a78a420..cfa6d4843b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java @@ -12,6 +12,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; /** * @@ -39,15 +41,27 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL constraints.anchor = GridBagConstraints.NORTHWEST; } - void addFilter(AbstractDiscoveryFiltersPanel filterPanel) { + void addFilter(AbstractDiscoveryFiltersPanel filterPanel, int[] indicesSelected) { + filterPanel.configurePanel(true, indicesSelected); + filterPanel.addListeners(this, new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent evt) { + if (!evt.getValueIsAdjusting()) { + validateFields(); + } + } + }); filters.add(filterPanel); + addToGridBagLayout(filterPanel.getCheckbox(), null); + addToGridBagLayout(filterPanel, null); + updateLayout(); } void clearFilters() { filters.clear(); } - final void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd) { + private void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd) { if (constraints.gridx % 2 == 0) { constraints.weightx = LABEL_WEIGHT; constraints.gridwidth = LABEL_WIDTH; @@ -71,7 +85,7 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL } } - final void updateLayout() { + private void updateLayout() { setLayout(layout); } @@ -81,18 +95,18 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL * * @param error */ - void setInvalid(String error) { + private void setInvalid(String error) { firePropertyChange("FilterError", error, error); } /** * The settings are valid so enable the Search button */ - void setValid() { + private void setValid() { firePropertyChange("FilterError", null, null); } - void validateFields() { + private void validateFields() { String errorString; for (AbstractDiscoveryFiltersPanel filterPanel : filters) { errorString = filterPanel.checkForError(); @@ -130,4 +144,5 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL } return filtersToUse; } + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index fd0eea5829..12bbf80636 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -183,7 +183,6 @@ ImageThumbnailPanel.isDeleted.text=All instances of file are deleted. # {0} - otherInstanceCount ImageThumbnailPanel.nameLabel.more.text=\ and {0} more OpenDiscoveryAction.resultsIncomplete.text=Results may be incomplete -PastOccurrencesFilterPanel.crFrequencyCheckbox.text=Past Occurrences: ResultFile.score.interestingResult.description=At least one instance of the file has an interesting result associated with it. ResultFile.score.notableFile.description=At least one instance of the file was recognized as notable. ResultFile.score.notableTaggedFile.description=At least one instance of the file is tagged with a notable tag. diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index e0eadc7d15..b1ae12120d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -33,11 +33,14 @@ final class DiscoveryDialog extends javax.swing.JDialog { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DiscoveryDialog.class.getName()); - private final FileSearchPanel filterPanel = new FileSearchPanel(); + private final ImageFilterPanel imageFilterPanel = new ImageFilterPanel(); + private final VideoFilterPanel videoFilterPanel = new VideoFilterPanel(); + private final DocumentFilterPanel documentFilterPanel = new DocumentFilterPanel(); private static final Color SELECTED_COLOR = new Color(216, 230, 242); private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); private SearchWorker searchWorker = null; private static DiscoveryDialog discoveryDialog; + private FileSearchData.FileType fileType = FileSearchData.FileType.IMAGE; private DiscoveryDialog() { this(null, true); @@ -56,7 +59,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { private DiscoveryDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); - filterPanel.addPropertyChangeListener(new PropertyChangeListener() { + PropertyChangeListener listener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getNewValue() instanceof String) { @@ -69,16 +72,18 @@ final class DiscoveryDialog extends javax.swing.JDialog { } } - }); + }; + imageFilterPanel.addPropertyChangeListener(listener); + videoFilterPanel.addPropertyChangeListener(listener); + documentFilterPanel.addPropertyChangeListener(listener); updateSearchSettings(); - add(filterPanel, CENTER); + } /** * Update the search settings to a default state. */ private void updateSearchSettings() { - filterPanel.resetPanel(); imagesButton.setSelected(true); imagesButton.setEnabled(false); imagesButton.setBackground(SELECTED_COLOR); @@ -89,7 +94,11 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); - filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); + fileType = FileSearchData.FileType.IMAGE; + remove(imageFilterPanel); + remove(videoFilterPanel); + remove(documentFilterPanel); + add(imageFilterPanel, CENTER); } /** @@ -226,6 +235,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { private void imagesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imagesButtonActionPerformed // resetTopComponent(); + remove(videoFilterPanel); + remove(documentFilterPanel); + add(imageFilterPanel, CENTER); imagesButton.setSelected(true); imagesButton.setEnabled(false); imagesButton.setBackground(SELECTED_COLOR); @@ -236,10 +248,13 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); - filterPanel.setSelectedType(FileSearchData.FileType.IMAGE); + fileType = FileSearchData.FileType.IMAGE; }//GEN-LAST:event_imagesButtonActionPerformed private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed + remove(imageFilterPanel); + remove(documentFilterPanel); + add(videoFilterPanel, CENTER); imagesButton.setSelected(false); imagesButton.setEnabled(true); imagesButton.setBackground(UNSELECTED_COLOR); @@ -250,10 +265,13 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); - filterPanel.setSelectedType(FileSearchData.FileType.VIDEO); + fileType = FileSearchData.FileType.VIDEO; }//GEN-LAST:event_videosButtonActionPerformed private void documentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_documentsButtonActionPerformed + remove(imageFilterPanel); + remove(documentFilterPanel); + add(documentFilterPanel, CENTER); documentsButton.setSelected(true); documentsButton.setEnabled(false); documentsButton.setBackground(SELECTED_COLOR); @@ -264,7 +282,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton.setSelected(false); imagesButton.setEnabled(true); imagesButton.setBackground(UNSELECTED_COLOR); - filterPanel.setSelectedType(FileSearchData.FileType.DOCUMENTS); + fileType = FileSearchData.FileType.DOCUMENTS; }//GEN-LAST:event_documentsButtonActionPerformed private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed @@ -279,15 +297,22 @@ final class DiscoveryDialog extends javax.swing.JDialog { tc.open(); } tc.resetTopComponent(); - List filters = filterPanel.getFilters(); - DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(filterPanel.getSelectedType())); + List filters; + if (videosButton.isSelected()) { + filters = videoFilterPanel.getFilters(); + } else if (documentsButton.isSelected()) { + filters = documentFilterPanel.getFilters(); + } else { + filters = imageFilterPanel.getFilters(); + } + DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(fileType)); // Get the grouping attribute and group sorting method - FileSearch.AttributeType groupingAttr = filterPanel.getGroupingAttribute(); - FileGroup.GroupSortingAlgorithm groupSortAlgorithm = filterPanel.getGroupSortingMethod(); + FileSearch.AttributeType groupingAttr = FileSearch.GroupingAttributeType.FILE_SIZE.getAttributeType(); + FileGroup.GroupSortingAlgorithm groupSortAlgorithm = FileGroup.GroupSortingAlgorithm.BY_GROUP_NAME; // Get the file sorting method - FileSorter.SortingMethod fileSort = filterPanel.getFileSortingMethod(); + FileSorter.SortingMethod fileSort = FileSorter.SortingMethod.BY_FILE_NAME; CentralRepository centralRepoDb = null; if (CentralRepository.isEnabled()) { try { @@ -310,7 +335,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { }//GEN-LAST:event_cancelButtonActionPerformed void cancelSearch() { - filterPanel.cancelSearch(); + if (searchWorker != null) { + searchWorker.cancel(true); + } } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form new file mode 100644 index 0000000000..4f9abb50dc --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java new file mode 100644 index 0000000000..73f8d389f1 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -0,0 +1,64 @@ +/* + * 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.discovery; + +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; + +/** + * + * @author wschaefer + */ +final class DocumentFilterPanel extends AbstractFilterPanel { + + private static final long serialVersionUID = 1L; + + /** + * Creates new form DocumentFilterPanel + */ + DocumentFilterPanel() { + initComponents(); + initConstraints(); + SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.DOCUMENTS); + addFilter(sizeFilterPanel, null); + addFilter(new DataSourceFilterPanel(), null); + int[] pastOccurrencesIndices; + if (!CentralRepository.isEnabled()) { + pastOccurrencesIndices = new int[]{0}; + } else { + pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; + } + addFilter(new PastOccurrencesFilterPanel(), pastOccurrencesIndices); + addFilter(new HashSetFilterPanel(), null); + addFilter(new InterestingItemsFilterPanel(), null); + addFilter(new ObjectDetectedFilterPanel(), null); + addFilter(new ParentFolderFilterPanel(), null); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java index 1fce33132c..c7a991fc9b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java @@ -36,6 +36,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.discovery.FileGroup.GroupSortingAlgorithm; import org.sleuthkit.autopsy.discovery.FileSearch.GroupingAttributeType; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index 1c62d061b7..c09b6b17b9 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -5,8 +5,7 @@ */ package org.sleuthkit.autopsy.discovery; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; /** * @@ -22,43 +21,22 @@ final class ImageFilterPanel extends AbstractFilterPanel { ImageFilterPanel() { initComponents(); initConstraints(); - addSizeFilter(); - addDataSourceFilter(); - } - - private void addDataSourceFilter() { - DataSourceFilterPanel dataSourceFilter = new DataSourceFilterPanel(); - dataSourceFilter.configurePanel(true, null); - dataSourceFilter.addListeners(this, new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent evt) { - if (!evt.getValueIsAdjusting()) { - validateFields(); - } - } - }); - addFilter(dataSourceFilter); - addToGridBagLayout(dataSourceFilter.getCheckbox(), null); - addToGridBagLayout(dataSourceFilter, null); - updateLayout(); - } - - private void addSizeFilter() { - SizeFilterPanel sizeFilter = new SizeFilterPanel(FileSearchData.FileType.IMAGE); - int[] indicesSelected = {1, 2, 3, 4, 5}; - sizeFilter.configurePanel(true, indicesSelected); - sizeFilter.addListeners(this, new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent evt) { - if (!evt.getValueIsAdjusting()) { - validateFields(); - } - } - }); - addFilter(sizeFilter); - addToGridBagLayout(sizeFilter.getCheckbox(), null); - addToGridBagLayout(sizeFilter, null); - updateLayout(); + SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.IMAGE); + int[] sizeIndicesSelected = {1, 2, 3, 4, 5}; + addFilter(sizeFilterPanel, sizeIndicesSelected); + addFilter(new DataSourceFilterPanel(), null); + int[] pastOccurrencesIndices; + if (!CentralRepository.isEnabled()) { + pastOccurrencesIndices = new int[]{0}; + } else { + pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; + } + addFilter(new PastOccurrencesFilterPanel(), pastOccurrencesIndices); + addFilter(new UserCreatedFilterPanel(), null); + addFilter(new HashSetFilterPanel(), null); + addFilter(new InterestingItemsFilterPanel(), null); + addFilter(new ObjectDetectedFilterPanel(), null); + addFilter(new ParentFolderFilterPanel(), null); } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index e186617168..b2aa93fc71 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -76,7 +76,17 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { @Override void configurePanel(boolean selected, int[] indicesSelected) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + pastOccurrencesCheckbox.setSelected(selected); + if (pastOccurrencesCheckbox.isEnabled() && pastOccurrencesCheckbox.isSelected()) { + crFrequencyScrollPane.setEnabled(true); + crFrequencyList.setEnabled(true); + if (indicesSelected != null) { + crFrequencyList.setSelectedIndices(indicesSelected); + } + } else { + crFrequencyScrollPane.setEnabled(false); + crFrequencyList.setEnabled(false); + } } @Override diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form new file mode 100644 index 0000000000..4f9abb50dc --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java new file mode 100644 index 0000000000..e8522a0852 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -0,0 +1,65 @@ +/* + * 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.discovery; + +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; + +/** + * + * @author wschaefer + */ +final class VideoFilterPanel extends AbstractFilterPanel { + + private static final long serialVersionUID = 1L; + + /** + * Creates new form VideoFilterPanel + */ + VideoFilterPanel() { + initComponents(); + initConstraints(); + SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.VIDEO); + addFilter(sizeFilterPanel, null); + addFilter(new DataSourceFilterPanel(), null); + int[] pastOccurrencesIndices; + if (!CentralRepository.isEnabled()) { + pastOccurrencesIndices = new int[]{0}; + } else { + pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; + } + addFilter(new PastOccurrencesFilterPanel(), pastOccurrencesIndices); + addFilter(new UserCreatedFilterPanel(), null); + addFilter(new HashSetFilterPanel(), null); + addFilter(new InterestingItemsFilterPanel(), null); + addFilter(new ObjectDetectedFilterPanel(), null); + addFilter(new ParentFolderFilterPanel(), null); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} From 531144fb3313b7a3f5d724d1f6f8e6f675880d52 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Mon, 18 May 2020 13:30:12 -0400 Subject: [PATCH 13/51] 6305 add back type filter --- .../discovery/AbstractFilterPanel.java | 16 +++++++----- .../discovery/DocumentFilterPanel.java | 21 ++++++++------- .../autopsy/discovery/FileSearchPanel.java | 1 - .../autopsy/discovery/ImageFilterPanel.java | 24 ++++++++++------- .../discovery/PastOccurrencesFilterPanel.java | 26 +++++++++++++++++-- .../autopsy/discovery/VideoFilterPanel.java | 22 +++++++++------- 6 files changed, 74 insertions(+), 36 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java index cfa6d4843b..8b973ba895 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java @@ -41,8 +41,10 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL constraints.anchor = GridBagConstraints.NORTHWEST; } - void addFilter(AbstractDiscoveryFiltersPanel filterPanel, int[] indicesSelected) { - filterPanel.configurePanel(true, indicesSelected); + abstract FileSearchData.FileType getFileType(); + + void addFilter(AbstractDiscoveryFiltersPanel filterPanel, boolean isSelected, int[] indicesSelected) { + filterPanel.configurePanel(isSelected, indicesSelected); filterPanel.addListeners(this, new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent evt) { @@ -135,11 +137,13 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL */ List getFilters() { List filtersToUse = new ArrayList<>(); - + filtersToUse.add(new FileSearchFiltering.FileTypeFilter(getFileType())); for (AbstractDiscoveryFiltersPanel filterPanel : filters) { - FileSearchFiltering.FileFilter filter = filterPanel.getFilter(); - if (filter != null) { - filtersToUse.add(filter); + if (filterPanel.getCheckbox().isSelected()) { + FileSearchFiltering.FileFilter filter = filterPanel.getFilter(); + if (filter != null) { + filtersToUse.add(filter); + } } } return filtersToUse; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index 73f8d389f1..e7bbf8a25d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -14,6 +14,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; final class DocumentFilterPanel extends AbstractFilterPanel { private static final long serialVersionUID = 1L; + private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.DOCUMENTS; /** * Creates new form DocumentFilterPanel @@ -22,19 +23,19 @@ final class DocumentFilterPanel extends AbstractFilterPanel { initComponents(); initConstraints(); SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.DOCUMENTS); - addFilter(sizeFilterPanel, null); - addFilter(new DataSourceFilterPanel(), null); + addFilter(sizeFilterPanel, false, null); + addFilter(new DataSourceFilterPanel(), false, null); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { pastOccurrencesIndices = new int[]{0}; } else { pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; } - addFilter(new PastOccurrencesFilterPanel(), pastOccurrencesIndices); - addFilter(new HashSetFilterPanel(), null); - addFilter(new InterestingItemsFilterPanel(), null); - addFilter(new ObjectDetectedFilterPanel(), null); - addFilter(new ParentFolderFilterPanel(), null); + addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices); + addFilter(new HashSetFilterPanel(), false, null); + addFilter(new InterestingItemsFilterPanel(), false, null); + addFilter(new ObjectDetectedFilterPanel(), false, null); + addFilter(new ParentFolderFilterPanel(), false, null); } /** @@ -57,8 +58,10 @@ final class DocumentFilterPanel extends AbstractFilterPanel { .addGap(0, 300, Short.MAX_VALUE) ); }// //GEN-END:initComponents - - + @Override + FileSearchData.FileType getFileType() { + return FILE_TYPE; + } // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java index c7a991fc9b..1fce33132c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java @@ -36,7 +36,6 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.discovery.FileGroup.GroupSortingAlgorithm; import org.sleuthkit.autopsy.discovery.FileSearch.GroupingAttributeType; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index c09b6b17b9..4009f7f614 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -14,6 +14,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; final class ImageFilterPanel extends AbstractFilterPanel { private static final long serialVersionUID = 1L; + private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.IMAGE; /** * Creates new form ImageFilterPanel @@ -21,22 +22,22 @@ final class ImageFilterPanel extends AbstractFilterPanel { ImageFilterPanel() { initComponents(); initConstraints(); - SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.IMAGE); + SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FILE_TYPE); int[] sizeIndicesSelected = {1, 2, 3, 4, 5}; - addFilter(sizeFilterPanel, sizeIndicesSelected); - addFilter(new DataSourceFilterPanel(), null); + addFilter(sizeFilterPanel, true, sizeIndicesSelected); + addFilter(new DataSourceFilterPanel(), false, null); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { pastOccurrencesIndices = new int[]{0}; } else { pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; } - addFilter(new PastOccurrencesFilterPanel(), pastOccurrencesIndices); - addFilter(new UserCreatedFilterPanel(), null); - addFilter(new HashSetFilterPanel(), null); - addFilter(new InterestingItemsFilterPanel(), null); - addFilter(new ObjectDetectedFilterPanel(), null); - addFilter(new ParentFolderFilterPanel(), null); + addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices); + addFilter(new UserCreatedFilterPanel(), false, null); + addFilter(new HashSetFilterPanel(), false, null); + addFilter(new InterestingItemsFilterPanel(), false, null); + addFilter(new ObjectDetectedFilterPanel(), false, null); + addFilter(new ParentFolderFilterPanel(), false, null); } /** @@ -51,6 +52,11 @@ final class ImageFilterPanel extends AbstractFilterPanel { setLayout(new java.awt.GridBagLayout()); }// //GEN-END:initComponents + @Override + FileSearchData.FileType getFileType() { + return FILE_TYPE; + } + // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index b2aa93fc71..53b9d5a252 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -9,6 +9,7 @@ import javax.swing.DefaultListModel; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JList; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; /** @@ -65,9 +66,27 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { private void pastOccurrencesCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pastOccurrencesCheckboxActionPerformed crFrequencyList.setEnabled(pastOccurrencesCheckbox.isSelected()); + setUpFrequencyFilter(); }//GEN-LAST:event_pastOccurrencesCheckboxActionPerformed - + /** + * Initialize the frequency filter + */ + private void setUpFrequencyFilter() { + int count = 0; + DefaultListModel frequencyListModel = (DefaultListModel) crFrequencyList.getModel(); + frequencyListModel.removeAllElements(); + if (!CentralRepository.isEnabled()) { + for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithoutCr()) { + frequencyListModel.add(count, freq); + } + } else { + for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithCr()) { + frequencyListModel.add(count, freq); + } + } + } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JList crFrequencyList; private javax.swing.JScrollPane crFrequencyScrollPane; @@ -101,7 +120,10 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { @Override String checkForError() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + if (pastOccurrencesCheckbox.isSelected() && crFrequencyList.getSelectedValuesList().isEmpty()) { + return "At least one CR frequency must be selected"; + } + return null; } @Override diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index e8522a0852..2d2f39223e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -14,6 +14,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; final class VideoFilterPanel extends AbstractFilterPanel { private static final long serialVersionUID = 1L; + private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.VIDEO; /** * Creates new form VideoFilterPanel @@ -22,20 +23,20 @@ final class VideoFilterPanel extends AbstractFilterPanel { initComponents(); initConstraints(); SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.VIDEO); - addFilter(sizeFilterPanel, null); - addFilter(new DataSourceFilterPanel(), null); + addFilter(sizeFilterPanel, true, null); + addFilter(new DataSourceFilterPanel(), false, null); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { pastOccurrencesIndices = new int[]{0}; } else { pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; } - addFilter(new PastOccurrencesFilterPanel(), pastOccurrencesIndices); - addFilter(new UserCreatedFilterPanel(), null); - addFilter(new HashSetFilterPanel(), null); - addFilter(new InterestingItemsFilterPanel(), null); - addFilter(new ObjectDetectedFilterPanel(), null); - addFilter(new ParentFolderFilterPanel(), null); + addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices); + addFilter(new UserCreatedFilterPanel(), false, null); + addFilter(new HashSetFilterPanel(), false, null); + addFilter(new InterestingItemsFilterPanel(), false, null); + addFilter(new ObjectDetectedFilterPanel(), false, null); + addFilter(new ParentFolderFilterPanel(), false, null); } /** @@ -58,7 +59,10 @@ final class VideoFilterPanel extends AbstractFilterPanel { .addGap(0, 300, Short.MAX_VALUE) ); }// //GEN-END:initComponents - + @Override + FileSearchData.FileType getFileType() { + return FILE_TYPE; + } // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables From 2cbbdce44ab9d388bc95e493c19c1ea47d5aeaeb Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 19 May 2020 12:13:12 -0400 Subject: [PATCH 14/51] 6305 fix past occurrences filter --- .../autopsy/discovery/PastOccurrencesFilterPanel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index 53b9d5a252..e5245c4a7f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -25,6 +25,7 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { */ public PastOccurrencesFilterPanel() { initComponents(); + setUpFrequencyFilter(); } /** @@ -66,10 +67,9 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { private void pastOccurrencesCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pastOccurrencesCheckboxActionPerformed crFrequencyList.setEnabled(pastOccurrencesCheckbox.isSelected()); - setUpFrequencyFilter(); }//GEN-LAST:event_pastOccurrencesCheckboxActionPerformed - /** + /** * Initialize the frequency filter */ private void setUpFrequencyFilter() { @@ -86,7 +86,7 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { } } } - + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JList crFrequencyList; private javax.swing.JScrollPane crFrequencyScrollPane; From 5b73e47a6167361fce7891c175a6473955496f74 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 21 May 2020 10:41:08 -0400 Subject: [PATCH 15/51] 6305 fix layout a bit for Discovery search UI --- .../discovery/AbstractFilterPanel.java | 35 ++++++++---- .../discovery/DataSourceFilterPanel.form | 12 +++- .../discovery/DataSourceFilterPanel.java | 8 ++- .../autopsy/discovery/DiscoveryDialog.form | 14 +++-- .../autopsy/discovery/DiscoveryDialog.java | 9 ++- .../discovery/DocumentFilterPanel.java | 2 +- .../autopsy/discovery/HashSetFilterPanel.form | 9 ++- .../autopsy/discovery/HashSetFilterPanel.java | 6 +- .../autopsy/discovery/ImageFilterPanel.form | 2 +- .../autopsy/discovery/ImageFilterPanel.java | 3 +- .../InterestingItemsFilterPanel.form | 9 ++- .../InterestingItemsFilterPanel.java | 6 +- .../discovery/ObjectDetectedFilterPanel.form | 12 +++- .../discovery/ObjectDetectedFilterPanel.java | 8 ++- .../discovery/ParentFolderFilterPanel.form | 57 ++++++++++--------- .../discovery/ParentFolderFilterPanel.java | 45 ++++++++------- .../discovery/PastOccurrencesFilterPanel.form | 12 +++- .../discovery/PastOccurrencesFilterPanel.java | 8 ++- .../autopsy/discovery/SizeFilterPanel.form | 11 +++- .../autopsy/discovery/SizeFilterPanel.java | 6 +- .../discovery/UserCreatedFilterPanel.form | 9 ++- .../discovery/UserCreatedFilterPanel.java | 6 +- .../autopsy/discovery/VideoFilterPanel.java | 2 +- 23 files changed, 192 insertions(+), 99 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java index 8b973ba895..1ab44b8218 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java @@ -8,6 +8,7 @@ package org.sleuthkit.autopsy.discovery; import java.awt.Component; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -21,6 +22,16 @@ import javax.swing.event.ListSelectionListener; */ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionListener { + AbstractFilterPanel() { + constraints.fill = GridBagConstraints.VERTICAL; + constraints.gridx = 0; + constraints.gridy = 0; + constraints.gridheight = 2; + constraints.gridwidth = LABEL_WIDTH; + constraints.weightx = LABEL_WEIGHT; + constraints.anchor = GridBagConstraints.NORTHWEST; + constraints.insets = new Insets(0, 8, 12, 8); + } private static final double LABEL_WEIGHT = 0; private static final double PANEL_WEIGHT = 0; private static final int LABEL_WIDTH = 1; @@ -31,16 +42,6 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL private final GridBagConstraints constraints = new GridBagConstraints(); private final List filters = new ArrayList<>(); - final void initConstraints() { - constraints.fill = GridBagConstraints.HORIZONTAL; - constraints.gridx = 0; - constraints.gridy = 0; - constraints.gridheight = 2; - constraints.gridwidth = LABEL_WIDTH; - constraints.weightx = LABEL_WEIGHT; - constraints.anchor = GridBagConstraints.NORTHWEST; - } - abstract FileSearchData.FileType getFileType(); void addFilter(AbstractDiscoveryFiltersPanel filterPanel, boolean isSelected, int[] indicesSelected) { @@ -56,9 +57,23 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL filters.add(filterPanel); addToGridBagLayout(filterPanel.getCheckbox(), null); addToGridBagLayout(filterPanel, null); + constraints.weightx = .9; + constraints.fill = GridBagConstraints.BOTH; + addToGridBagLayout(new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)), null); + constraints.fill = GridBagConstraints.VERTICAL; + constraints.weightx = LABEL_WEIGHT; updateLayout(); } + void endPanel() { + //add filler at end + constraints.gridy++; + constraints.fill = GridBagConstraints.BOTH; + constraints.weightx = .9; + constraints.weighty = .9; + add(new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767)), constraints); + } + void clearFilters() { filters.clear(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form index ad6bd7c576..3edf84398e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form @@ -13,6 +13,11 @@
+ + + + + @@ -28,12 +33,15 @@ - + - + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index 7e74d50d38..5319a3878b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -54,6 +54,8 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFiltersPanel { } }); + setPreferredSize(new java.awt.Dimension(300, 60)); + dataSourceList.setModel(new DefaultListModel()); dataSourceList.setEnabled(false); dataSourceList.setVisibleRowCount(5); @@ -63,11 +65,13 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(dataSourceScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) + .addComponent(dataSourceScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(dataSourceScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(dataSourceScrollPane) + .addGap(0, 0, 0)) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 5d22e3351d..8a39302910 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -3,6 +3,12 @@
+ + + + + + @@ -18,7 +24,7 @@ - + @@ -38,13 +44,13 @@ - + - + @@ -154,7 +160,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index b1ae12120d..f7cdb64582 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -99,6 +99,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { remove(videoFilterPanel); remove(documentFilterPanel); add(imageFilterPanel, CENTER); + pack(); } /** @@ -120,6 +121,8 @@ final class DiscoveryDialog extends javax.swing.JDialog { javax.swing.JButton cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setMinimumSize(new java.awt.Dimension(800, 600)); + setPreferredSize(new java.awt.Dimension(1000, 600)); imagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/pictures-icon.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(imagesButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.imagesButton.text")); // NOI18N @@ -166,13 +169,13 @@ final class DiscoveryDialog extends javax.swing.JDialog { toolBarPanelLayout.setHorizontalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap(98, Short.MAX_VALUE) + .addContainerGap(322, Short.MAX_VALUE) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(documentsButton) - .addContainerGap(87, Short.MAX_VALUE)) + .addContainerGap(313, Short.MAX_VALUE)) ); toolBarPanelLayout.setVerticalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -209,7 +212,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE) + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 828, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cancelButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index e7bbf8a25d..89201b8681 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -20,8 +20,8 @@ final class DocumentFilterPanel extends AbstractFilterPanel { * Creates new form DocumentFilterPanel */ DocumentFilterPanel() { + super(); initComponents(); - initConstraints(); SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.DOCUMENTS); addFilter(sizeFilterPanel, false, null); addFilter(new DataSourceFilterPanel(), false, null); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form index f81e9f814f..4e9c906685 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form @@ -13,6 +13,11 @@ + + + + + @@ -28,12 +33,12 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index b74f6650bc..5cd43a66c9 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -74,6 +74,8 @@ public class HashSetFilterPanel extends AbstractDiscoveryFiltersPanel { } }); + setPreferredSize(new java.awt.Dimension(300, 60)); + hashSetList.setModel(new DefaultListModel()); hashSetList.setEnabled(false); hashSetList.setVisibleRowCount(3); @@ -83,11 +85,11 @@ public class HashSetFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(hashSetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE) + .addComponent(hashSetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(hashSetScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(hashSetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form index 8458b286d7..3c39b407cb 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form @@ -11,7 +11,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index 4009f7f614..442c738eaf 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -20,8 +20,8 @@ final class ImageFilterPanel extends AbstractFilterPanel { * Creates new form ImageFilterPanel */ ImageFilterPanel() { + super(); initComponents(); - initConstraints(); SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FILE_TYPE); int[] sizeIndicesSelected = {1, 2, 3, 4, 5}; addFilter(sizeFilterPanel, true, sizeIndicesSelected); @@ -38,6 +38,7 @@ final class ImageFilterPanel extends AbstractFilterPanel { addFilter(new InterestingItemsFilterPanel(), false, null); addFilter(new ObjectDetectedFilterPanel(), false, null); addFilter(new ParentFolderFilterPanel(), false, null); + endPanel(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form index a3512b66f5..549a3a0a17 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form @@ -13,6 +13,11 @@ + + + + + @@ -28,12 +33,12 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java index 65915d2a43..c305d4e997 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java @@ -74,6 +74,8 @@ public class InterestingItemsFilterPanel extends AbstractDiscoveryFiltersPanel { } }); + setPreferredSize(new java.awt.Dimension(300, 60)); + interestingItemsList.setModel(new DefaultListModel()); interestingItemsList.setEnabled(false); interestingItemsList.setVisibleRowCount(2); @@ -83,11 +85,11 @@ public class InterestingItemsFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(interestingItemsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 491, Short.MAX_VALUE) + .addComponent(interestingItemsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(interestingItemsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(interestingItemsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form index ad4fb7938b..cd5b0421d1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form @@ -13,6 +13,11 @@ + + + + + @@ -28,12 +33,15 @@ - + + + + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java index aa53fbe00c..0b207c7d12 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java @@ -73,6 +73,8 @@ public class ObjectDetectedFilterPanel extends AbstractDiscoveryFiltersPanel { } }); + setPreferredSize(new java.awt.Dimension(300, 60)); + objectsList.setModel(new DefaultListModel()); objectsList.setEnabled(false); objectsList.setVisibleRowCount(2); @@ -82,11 +84,13 @@ public class ObjectDetectedFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(objectsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(objectsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 12, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(objectsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(objectsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form index b3b238dbeb..0cae8b6a91 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form @@ -20,6 +20,11 @@ + + + + + @@ -35,31 +40,29 @@ - - + + - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + + + + @@ -68,22 +71,22 @@ - + - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index cbf4e4dd96..89cb847a0d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -69,6 +69,8 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { org.openide.awt.Mnemonics.setLocalizedText(parentLabel, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.parentLabel.text_1")); // NOI18N + setPreferredSize(new java.awt.Dimension(314, 170)); + parentList.setModel(new DefaultListModel()); parentList.setEnabled(false); parentList.setVisibleRowCount(4); @@ -121,31 +123,30 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(0, 0, 0) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(8, 8, 8) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(fullRadioButton) - .addComponent(includeRadioButton)) - .addGap(31, 31, 31) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(excludeRadioButton) - .addGap(176, 176, 176) - .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(substringRadioButton))) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(parentScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 429, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addComponent(includeRadioButton) + .addComponent(fullRadioButton)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(substringRadioButton) + .addGroup(layout.createSequentialGroup() + .addComponent(excludeRadioButton) + .addGap(0, 0, Short.MAX_VALUE)))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(parentScrollPane, javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(parentScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(parentScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(fullRadioButton) @@ -157,8 +158,8 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form index 3b5ec6f5d5..9d052d67d8 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form @@ -13,6 +13,11 @@ + + + + + @@ -28,12 +33,15 @@ - + - + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index e5245c4a7f..2db4ea535f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -48,6 +48,8 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { } }); + setPreferredSize(new java.awt.Dimension(300, 60)); + crFrequencyList.setModel(new DefaultListModel()); crFrequencyList.setEnabled(false); crFrequencyList.setVisibleRowCount(5); @@ -57,11 +59,13 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(crFrequencyScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE) + .addComponent(crFrequencyScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(crFrequencyScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(crFrequencyScrollPane) + .addGap(0, 0, 0)) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form index de6233f517..433b653299 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form @@ -13,6 +13,11 @@ + + + + + @@ -28,14 +33,14 @@ - + - - + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index 2bdd591bb0..1d9039fc3a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -49,6 +49,8 @@ final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { } }); + setPreferredSize(new java.awt.Dimension(300, 60)); + sizeList.setModel(new DefaultListModel()); sizeList.setEnabled(false); sizeList.setVisibleRowCount(5); @@ -58,12 +60,12 @@ final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(sizeScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) + .addComponent(sizeScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(sizeScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(sizeScrollPane) .addGap(0, 0, 0)) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form index 3463d0c1ea..9ee6b00dfb 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form @@ -10,6 +10,11 @@ + + + + + @@ -25,12 +30,12 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java index ea07b5b757..64c9f593fd 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java @@ -37,15 +37,17 @@ public class UserCreatedFilterPanel extends AbstractDiscoveryFiltersPanel { org.openide.awt.Mnemonics.setLocalizedText(userCreatedCheckbox, org.openide.util.NbBundle.getMessage(UserCreatedFilterPanel.class, "UserCreatedFilterPanel.userCreatedCheckbox.text_1")); // NOI18N + setPreferredSize(new java.awt.Dimension(300, 42)); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 400, Short.MAX_VALUE) + .addGap(0, 300, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 300, Short.MAX_VALUE) + .addGap(0, 42, Short.MAX_VALUE) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index 2d2f39223e..365bbcfd4c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -20,8 +20,8 @@ final class VideoFilterPanel extends AbstractFilterPanel { * Creates new form VideoFilterPanel */ VideoFilterPanel() { + super(); initComponents(); - initConstraints(); SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.VIDEO); addFilter(sizeFilterPanel, true, null); addFilter(new DataSourceFilterPanel(), false, null); From cf89bc536d6c4723e8a1a802470c574b9fb284cd Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 22 May 2020 13:02:44 -0400 Subject: [PATCH 16/51] 6305 adjustments for UI to resize better --- ...java => AbstractDiscoveryFilterPanel.java} | 15 +- ...erPanel.java => AbstractFiltersPanel.java} | 124 +++++++++------ .../autopsy/discovery/Bundle.properties | 6 +- .../discovery/Bundle.properties-MERGED | 6 +- .../discovery/DataSourceFilterPanel.java | 2 +- .../autopsy/discovery/DiscoveryDialog.form | 147 ++++++++++++++++-- .../autopsy/discovery/DiscoveryDialog.java | 139 +++++++++++++++-- .../discovery/DocumentFilterPanel.form | 2 +- .../discovery/DocumentFilterPanel.java | 6 +- .../autopsy/discovery/HashSetFilterPanel.java | 2 +- .../autopsy/discovery/ImageFilterPanel.java | 8 +- .../InterestingItemsFilterPanel.java | 2 +- .../discovery/ObjectDetectedFilterPanel.form | 35 ++++- .../discovery/ObjectDetectedFilterPanel.java | 23 ++- .../discovery/ParentFolderFilterPanel.java | 8 +- .../discovery/PastOccurrencesFilterPanel.java | 2 +- .../autopsy/discovery/SizeFilterPanel.form | 23 ++- .../autopsy/discovery/SizeFilterPanel.java | 16 +- .../discovery/UserCreatedFilterPanel.java | 2 +- .../autopsy/discovery/VideoFilterPanel.form | 2 +- .../autopsy/discovery/VideoFilterPanel.java | 6 +- 21 files changed, 462 insertions(+), 114 deletions(-) rename Core/src/org/sleuthkit/autopsy/discovery/{AbstractDiscoveryFiltersPanel.java => AbstractDiscoveryFilterPanel.java} (76%) rename Core/src/org/sleuthkit/autopsy/discovery/{AbstractFilterPanel.java => AbstractFiltersPanel.java} (59%) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java similarity index 76% rename from Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java rename to Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java index 1e12f4e685..fa287b1bff 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java @@ -15,7 +15,7 @@ import javax.swing.event.ListSelectionListener; * * @author wschaefer */ -abstract class AbstractDiscoveryFiltersPanel extends javax.swing.JPanel { +abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; @@ -56,4 +56,17 @@ abstract class AbstractDiscoveryFiltersPanel extends javax.swing.JPanel { abstract FileSearchFiltering.FileFilter getFilter(); + void removeListeners() { + if (getCheckbox() != null) { + for (ActionListener listener : getCheckbox().getActionListeners()) { + getCheckbox().removeActionListener(listener); + } + } + if (getList() != null) { + for (ListSelectionListener listener : getList().getListSelectionListeners()) { + getList().removeListSelectionListener(listener); + } + } + } + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java similarity index 59% rename from Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java rename to Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 1ab44b8218..321eff09a1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -20,86 +20,88 @@ import javax.swing.event.ListSelectionListener; * * @author wschaefer */ -abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionListener { +abstract class AbstractFiltersPanel extends javax.swing.JPanel implements ActionListener, ListSelectionListener { - AbstractFilterPanel() { - constraints.fill = GridBagConstraints.VERTICAL; - constraints.gridx = 0; - constraints.gridy = 0; - constraints.gridheight = 2; - constraints.gridwidth = LABEL_WIDTH; - constraints.weightx = LABEL_WEIGHT; - constraints.anchor = GridBagConstraints.NORTHWEST; - constraints.insets = new Insets(0, 8, 12, 8); - } + private static boolean isInitialized = false; private static final double LABEL_WEIGHT = 0; - private static final double PANEL_WEIGHT = 0; + private static final double PANEL_WEIGHT = .1; private static final int LABEL_WIDTH = 1; private static final int PANEL_WIDTH = 2; private static final int NUMBER_OF_COLUMNS = 6; private static final long serialVersionUID = 1L; private final GridBagLayout layout = new GridBagLayout(); private final GridBagConstraints constraints = new GridBagConstraints(); - private final List filters = new ArrayList<>(); + private final List filters = new ArrayList<>(); abstract FileSearchData.FileType getFileType(); - void addFilter(AbstractDiscoveryFiltersPanel filterPanel, boolean isSelected, int[] indicesSelected) { + final synchronized void addFilter(AbstractDiscoveryFilterPanel filterPanel, boolean isSelected, int[] indicesSelected) { + if (!isInitialized) { + constraints.fill = GridBagConstraints.VERTICAL; + constraints.gridx = 0; + constraints.gridy = 0; + constraints.gridheight = 2; + constraints.gridwidth = LABEL_WIDTH; + constraints.weightx = LABEL_WEIGHT; + constraints.anchor = GridBagConstraints.NORTHWEST; + constraints.insets = new Insets(0, 8, 12, 8); + isInitialized = true; + } filterPanel.configurePanel(isSelected, indicesSelected); - filterPanel.addListeners(this, new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent evt) { - if (!evt.getValueIsAdjusting()) { - validateFields(); - } - } - }); - filters.add(filterPanel); - addToGridBagLayout(filterPanel.getCheckbox(), null); - addToGridBagLayout(filterPanel, null); - constraints.weightx = .9; - constraints.fill = GridBagConstraints.BOTH; - addToGridBagLayout(new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)), null); + filterPanel.addListeners(this, this); constraints.fill = GridBagConstraints.VERTICAL; + filters.add(filterPanel); constraints.weightx = LABEL_WEIGHT; + constraints.gridwidth = LABEL_WIDTH; + addToGridBagLayout(filterPanel.getCheckbox(), null); + nextSpot(LABEL_WIDTH); + constraints.fill = GridBagConstraints.BOTH; + constraints.weightx = PANEL_WEIGHT; + constraints.gridwidth = PANEL_WIDTH; + addToGridBagLayout(filterPanel, null); + nextSpot(PANEL_WIDTH); updateLayout(); } - void endPanel() { + private void nextSpot(int width) { + constraints.gridx += width; + if (constraints.gridx >= NUMBER_OF_COLUMNS) { + constraints.weightx = .9; + constraints.gridwidth = LABEL_WIDTH; + add(new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)), constraints); + constraints.fill = GridBagConstraints.VERTICAL; + constraints.gridy += constraints.gridheight; + constraints.gridx = 0; + } + } + + final synchronized void endPanel() { //add filler at end - constraints.gridy++; + constraints.gridy += constraints.gridheight; constraints.fill = GridBagConstraints.BOTH; constraints.weightx = .9; constraints.weighty = .9; add(new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767)), constraints); } - void clearFilters() { + final synchronized void clearFilters() { + for (AbstractDiscoveryFilterPanel filterPanel : filters){ + filterPanel.removeListeners(); + } filters.clear(); } private void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd) { - if (constraints.gridx % 2 == 0) { - constraints.weightx = LABEL_WEIGHT; - constraints.gridwidth = LABEL_WIDTH; - } else { - constraints.weightx = PANEL_WEIGHT; - constraints.gridwidth = PANEL_WIDTH; - } if (additionalComponentToAdd != null) { - constraints.gridheight = 1; + constraints.gridheight /= 2; add(componentToAdd, constraints); - constraints.gridy++; + constraints.gridy += constraints.gridheight; add(additionalComponentToAdd, constraints); - constraints.gridy--; - constraints.gridheight = 2; + constraints.gridy -= constraints.gridheight; + constraints.gridheight *= 2; } else { add(componentToAdd, constraints); } - constraints.gridx = (constraints.gridx + LABEL_WIDTH) % NUMBER_OF_COLUMNS; - if (constraints.gridx == 0) { - constraints.gridy += constraints.gridheight; - } } private void updateLayout() { @@ -113,6 +115,7 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL * @param error */ private void setInvalid(String error) { + System.out.println("ERROR FIRED " + error); firePropertyChange("FilterError", error, error); } @@ -120,26 +123,41 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL * The settings are valid so enable the Search button */ private void setValid() { + System.out.println("VALID FIRED"); firePropertyChange("FilterError", null, null); } private void validateFields() { String errorString; - for (AbstractDiscoveryFiltersPanel filterPanel : filters) { + System.out.println("VALIDATE FIELDS"); + for (AbstractDiscoveryFilterPanel filterPanel : filters) { errorString = filterPanel.checkForError(); if (errorString != null) { setInvalid(errorString); return; } + System.out.println("FILTER VALID"); } setValid(); } @Override public void actionPerformed(ActionEvent e) { + System.out.println("ACTION PERFORMED"); validateFields(); } + + boolean isObjectsFilterSupported(){ + return false; + } + boolean isHashSetFilterSupported(){ + return false; + } + + boolean isInterestingItemsFilterSupported(){ + return false; + } /** * Get a list of all filters selected by the user. * @@ -150,10 +168,10 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL * * @return the list of filters */ - List getFilters() { + synchronized List getFilters() { List filtersToUse = new ArrayList<>(); filtersToUse.add(new FileSearchFiltering.FileTypeFilter(getFileType())); - for (AbstractDiscoveryFiltersPanel filterPanel : filters) { + for (AbstractDiscoveryFilterPanel filterPanel : filters) { if (filterPanel.getCheckbox().isSelected()) { FileSearchFiltering.FileFilter filter = filterPanel.getFilter(); if (filter != null) { @@ -164,4 +182,12 @@ abstract class AbstractFilterPanel extends javax.swing.JPanel implements ActionL return filtersToUse; } + @Override + public void valueChanged(ListSelectionEvent evt) { + System.out.println("VALUE CHANGED"); + if (!evt.getValueIsAdjusting()) { + validateFields(); + } + } + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index fb326d2d47..91acce8122 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -73,7 +73,6 @@ UserCreatedFilterPanel.userCreatedCheckbox.text=Possibly User Created # and open the template in the editor. HashSetFilterPanel.hashSetCheckbox.text=Hash Set: InterestingItemFilterPanel.interestingItemsCheckbox.text=Interesting Item: -ObjectDetectedFilterPanel.objectsCheckbox.text=Object Detected: ParentFolderFilterPanel.parentCheckbox.text=Parent Folder: ParentFolderFilterPanel.deleteButton.text=Delete ParentFolderFilterPanel.excludeRadioButton.text=Exclude @@ -93,3 +92,8 @@ ParentFolderFilterPanel.parentLabel.text_1=(All will be used) InterestingItemsFilterPanel.interestingItemsCheckbox.text=Interesting Item: UserCreatedFilterPanel.userCreatedCheckbox.text_1=Possibly User Created PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text=Past Occurrences: +ObjectDetectedFilterPanel.text=Object Detected: +DiscoveryDialog.sortingPanel.border.title=Grouping +DiscoveryDialog.groupByLabel.text=Group By: +DiscoveryDialog.orderByLabel.text=Order Within Groups By: +DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 12bbf80636..1361d60a5b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -227,7 +227,6 @@ UserCreatedFilterPanel.userCreatedCheckbox.text=Possibly User Created # and open the template in the editor. HashSetFilterPanel.hashSetCheckbox.text=Hash Set: InterestingItemFilterPanel.interestingItemsCheckbox.text=Interesting Item: -ObjectDetectedFilterPanel.objectsCheckbox.text=Object Detected: ParentFolderFilterPanel.parentCheckbox.text=Parent Folder: ParentFolderFilterPanel.deleteButton.text=Delete ParentFolderFilterPanel.excludeRadioButton.text=Exclude @@ -247,6 +246,11 @@ ParentFolderFilterPanel.parentLabel.text_1=(All will be used) InterestingItemsFilterPanel.interestingItemsCheckbox.text=Interesting Item: UserCreatedFilterPanel.userCreatedCheckbox.text_1=Possibly User Created PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text=Past Occurrences: +ObjectDetectedFilterPanel.text=Object Detected: +DiscoveryDialog.sortingPanel.border.title=Grouping +DiscoveryDialog.groupByLabel.text=Group By: +DiscoveryDialog.orderByLabel.text=Order Within Groups By: +DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index 5319a3878b..84d7ef4656 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -21,7 +21,7 @@ import org.sleuthkit.datamodel.TskCoreException; * * @author wschaefer */ -final class DataSourceFilterPanel extends AbstractDiscoveryFiltersPanel { +final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DataSourceFilterPanel.class.getName()); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 8a39302910..3212106574 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -4,10 +4,10 @@ - + - + @@ -158,20 +158,26 @@ - + - - - - - + + + + + + + + + + - + + @@ -217,6 +223,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index f7cdb64582..80b25db6c7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -28,6 +28,9 @@ import org.apache.commons.lang.StringUtils; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.discovery.FileGroup.GroupSortingAlgorithm; +import org.sleuthkit.autopsy.discovery.FileSearch.GroupingAttributeType; +import org.sleuthkit.autopsy.discovery.FileSorter.SortingMethod; final class DiscoveryDialog extends javax.swing.JDialog { @@ -41,6 +44,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { private SearchWorker searchWorker = null; private static DiscoveryDialog discoveryDialog; private FileSearchData.FileType fileType = FileSearchData.FileType.IMAGE; + private final PropertyChangeListener listener; private DiscoveryDialog() { this(null, true); @@ -59,10 +63,12 @@ final class DiscoveryDialog extends javax.swing.JDialog { private DiscoveryDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); - PropertyChangeListener listener = new PropertyChangeListener() { + listener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { + System.out.println("PROPERTY CHANGE EVENT"); if (evt.getNewValue() instanceof String) { + System.out.println("IS A STRING"); String errorMessage = (String) evt.getNewValue(); if (StringUtils.isBlank(errorMessage)) { setValid(); @@ -73,11 +79,10 @@ final class DiscoveryDialog extends javax.swing.JDialog { } }; - imageFilterPanel.addPropertyChangeListener(listener); - videoFilterPanel.addPropertyChangeListener(listener); - documentFilterPanel.addPropertyChangeListener(listener); + for (GroupSortingAlgorithm groupSortAlgorithm : GroupSortingAlgorithm.values()) { + groupSortingComboBox.addItem(groupSortAlgorithm); + } updateSearchSettings(); - } /** @@ -97,9 +102,34 @@ final class DiscoveryDialog extends javax.swing.JDialog { fileType = FileSearchData.FileType.IMAGE; remove(imageFilterPanel); remove(videoFilterPanel); + videoFilterPanel.removePropertyChangeListener(listener); remove(documentFilterPanel); + documentFilterPanel.removePropertyChangeListener(listener); add(imageFilterPanel, CENTER); + imageFilterPanel.removePropertyChangeListener(listener); + imageFilterPanel.addPropertyChangeListener(listener); + groupByCombobox.removeAllItems(); + // Set up the grouping attributes + for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGrouping()) { + if ((type != GroupingAttributeType.FREQUENCY || CentralRepository.isEnabled()) + && (type != GroupingAttributeType.OBJECT_DETECTED || imageFilterPanel.isObjectsFilterSupported()) + && (type != GroupingAttributeType.INTERESTING_ITEM_SET || imageFilterPanel.isInterestingItemsFilterSupported()) + && (type != GroupingAttributeType.HASH_LIST_NAME || imageFilterPanel.isHashSetFilterSupported())) { + groupByCombobox.addItem(type); + } + } + + orderByCombobox.removeAllItems(); + // Set up the file order list + for (FileSorter.SortingMethod method : FileSorter.SortingMethod.getOptionsForOrdering()) { + if (method != SortingMethod.BY_FREQUENCY || CentralRepository.isEnabled()) { + orderByCombobox.addItem(method); + } + } + + groupSortingComboBox.setSelectedIndex(0); pack(); + repaint(); } /** @@ -119,10 +149,17 @@ final class DiscoveryDialog extends javax.swing.JDialog { searchButton = new javax.swing.JButton(); errorLabel = new javax.swing.JLabel(); javax.swing.JButton cancelButton = new javax.swing.JButton(); + javax.swing.JPanel sortingPanel = new javax.swing.JPanel(); + groupByCombobox = new javax.swing.JComboBox<>(); + orderByCombobox = new javax.swing.JComboBox<>(); + javax.swing.JLabel orderGroupsByLabel = new javax.swing.JLabel(); + javax.swing.JLabel orderByLabel = new javax.swing.JLabel(); + javax.swing.JLabel groupByLabel = new javax.swing.JLabel(); + groupSortingComboBox = new javax.swing.JComboBox<>(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setMinimumSize(new java.awt.Dimension(800, 600)); - setPreferredSize(new java.awt.Dimension(1000, 600)); + setMinimumSize(new java.awt.Dimension(1000, 300)); + setPreferredSize(new java.awt.Dimension(1200, 600)); imagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/pictures-icon.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(imagesButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.imagesButton.text")); // NOI18N @@ -206,23 +243,72 @@ final class DiscoveryDialog extends javax.swing.JDialog { } }); + sortingPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.sortingPanel.border.title"))); // NOI18N + sortingPanel.setPreferredSize(new java.awt.Dimension(345, 112)); + + org.openide.awt.Mnemonics.setLocalizedText(orderGroupsByLabel, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.orderGroupsByLabel.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(orderByLabel, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.orderByLabel.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(groupByLabel, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.groupByLabel.text")); // NOI18N + + javax.swing.GroupLayout sortingPanelLayout = new javax.swing.GroupLayout(sortingPanel); + sortingPanel.setLayout(sortingPanelLayout); + sortingPanelLayout.setHorizontalGroup( + sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(sortingPanelLayout.createSequentialGroup() + .addContainerGap() + .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(sortingPanelLayout.createSequentialGroup() + .addComponent(groupByLabel) + .addGap(88, 88, 88) + .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(groupSortingComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(groupByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(orderByLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(orderByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(orderGroupsByLabel)) + .addContainerGap()) + ); + sortingPanelLayout.setVerticalGroup( + sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(sortingPanelLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(groupByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(groupByLabel) + .addComponent(orderByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(orderByLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(groupSortingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(orderGroupsByLabel)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 828, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cancelButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(searchButton) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 976, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 828, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cancelButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(searchButton))) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) @@ -239,7 +325,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { private void imagesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imagesButtonActionPerformed // resetTopComponent(); remove(videoFilterPanel); + videoFilterPanel.removePropertyChangeListener(listener); remove(documentFilterPanel); + documentFilterPanel.removePropertyChangeListener(listener); add(imageFilterPanel, CENTER); imagesButton.setSelected(true); imagesButton.setEnabled(false); @@ -252,11 +340,16 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); fileType = FileSearchData.FileType.IMAGE; + imageFilterPanel.addPropertyChangeListener(listener); + pack(); + repaint(); }//GEN-LAST:event_imagesButtonActionPerformed private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed remove(imageFilterPanel); + imageFilterPanel.removePropertyChangeListener(listener); remove(documentFilterPanel); + documentFilterPanel.removePropertyChangeListener(listener); add(videoFilterPanel, CENTER); imagesButton.setSelected(false); imagesButton.setEnabled(true); @@ -268,13 +361,19 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setSelected(false); documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); + videoFilterPanel.addPropertyChangeListener(listener); fileType = FileSearchData.FileType.VIDEO; + pack(); + repaint(); }//GEN-LAST:event_videosButtonActionPerformed private void documentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_documentsButtonActionPerformed remove(imageFilterPanel); - remove(documentFilterPanel); + imageFilterPanel.removePropertyChangeListener(listener); + remove(videoFilterPanel); + videoFilterPanel.removePropertyChangeListener(listener); add(documentFilterPanel, CENTER); + documentFilterPanel.removePropertyChangeListener(listener); documentsButton.setSelected(true); documentsButton.setEnabled(false); documentsButton.setBackground(SELECTED_COLOR); @@ -286,6 +385,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton.setEnabled(true); imagesButton.setBackground(UNSELECTED_COLOR); fileType = FileSearchData.FileType.DOCUMENTS; + documentFilterPanel.addPropertyChangeListener(listener); + pack(); + repaint(); }//GEN-LAST:event_documentsButtonActionPerformed private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed @@ -347,6 +449,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { * The settings are valid so enable the Search button */ private void setValid() { + System.out.println("SET VALID"); errorLabel.setText(""); searchButton.setEnabled(true); } @@ -358,6 +461,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { * @param error */ private void setInvalid(String error) { + System.out.println("SET INVALID"); errorLabel.setText(error); searchButton.setEnabled(false); } @@ -365,8 +469,11 @@ final class DiscoveryDialog extends javax.swing.JDialog { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton documentsButton; private javax.swing.JLabel errorLabel; + private javax.swing.JComboBox groupByCombobox; + private javax.swing.JComboBox groupSortingComboBox; private javax.swing.JButton imagesButton; private javax.swing.JPanel jPanel1; + private javax.swing.JComboBox orderByCombobox; private javax.swing.JButton searchButton; private javax.swing.JButton videosButton; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form index 4f9abb50dc..5f3eab1a5f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form @@ -1,6 +1,6 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index 89201b8681..fa23484e14 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -11,7 +11,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; * * @author wschaefer */ -final class DocumentFilterPanel extends AbstractFilterPanel { +final class DocumentFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.DOCUMENTS; @@ -20,10 +20,8 @@ final class DocumentFilterPanel extends AbstractFilterPanel { * Creates new form DocumentFilterPanel */ DocumentFilterPanel() { - super(); initComponents(); - SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.DOCUMENTS); - addFilter(sizeFilterPanel, false, null); + addFilter(new SizeFilterPanel(FileSearchData.FileType.DOCUMENTS), false, null); addFilter(new DataSourceFilterPanel(), false, null); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index 5cd43a66c9..3ca2505799 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -20,7 +20,7 @@ import org.sleuthkit.datamodel.TskCoreException; * * @author wschaefer */ -public class HashSetFilterPanel extends AbstractDiscoveryFiltersPanel { +public class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(HashSetFilterPanel.class.getName()); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index 442c738eaf..0845407451 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -11,7 +11,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; * * @author wschaefer */ -final class ImageFilterPanel extends AbstractFilterPanel { +final class ImageFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.IMAGE; @@ -20,12 +20,11 @@ final class ImageFilterPanel extends AbstractFilterPanel { * Creates new form ImageFilterPanel */ ImageFilterPanel() { - super(); initComponents(); SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FILE_TYPE); int[] sizeIndicesSelected = {1, 2, 3, 4, 5}; addFilter(sizeFilterPanel, true, sizeIndicesSelected); - addFilter(new DataSourceFilterPanel(), false, null); + addFilter(new ObjectDetectedFilterPanel(), false, null); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { pastOccurrencesIndices = new int[]{0}; @@ -36,7 +35,8 @@ final class ImageFilterPanel extends AbstractFilterPanel { addFilter(new UserCreatedFilterPanel(), false, null); addFilter(new HashSetFilterPanel(), false, null); addFilter(new InterestingItemsFilterPanel(), false, null); - addFilter(new ObjectDetectedFilterPanel(), false, null); + + addFilter(new DataSourceFilterPanel(), false, null); addFilter(new ParentFolderFilterPanel(), false, null); endPanel(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java index c305d4e997..721e6ff486 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java @@ -20,7 +20,7 @@ import org.sleuthkit.datamodel.TskCoreException; * * @author wschaefer */ -public class InterestingItemsFilterPanel extends AbstractDiscoveryFiltersPanel { +public class InterestingItemsFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(InterestingItemsFilterPanel.class.getName()); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form index cd5b0421d1..0244e0ece0 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form @@ -5,8 +5,22 @@ - + + + + + + + + + + + + + + + @@ -14,6 +28,9 @@ + + + @@ -33,20 +50,26 @@ - - - - + - + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java index 0b207c7d12..1381869cc1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java @@ -20,7 +20,7 @@ import org.sleuthkit.datamodel.TskCoreException; * * @author wschaefer */ -public class ObjectDetectedFilterPanel extends AbstractDiscoveryFiltersPanel { +public class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(ObjectDetectedFilterPanel.class.getName()); @@ -66,15 +66,28 @@ public class ObjectDetectedFilterPanel extends AbstractDiscoveryFiltersPanel { objectsScrollPane = new javax.swing.JScrollPane(); objectsList = new javax.swing.JList<>(); - org.openide.awt.Mnemonics.setLocalizedText(objectsCheckbox, org.openide.util.NbBundle.getMessage(ObjectDetectedFilterPanel.class, "ObjectDetectedFilterPanel.objectsCheckbox.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(objectsCheckbox, org.openide.util.NbBundle.getMessage(ObjectDetectedFilterPanel.class, "ObjectDetectedFilterPanel.text")); // NOI18N + objectsCheckbox.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + objectsCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); + objectsCheckbox.setMaximumSize(new java.awt.Dimension(103, 25)); + objectsCheckbox.setMinimumSize(new java.awt.Dimension(103, 25)); + objectsCheckbox.setName(""); // NOI18N + objectsCheckbox.setPreferredSize(new java.awt.Dimension(103, 25)); + objectsCheckbox.setVerticalAlignment(javax.swing.SwingConstants.TOP); + objectsCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.TOP); objectsCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { objectsCheckboxActionPerformed(evt); } }); + setMinimumSize(new java.awt.Dimension(200, 30)); setPreferredSize(new java.awt.Dimension(300, 60)); + objectsScrollPane.setMinimumSize(new java.awt.Dimension(0, 0)); + objectsScrollPane.setName(""); // NOI18N + objectsScrollPane.setPreferredSize(new java.awt.Dimension(260, 50)); + objectsList.setModel(new DefaultListModel()); objectsList.setEnabled(false); objectsList.setVisibleRowCount(2); @@ -84,13 +97,11 @@ public class ObjectDetectedFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(objectsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 12, Short.MAX_VALUE)) + .addComponent(objectsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(objectsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE) + .addComponent(objectsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index 89cb847a0d..5613e666ae 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -17,11 +17,12 @@ import org.sleuthkit.autopsy.discovery.FileSearchFiltering.ParentSearchTerm; * * @author wschaefer */ -public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { +public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private DefaultListModel parentListModel; - + private static final String[] DEFAULT_IGNORED_PATHS = {"/Windows/", "/Program Files/"}; //NON-NLS + /** * Creates new form ParentFolderFilterPanel */ @@ -37,6 +38,9 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFiltersPanel { fullRadioButton.setSelected(true); includeRadioButton.setSelected(true); parentListModel = (DefaultListModel) parentList.getModel(); + for (String ignorePath : DEFAULT_IGNORED_PATHS) { + parentListModel.add(parentListModel.size(), new ParentSearchTerm(ignorePath, false, false)); + } } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index 2db4ea535f..8014444108 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -16,7 +16,7 @@ import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; * * @author wschaefer */ -public class PastOccurrencesFilterPanel extends AbstractDiscoveryFiltersPanel { +public class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form index 433b653299..d3a628f715 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form @@ -7,6 +7,19 @@ + + + + + + + + + + + + + @@ -14,6 +27,9 @@ + + + @@ -33,7 +49,7 @@ - + @@ -47,6 +63,11 @@ + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index 1d9039fc3a..27ca9feb64 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -17,7 +17,7 @@ import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; * * @author wschaefer */ -final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { +final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; @@ -43,14 +43,24 @@ final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { sizeList = new javax.swing.JList<>(); org.openide.awt.Mnemonics.setLocalizedText(sizeCheckbox, org.openide.util.NbBundle.getMessage(SizeFilterPanel.class, "SizeFilterPanel.sizeCheckbox.text")); // NOI18N + sizeCheckbox.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + sizeCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); + sizeCheckbox.setMaximumSize(new java.awt.Dimension(103, 25)); + sizeCheckbox.setMinimumSize(new java.awt.Dimension(103, 25)); + sizeCheckbox.setPreferredSize(new java.awt.Dimension(103, 25)); + sizeCheckbox.setVerticalAlignment(javax.swing.SwingConstants.TOP); + sizeCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.TOP); sizeCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { sizeCheckboxActionPerformed(evt); } }); + setMinimumSize(new java.awt.Dimension(200, 30)); setPreferredSize(new java.awt.Dimension(300, 60)); + sizeScrollPane.setPreferredSize(new java.awt.Dimension(300, 60)); + sizeList.setModel(new DefaultListModel()); sizeList.setEnabled(false); sizeList.setVisibleRowCount(5); @@ -60,12 +70,12 @@ final class SizeFilterPanel extends AbstractDiscoveryFiltersPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(sizeScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(sizeScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(sizeScrollPane) + .addComponent(sizeScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0)) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java index 64c9f593fd..bf4ffde7be 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java @@ -13,7 +13,7 @@ import javax.swing.JList; * * @author wschaefer */ -public class UserCreatedFilterPanel extends AbstractDiscoveryFiltersPanel { +public class UserCreatedFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form index 4f9abb50dc..5f3eab1a5f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form @@ -1,6 +1,6 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index 365bbcfd4c..79df6ec5a4 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -11,7 +11,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; * * @author wschaefer */ -final class VideoFilterPanel extends AbstractFilterPanel { +final class VideoFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.VIDEO; @@ -20,10 +20,8 @@ final class VideoFilterPanel extends AbstractFilterPanel { * Creates new form VideoFilterPanel */ VideoFilterPanel() { - super(); initComponents(); - SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FileSearchData.FileType.VIDEO); - addFilter(sizeFilterPanel, true, null); + addFilter(new SizeFilterPanel(FileSearchData.FileType.VIDEO), true, null); addFilter(new DataSourceFilterPanel(), false, null); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { From 620355db2df0afb30b0f230ecbea32a20eb77c3d Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 22 May 2020 13:09:44 -0400 Subject: [PATCH 17/51] 6305 hook up sorting algorithms correctly --- .../org/sleuthkit/autopsy/discovery/DiscoveryDialog.form | 3 --- .../org/sleuthkit/autopsy/discovery/DiscoveryDialog.java | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 3212106574..f96d1c6eab 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -6,9 +6,6 @@ - - - diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 80b25db6c7..954c4c8ebd 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -401,6 +401,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { if (tc.isOpened() == false) { tc.open(); } + tc.resetTopComponent(); List filters; if (videosButton.isSelected()) { @@ -413,11 +414,11 @@ final class DiscoveryDialog extends javax.swing.JDialog { DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.SearchStartedEvent(fileType)); // Get the grouping attribute and group sorting method - FileSearch.AttributeType groupingAttr = FileSearch.GroupingAttributeType.FILE_SIZE.getAttributeType(); - FileGroup.GroupSortingAlgorithm groupSortAlgorithm = FileGroup.GroupSortingAlgorithm.BY_GROUP_NAME; + FileSearch.AttributeType groupingAttr = groupByCombobox.getItemAt(groupByCombobox.getSelectedIndex()).getAttributeType(); + FileGroup.GroupSortingAlgorithm groupSortAlgorithm = groupSortingComboBox.getItemAt(groupSortingComboBox.getSelectedIndex()); // Get the file sorting method - FileSorter.SortingMethod fileSort = FileSorter.SortingMethod.BY_FILE_NAME; + FileSorter.SortingMethod fileSort = (FileSorter.SortingMethod) orderByCombobox.getSelectedItem(); CentralRepository centralRepoDb = null; if (CentralRepository.isEnabled()) { try { From 9cb01449ef4bff0469fe25662c34215f47e07a7a Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 22 May 2020 13:26:17 -0400 Subject: [PATCH 18/51] 6305 remove old filesearchpanel --- .../discovery/AbstractFiltersPanel.java | 39 +- .../autopsy/discovery/DiscoveryDialog.form | 15 +- .../autopsy/discovery/DiscoveryDialog.java | 10 +- .../autopsy/discovery/FileSearchPanel.form | 941 -------- .../autopsy/discovery/FileSearchPanel.java | 1918 ----------------- .../autopsy/discovery/ImageFilterPanel.java | 2 - 6 files changed, 36 insertions(+), 2889 deletions(-) delete mode 100644 Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form delete mode 100644 Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 321eff09a1..10ff50c49a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -66,26 +66,15 @@ abstract class AbstractFiltersPanel extends javax.swing.JPanel implements Action private void nextSpot(int width) { constraints.gridx += width; if (constraints.gridx >= NUMBER_OF_COLUMNS) { - constraints.weightx = .9; - constraints.gridwidth = LABEL_WIDTH; - add(new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)), constraints); constraints.fill = GridBagConstraints.VERTICAL; constraints.gridy += constraints.gridheight; constraints.gridx = 0; } } - final synchronized void endPanel() { - //add filler at end - constraints.gridy += constraints.gridheight; - constraints.fill = GridBagConstraints.BOTH; - constraints.weightx = .9; - constraints.weighty = .9; - add(new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767)), constraints); - } final synchronized void clearFilters() { - for (AbstractDiscoveryFilterPanel filterPanel : filters){ + for (AbstractDiscoveryFilterPanel filterPanel : filters) { filterPanel.removeListeners(); } filters.clear(); @@ -146,18 +135,34 @@ abstract class AbstractFiltersPanel extends javax.swing.JPanel implements Action System.out.println("ACTION PERFORMED"); validateFields(); } - - boolean isObjectsFilterSupported(){ + + boolean isObjectsFilterSupported() { + for (AbstractDiscoveryFilterPanel filter : filters) { + if (filter instanceof ObjectDetectedFilterPanel) { + return filter.getList().getModel().getSize() > 0; + } + } return false; } - boolean isHashSetFilterSupported(){ + boolean isHashSetFilterSupported() { + for (AbstractDiscoveryFilterPanel filter : filters) { + if (filter instanceof HashSetFilterPanel) { + return filter.getList().getModel().getSize() > 0; + } + } return false; } - - boolean isInterestingItemsFilterSupported(){ + + boolean isInterestingItemsFilterSupported() { + for (AbstractDiscoveryFilterPanel filter : filters) { + if (filter instanceof InterestingItemsFilterPanel) { + return filter.getList().getModel().getSize() > 0; + } + } return false; } + /** * Get a list of all filters selected by the user. * diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index f96d1c6eab..a026c51818 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -4,7 +4,10 @@ - + + + + @@ -21,7 +24,7 @@ - + @@ -41,13 +44,13 @@ - + - + @@ -158,9 +161,9 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 954c4c8ebd..796374c3e6 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -158,7 +158,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { groupSortingComboBox = new javax.swing.JComboBox<>(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setMinimumSize(new java.awt.Dimension(1000, 300)); + setMinimumSize(new java.awt.Dimension(600, 300)); setPreferredSize(new java.awt.Dimension(1200, 600)); imagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/pictures-icon.png"))); // NOI18N @@ -206,13 +206,13 @@ final class DiscoveryDialog extends javax.swing.JDialog { toolBarPanelLayout.setHorizontalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap(322, Short.MAX_VALUE) + .addContainerGap(239, Short.MAX_VALUE) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(documentsButton) - .addContainerGap(313, Short.MAX_VALUE)) + .addContainerGap(230, Short.MAX_VALUE)) ); toolBarPanelLayout.setVerticalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -295,9 +295,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 976, Short.MAX_VALUE) + .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 828, Short.MAX_VALUE) + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 662, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cancelButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form deleted file mode 100644 index e2c333ba66..0000000000 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.form +++ /dev/null @@ -1,941 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java deleted file mode 100644 index 1fce33132c..0000000000 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchPanel.java +++ /dev/null @@ -1,1918 +0,0 @@ -/* - * Autopsy - * - * Copyright 2019-2020 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.discovery; - -import com.google.common.eventbus.Subscribe; -import java.awt.Cursor; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.logging.Level; -import java.util.stream.Collectors; -import javax.swing.DefaultListCellRenderer; -import javax.swing.DefaultListModel; -import javax.swing.JCheckBox; -import javax.swing.JList; -import javax.swing.SwingUtilities; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import org.openide.util.NbBundle; -import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.discovery.FileGroup.GroupSortingAlgorithm; -import org.sleuthkit.autopsy.discovery.FileSearch.GroupingAttributeType; -import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; -import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; -import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; -import org.sleuthkit.autopsy.discovery.FileSearchData.Score; -import org.sleuthkit.autopsy.discovery.FileSearchFiltering.ParentSearchTerm; -import org.sleuthkit.autopsy.discovery.FileSorter.SortingMethod; -import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.BlackboardAttribute; -import org.sleuthkit.datamodel.TskCoreException; -import org.sleuthkit.datamodel.DataSource; -import org.sleuthkit.datamodel.TagName; -import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; - -/** - * Dialog to allow the user to choose filtering and grouping options. - */ -final class FileSearchPanel extends javax.swing.JPanel implements ActionListener { - - private static final long serialVersionUID = 1L; - private static final String[] DEFAULT_IGNORED_PATHS = {"/Windows/", "/Program Files/"}; //NON-NLS - private final static Logger logger = Logger.getLogger(FileSearchPanel.class.getName()); - private FileType fileType = FileType.IMAGE; - private DefaultListModel parentListModel; - private SearchWorker searchWorker = null; - - /** - * Creates new form FileSearchDialog - */ - @NbBundle.Messages({"FileSearchPanel.dialogTitle.text=Test file search"}) - FileSearchPanel() { - initComponents(); - for (GroupSortingAlgorithm groupSortAlgorithm : GroupSortingAlgorithm.values()) { - groupSortingComboBox.addItem(groupSortAlgorithm); - } - parentListModel = (DefaultListModel) parentList.getModel(); - for (String ignorePath : DEFAULT_IGNORED_PATHS) { - parentListModel.add(parentListModel.size(), new ParentSearchTerm(ignorePath, false, false)); - } - } - - /** - * Setup the data source filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void dataSourceFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - dataSourceCheckbox.setVisible(visible); - dataSourceScrollPane.setVisible(visible); - dataSourceList.setVisible(visible); - dataSourceCheckbox.setEnabled(enabled); - dataSourceCheckbox.setSelected(selected); - if (dataSourceCheckbox.isEnabled() && dataSourceCheckbox.isSelected()) { - dataSourceScrollPane.setEnabled(true); - dataSourceList.setEnabled(true); - if (indicesSelected != null) { - dataSourceList.setSelectedIndices(indicesSelected); - } - } else { - dataSourceScrollPane.setEnabled(false); - dataSourceList.setEnabled(false); - } - } - - /** - * Setup the file size filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void sizeFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - sizeCheckbox.setVisible(visible); - sizeScrollPane.setVisible(visible); - sizeList.setVisible(visible); - sizeCheckbox.setEnabled(enabled); - sizeCheckbox.setSelected(selected); - if (sizeCheckbox.isEnabled() && sizeCheckbox.isSelected()) { - sizeScrollPane.setEnabled(true); - sizeList.setEnabled(true); - if (indicesSelected != null) { - sizeList.setSelectedIndices(indicesSelected); - } - } else { - sizeScrollPane.setEnabled(false); - sizeList.setEnabled(false); - } - } - - /** - * Setup the central repository frequency filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void crFrequencyFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - crFrequencyCheckbox.setVisible(visible); - crFrequencyScrollPane.setVisible(visible); - crFrequencyList.setVisible(visible); - crFrequencyCheckbox.setEnabled(enabled); - crFrequencyCheckbox.setSelected(selected); - if (crFrequencyCheckbox.isEnabled() && crFrequencyCheckbox.isSelected()) { - crFrequencyScrollPane.setEnabled(true); - crFrequencyList.setEnabled(true); - if (indicesSelected != null) { - crFrequencyList.setSelectedIndices(indicesSelected); - } - } else { - crFrequencyScrollPane.setEnabled(false); - crFrequencyList.setEnabled(false); - } - } - - /** - * Setup the objects filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void objectsFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - objectsCheckbox.setVisible(visible); - objectsScrollPane.setVisible(visible); - objectsList.setVisible(visible); - boolean hasObjects = objectsList.getModel().getSize() > 0; - objectsCheckbox.setEnabled(enabled && hasObjects); - objectsCheckbox.setSelected(selected && hasObjects); - if (objectsCheckbox.isEnabled() && objectsCheckbox.isSelected()) { - objectsScrollPane.setEnabled(true); - objectsList.setEnabled(true); - if (indicesSelected != null) { - objectsList.setSelectedIndices(indicesSelected); - } - } else { - objectsScrollPane.setEnabled(false); - objectsList.setEnabled(false); - } - } - - /** - * Setup the hash set filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void hashSetFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - hashSetCheckbox.setVisible(visible); - hashSetScrollPane.setVisible(visible); - hashSetList.setVisible(visible); - boolean hasHashSets = hashSetList.getModel().getSize() > 0; - hashSetCheckbox.setEnabled(enabled && hasHashSets); - hashSetCheckbox.setSelected(selected && hasHashSets); - if (hashSetCheckbox.isEnabled() && hashSetCheckbox.isSelected()) { - hashSetScrollPane.setEnabled(true); - hashSetList.setEnabled(true); - if (indicesSelected != null) { - hashSetList.setSelectedIndices(indicesSelected); - } - } else { - hashSetScrollPane.setEnabled(false); - hashSetList.setEnabled(false); - } - } - - /** - * Setup the interesting items filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void interestingItemsFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - interestingItemsCheckbox.setVisible(visible); - interestingItemsScrollPane.setVisible(visible); - interestingItemsList.setVisible(visible); - boolean hasInterestingItems = interestingItemsList.getModel().getSize() > 0; - interestingItemsCheckbox.setEnabled(enabled && hasInterestingItems); - interestingItemsCheckbox.setSelected(selected && hasInterestingItems); - if (interestingItemsCheckbox.isEnabled() && interestingItemsCheckbox.isSelected()) { - interestingItemsScrollPane.setEnabled(true); - interestingItemsList.setEnabled(true); - if (indicesSelected != null) { - interestingItemsList.setSelectedIndices(indicesSelected); - } - } else { - interestingItemsScrollPane.setEnabled(false); - interestingItemsList.setEnabled(false); - } - } - - /** - * Setup the score filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void scoreFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - scoreCheckbox.setVisible(visible); - scoreScrollPane.setVisible(visible); - scoreList.setVisible(visible); - scoreCheckbox.setEnabled(enabled); - scoreCheckbox.setSelected(selected); - if (scoreCheckbox.isEnabled() && scoreCheckbox.isSelected()) { - scoreScrollPane.setEnabled(true); - scoreList.setEnabled(true); - if (indicesSelected != null) { - scoreList.setSelectedIndices(indicesSelected); - } - } else { - scoreScrollPane.setEnabled(false); - scoreList.setEnabled(false); - } - } - - /** - * Setup the parent path filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void parentFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - parentCheckbox.setVisible(visible); - parentScrollPane.setVisible(visible); - parentList.setVisible(visible); - parentCheckbox.setEnabled(enabled); - parentCheckbox.setSelected(selected); - if (parentCheckbox.isEnabled() && parentCheckbox.isSelected()) { - parentScrollPane.setEnabled(true); - includeRadioButton.setEnabled(true); - excludeRadioButton.setEnabled(true); - fullRadioButton.setEnabled(true); - substringRadioButton.setEnabled(true); - addButton.setEnabled(true); - deleteButton.setEnabled(!parentListModel.isEmpty()); - parentList.setEnabled(true); - parentTextField.setEnabled(true); - if (indicesSelected != null) { - parentList.setSelectedIndices(indicesSelected); - } - } else { - parentScrollPane.setEnabled(false); - parentList.setEnabled(false); - includeRadioButton.setEnabled(false); - excludeRadioButton.setEnabled(false); - fullRadioButton.setEnabled(false); - substringRadioButton.setEnabled(false); - addButton.setEnabled(false); - deleteButton.setEnabled(false); - parentTextField.setEnabled(false); - } - } - - /** - * Setup the tags filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void tagsFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - tagsCheckbox.setVisible(visible); - tagsScrollPane.setVisible(visible); - tagsList.setVisible(visible); - tagsCheckbox.setEnabled(enabled); - tagsCheckbox.setSelected(selected); - if (tagsCheckbox.isEnabled() && tagsCheckbox.isSelected()) { - tagsScrollPane.setEnabled(true); - tagsList.setEnabled(true); - if (indicesSelected != null) { - tagsList.setSelectedIndices(indicesSelected); - } - } else { - tagsScrollPane.setEnabled(false); - tagsList.setEnabled(false); - } - } - - /** - * Setup the keyword filter settings. - * - * @param visible Boolean indicating if the filter should be - * visible. - * @param enabled Boolean indicating if the filter should be - * enabled. - * @param selected Boolean indicating if the filter should be - * selected. - * @param indicesSelected Array of integers indicating which list items are - * selected, null to indicate leaving selected items - * unchanged. - */ - private void keywordFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { - keywordCheckbox.setVisible(visible); - keywordScrollPane.setVisible(visible); - keywordList.setVisible(visible); - keywordCheckbox.setEnabled(enabled); - keywordCheckbox.setSelected(selected); - if (keywordCheckbox.isEnabled() && keywordCheckbox.isSelected()) { - keywordScrollPane.setEnabled(true); - keywordList.setEnabled(true); - if (indicesSelected != null) { - keywordList.setSelectedIndices(indicesSelected); - } - } else { - keywordScrollPane.setEnabled(false); - keywordList.setEnabled(false); - } - } - - /** - * Setup the user created filter settings. - * - * @param visible Boolean indicating if the filter should be visible. - * @param enabled Boolean indicating if the filter should be enabled. - * @param selected Boolean indicating if the filter should be selected. - */ - private void userCreatedFilterSettings(boolean visible, boolean enabled, boolean selected) { - userCreatedCheckbox.setVisible(visible); - userCreatedCheckbox.setEnabled(enabled); - userCreatedCheckbox.setSelected(selected); - } - - /** - * Setup the known status filter settings. - * - * @param visible Boolean indicating if the filter should be visible. - * @param enabled Boolean indicating if the filter should be enabled. - * @param selected Boolean indicating if the filter should be selected. - */ - private void knownFilesFilterSettings(boolean visible, boolean enabled, boolean selected) { - knownFilesCheckbox.setVisible(visible); - knownFilesCheckbox.setEnabled(enabled); - knownFilesCheckbox.setSelected(selected); - } - - /** - * Setup the notable filter settings. - * - * @param visible Boolean indicating if the filter should be visible. - * @param enabled Boolean indicating if the filter should be enabled. - * @param selected Boolean indicating if the filter should be selected. - */ - private void notableFilterSettings(boolean visible, boolean enabled, boolean selected) { - notableCheckbox.setVisible(visible); - notableCheckbox.setEnabled(enabled); - notableCheckbox.setSelected(selected); - } - - /** - * Set the UI elements available to be the set of UI elements available when - * an Image search is being performed. - * - * @param enabled Boolean indicating if the filters present for images - * should be enabled. - * @param resetSelected Boolean indicating if selection of the filters - * present for images should be reset to their default - * status. - */ - @NbBundle.Messages({"FileSearchPanel.steptwo.images=Step 2: Filter which images to show"}) - private void imagesSelected(boolean enabled, boolean resetSelected) { - stepTwoLabel.setText(Bundle.FileSearchPanel_steptwo_images()); - dataSourceFilterSettings(true, enabled, !resetSelected && dataSourceCheckbox.isSelected(), null); - int[] selectedSizeIndices = {1, 2, 3, 4, 5}; - sizeFilterSettings(true, enabled, resetSelected || sizeCheckbox.isSelected(), resetSelected == true ? selectedSizeIndices : null); - int[] selectedFrequencyIndices; - if (!CentralRepository.isEnabled()) { - selectedFrequencyIndices = new int[]{0}; - } else { - selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; - } - crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null); - userCreatedFilterSettings(true, enabled, !resetSelected && userCreatedCheckbox.isSelected()); - objectsFilterSettings(true, enabled, !resetSelected && objectsCheckbox.isSelected(), null); - hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null); - interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null); - parentFilterSettings(true, enabled, !resetSelected && parentCheckbox.isSelected(), null); - scoreFilterSettings(false, false, false, null); - tagsFilterSettings(false, false, false, null); - keywordFilterSettings(false, false, false, null); - knownFilesFilterSettings(false, false, false); - notableFilterSettings(false, false, false); - } - - /** - * Set the UI elements available to be the set of UI elements available when - * a Video search is being performed. - * - * @param enabled Boolean indicating if the filters present for videos - * should be enabled. - * @param resetSelected Boolean indicating if selection of the filters - * present for videos should be reset to their default - * status. - */ - @NbBundle.Messages({"FileSearchPanel.steptwo.videos=Step 2: Filter which videos to show"}) - private void videosSelected(boolean enabled, boolean resetSelected) { - stepTwoLabel.setText(Bundle.FileSearchPanel_steptwo_videos()); - dataSourceFilterSettings(true, enabled, !resetSelected && dataSourceCheckbox.isSelected(), null); - sizeFilterSettings(true, enabled, !resetSelected && sizeCheckbox.isSelected(), null); - int[] selectedFrequencyIndices; - if (!CentralRepository.isEnabled()) { - selectedFrequencyIndices = new int[]{0}; - } else { - selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; - } - crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null); - userCreatedFilterSettings(true, enabled, !resetSelected && userCreatedCheckbox.isSelected()); - objectsFilterSettings(true, enabled, !resetSelected && objectsCheckbox.isSelected(), null); - hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null); - interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null); - parentFilterSettings(true, enabled, !resetSelected && parentCheckbox.isSelected(), null); - scoreFilterSettings(false, false, false, null); - tagsFilterSettings(false, false, false, null); - keywordFilterSettings(false, false, false, null); - knownFilesFilterSettings(false, false, false); - notableFilterSettings(false, false, false); - } - - /** - * Set the UI elements available to be the set of UI elements available when - * a Document search is being performed. - * - * @param enabled Boolean indicating if the filters present for - * documents should be enabled. - * @param resetSelected Boolean indicating if selection of the filters - * present for documents should be reset to their - * default status. - */ - @NbBundle.Messages({"FileSearchPanel.steptwo.documents=Step 2: Filter which documents to show"}) - private void documentsSelected(boolean enabled, boolean resetSelected) { - stepTwoLabel.setText(Bundle.FileSearchPanel_steptwo_documents()); - dataSourceFilterSettings(true, enabled, !resetSelected && dataSourceCheckbox.isSelected(), null); - sizeFilterSettings(true, enabled, !resetSelected && sizeCheckbox.isSelected(), null); - int[] selectedFrequencyIndices; - if (!CentralRepository.isEnabled()) { - selectedFrequencyIndices = new int[]{0}; - } else { - selectedFrequencyIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; - } - crFrequencyFilterSettings(true, enabled, resetSelected || crFrequencyCheckbox.isSelected(), resetSelected == true ? selectedFrequencyIndices : null); - userCreatedFilterSettings(false, false, false); - objectsFilterSettings(false, false, false, null); - hashSetFilterSettings(true, enabled, !resetSelected && hashSetCheckbox.isSelected(), null); - interestingItemsFilterSettings(true, enabled, !resetSelected && interestingItemsCheckbox.isSelected(), null); - parentFilterSettings(true, enabled, !resetSelected && parentCheckbox.isSelected(), null); - scoreFilterSettings(false, false, false, null); - tagsFilterSettings(false, false, false, null); - keywordFilterSettings(false, false, false, null); - knownFilesFilterSettings(false, false, false); - notableFilterSettings(false, false, false); - } - - /** - * Set the type of search to perform. - * - * @param type The type of File to be found by the search. - */ - void setSelectedType(FileType type) { - fileType = type; - setUpSizeFilter(); - if (null != fileType) { - switch (fileType) { - case IMAGE: - imagesSelected(true, true); - break; - case VIDEO: - videosSelected(true, true); - break; - case DOCUMENTS: - documentsSelected(true, true); - break; - default: - break; - } - } - validateFields(); - } - - FileType getSelectedType() { - return fileType; - } - - /** - * Reset the panel to its initial configuration. - */ - void resetPanel() { - // Set up the filters - setUpDataSourceFilter(); - setUpFrequencyFilter(); - setUpSizeFilter(); - setUpKWFilter(); - setUpParentPathFilter(); - setUpHashFilter(); - setUpInterestingItemsFilter(); - setUpTagsFilter(); - setUpObjectFilter(); - setUpScoreFilter(); - - groupByCombobox.removeAllItems(); - // Set up the grouping attributes - for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGrouping()) { - if ((type != GroupingAttributeType.FREQUENCY || CentralRepository.isEnabled()) - && (type != GroupingAttributeType.OBJECT_DETECTED || objectsList.getModel().getSize() > 0) - && (type != GroupingAttributeType.INTERESTING_ITEM_SET || interestingItemsList.getModel().getSize() > 0) - && (type != GroupingAttributeType.HASH_LIST_NAME || hashSetList.getModel().getSize() > 0)) { - groupByCombobox.addItem(type); - } - } - - orderByCombobox.removeAllItems(); - // Set up the file order list - for (FileSorter.SortingMethod method : FileSorter.SortingMethod.getOptionsForOrdering()) { - if (method != SortingMethod.BY_FREQUENCY || CentralRepository.isEnabled()) { - orderByCombobox.addItem(method); - } - } - - groupSortingComboBox.setSelectedIndex(0); - setSelectedType(FileType.IMAGE); - validateFields(); - } - - /** - * Add listeners to the checkbox/list set if listeners have not already been - * added. Either can be null. - * - * @param checkBox - * @param list - */ - private void addListeners(JCheckBox checkBox, JList list) { - if (checkBox != null) { - checkBox.addActionListener(this); - } - if (list != null) { - list.addListSelectionListener(new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent evt) { - if (!evt.getValueIsAdjusting()) { - validateFields(); - } - } - }); - } - } - - /** - * Initialize the data source filter - */ - private void setUpDataSourceFilter() { - int count = 0; - try { - DefaultListModel dsListModel = (DefaultListModel) dataSourceList.getModel(); - dsListModel.removeAllElements(); - for (DataSource ds : Case.getCurrentCase().getSleuthkitCase().getDataSources()) { - dsListModel.add(count, new DataSourceItem(ds)); - } - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error loading data sources", ex); - dataSourceCheckbox.setEnabled(false); - dataSourceList.setEnabled(false); - } - addListeners(dataSourceCheckbox, dataSourceList); - } - - /** - * Initialize the frequency filter - */ - private void setUpFrequencyFilter() { - int count = 0; - DefaultListModel frequencyListModel = (DefaultListModel) crFrequencyList.getModel(); - frequencyListModel.removeAllElements(); - if (!CentralRepository.isEnabled()) { - for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithoutCr()) { - frequencyListModel.add(count, freq); - } - } else { - for (FileSearchData.Frequency freq : FileSearchData.Frequency.getOptionsForFilteringWithCr()) { - frequencyListModel.add(count, freq); - } - } - addListeners(crFrequencyCheckbox, crFrequencyList); - } - - /** - * Initialize the file size filter - */ - private void setUpSizeFilter() { - int count = 0; - DefaultListModel sizeListModel = (DefaultListModel) sizeList.getModel(); - sizeListModel.removeAllElements(); - if (null == fileType) { - for (FileSearchData.FileSize size : FileSearchData.FileSize.values()) { - sizeListModel.add(count, size); - } - } else { - List sizes; - switch (fileType) { - case VIDEO: - sizes = FileSearchData.FileSize.getOptionsForVideos(); - break; - case IMAGE: - sizes = FileSearchData.FileSize.getOptionsForImages(); - break; - case DOCUMENTS: - sizes = FileSearchData.FileSize.getOptionsForImages(); - break; - default: - sizes = new ArrayList<>(); - break; - } - for (FileSearchData.FileSize size : sizes) { - sizeListModel.add(count, size); - } - } - addListeners(sizeCheckbox, sizeList); - } - - /** - * Initialize the keyword list names filter - */ - private void setUpKWFilter() { - int count = 0; - try { - DefaultListModel kwListModel = (DefaultListModel) keywordList.getModel(); - kwListModel.removeAllElements(); - List setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT, - BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME); - for (String name : setNames) { - kwListModel.add(count, name); - } - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error loading keyword list names", ex); - keywordCheckbox.setEnabled(false); - keywordList.setEnabled(false); - } - addListeners(keywordCheckbox, keywordList); - } - - /** - * Initialize the hash filter. - */ - private void setUpHashFilter() { - int count = 0; - try { - DefaultListModel hashListModel = (DefaultListModel) hashSetList.getModel(); - hashListModel.removeAllElements(); - List setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT, - BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME); - for (String name : setNames) { - hashListModel.add(count, name); - count++; - } - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error loading hash set names", ex); - hashSetCheckbox.setEnabled(false); - hashSetList.setEnabled(false); - } - addListeners(hashSetCheckbox, hashSetList); - } - - /** - * Initialize the interesting items filter. - */ - private void setUpInterestingItemsFilter() { - int count = 0; - try { - DefaultListModel intListModel = (DefaultListModel) interestingItemsList.getModel(); - intListModel.removeAllElements(); - List setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT, - BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME); - for (String name : setNames) { - intListModel.add(count, name); - count++; - } - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error loading interesting file set names", ex); - interestingItemsCheckbox.setEnabled(false); - interestingItemsList.setEnabled(false); - } - addListeners(interestingItemsCheckbox, interestingItemsList); - } - - /** - * Initialize the tags filter. - */ - private void setUpTagsFilter() { - int count = 0; - try { - DefaultListModel tagsListModel = (DefaultListModel) tagsList.getModel(); - tagsListModel.removeAllElements(); - List tagNames = Case.getCurrentCase().getSleuthkitCase().getTagNamesInUse(); - for (TagName name : tagNames) { - tagsListModel.add(count, name); - count++; - } - tagsList.setCellRenderer(new TagsListCellRenderer()); - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error loading tag names", ex); - tagsCheckbox.setEnabled(false); - tagsList.setEnabled(false); - } - addListeners(tagsCheckbox, tagsList); - } - - /** - * TagsListCellRenderer - */ - private class TagsListCellRenderer extends DefaultListCellRenderer { - - private static final long serialVersionUID = 1L; - - @Override - public java.awt.Component getListCellRendererComponent( - JList list, - Object value, - int index, - boolean isSelected, - boolean cellHasFocus) { - Object newValue = value; - if (value instanceof TagName) { - newValue = ((TagName) value).getDisplayName(); - } - super.getListCellRendererComponent(list, newValue, index, isSelected, cellHasFocus); - return this; - } - } - - /** - * Initialize the object filter - */ - private void setUpObjectFilter() { - int count = 0; - try { - DefaultListModel objListModel = (DefaultListModel) objectsList.getModel(); - objListModel.removeAllElements(); - List setNames = getSetNames(BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION); - for (String name : setNames) { - objListModel.add(count, name); - count++; - } - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error loading object detected set names", ex); - objectsCheckbox.setEnabled(false); - objectsList.setEnabled(false); - } - addListeners(objectsCheckbox, objectsList); - } - - /** - * Initialize the score filter - */ - private void setUpScoreFilter() { - - int count = 0; - DefaultListModel scoreListModel = (DefaultListModel) scoreList.getModel(); - scoreListModel.removeAllElements(); - for (Score score : Score.getOptionsForFiltering()) { - scoreListModel.add(count, score); - } - addListeners(scoreCheckbox, scoreList); - } - - /** - * Get the names of the sets which exist in the case database for the - * specified artifact and attribute types. - * - * @param artifactType The artifact type to get the list of sets for. - * @param setNameAttribute The attribute type which contains the set names. - * - * @return A list of set names which exist in the case for the specified - * artifact and attribute types. - * - * @throws TskCoreException - */ - private List getSetNames(BlackboardArtifact.ARTIFACT_TYPE artifactType, BlackboardAttribute.ATTRIBUTE_TYPE setNameAttribute) throws TskCoreException { - List arts = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(artifactType); - List setNames = new ArrayList<>(); - for (BlackboardArtifact art : arts) { - for (BlackboardAttribute attr : art.getAttributes()) { - if (attr.getAttributeType().getTypeID() == setNameAttribute.getTypeID()) { - String setName = attr.getValueString(); - if (!setNames.contains(setName)) { - setNames.add(setName); - } - } - } - } - Collections.sort(setNames); - return setNames; - } - - /** - * Initialize the parent path filter - */ - private void setUpParentPathFilter() { - fullRadioButton.setSelected(true); - includeRadioButton.setSelected(true); - parentListModel = (DefaultListModel) parentList.getModel(); - addListeners(parentCheckbox, parentList); - } - - /** - * Get a list of all filters selected by the user. - * - * @return the list of filters - */ - List getFilters() { - List filters = new ArrayList<>(); - filters.add(new FileSearchFiltering.FileTypeFilter(fileType)); - if (parentCheckbox.isSelected()) { - // For the parent paths, everything in the box is used (not just the selected entries) - filters.add(new FileSearchFiltering.ParentFilter(getParentPaths())); - } - - if (dataSourceCheckbox.isSelected()) { - List dataSources = dataSourceList.getSelectedValuesList().stream().map(t -> t.getDataSource()).collect(Collectors.toList()); - filters.add(new FileSearchFiltering.DataSourceFilter(dataSources)); - } - - if (crFrequencyCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.FrequencyFilter(crFrequencyList.getSelectedValuesList())); - } - - if (sizeCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.SizeFilter(sizeList.getSelectedValuesList())); - } - - if (keywordCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.KeywordListFilter(keywordList.getSelectedValuesList())); - } - - if (hashSetCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.HashSetFilter(hashSetList.getSelectedValuesList())); - } - - if (interestingItemsCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.InterestingFileSetFilter(interestingItemsList.getSelectedValuesList())); - } - - if (objectsCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.ObjectDetectionFilter(objectsList.getSelectedValuesList())); - } - - if (tagsCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.TagsFilter(tagsList.getSelectedValuesList())); - } - - if (userCreatedCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.UserCreatedFilter()); - } - - if (notableCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.NotableFilter()); - } - - if (knownFilesCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.KnownFilter()); - } - - if (scoreCheckbox.isSelected()) { - filters.add(new FileSearchFiltering.ScoreFilter(scoreList.getSelectedValuesList())); - } - - return filters; - } - - /** - * Utility method to get the parent path objects out of the JList. - * - * @return The list of entered ParentSearchTerm objects - */ - private List getParentPaths() { - List results = new ArrayList<>(); - for (int i = 0; i < parentListModel.getSize(); i++) { - results.add(parentListModel.get(i)); - } - return results; - } - - /** - * Get the attribute to group by - * - * @return the grouping attribute - */ - FileSearch.AttributeType getGroupingAttribute() { - return groupByCombobox.getItemAt(groupByCombobox.getSelectedIndex()).getAttributeType(); - } - - /** - * Get the sorting method for groups. - * - * @return the selected sorting method - */ - FileGroup.GroupSortingAlgorithm getGroupSortingMethod() { - return groupSortingComboBox.getItemAt(groupSortingComboBox.getSelectedIndex()); - - } - - /** - * Get the sorting method for files. - * - * @return the selected sorting method - */ - FileSorter.SortingMethod getFileSortingMethod() { - return (FileSorter.SortingMethod) orderByCombobox.getSelectedItem(); - } - - @Override - public void actionPerformed(ActionEvent e) { - validateFields(); - } - - /** - * Utility class to allow us to display the data source ID along with the - * name - */ - private class DataSourceItem { - - private final DataSource ds; - - DataSourceItem(DataSource ds) { - this.ds = ds; - } - - DataSource getDataSource() { - return ds; - } - - @Override - public String toString() { - return ds.getName() + " (ID: " + ds.getId() + ")"; - } - } - - /** - * Validate the form. If we use any of this in the final dialog we should - * use bundle messages. - */ - private void validateFields() { - // There will be a file type selected. - if (fileType == null) { - setInvalid("At least one file type must be selected"); - return; - } - // For most enabled filters, there should be something selected - if (dataSourceCheckbox.isSelected() && dataSourceList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one data source must be selected"); - return; - } - if (crFrequencyCheckbox.isSelected() && crFrequencyList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one CR frequency must be selected"); - return; - } - if (sizeCheckbox.isSelected() && sizeList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one size must be selected"); - return; - } - if (keywordCheckbox.isSelected() && keywordList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one keyword list name must be selected"); - return; - } - - // Parent uses everything in the box - if (parentCheckbox.isSelected() && getParentPaths().isEmpty()) { - setInvalid("At least one parent path must be entered"); - return; - } - - if (hashSetCheckbox.isSelected() && hashSetList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one hash set name must be selected"); - return; - } - - if (interestingItemsCheckbox.isSelected() && interestingItemsList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one interesting file set name must be selected"); - return; - } - - if (objectsCheckbox.isSelected() && objectsList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one object type name must be selected"); - return; - } - - if (tagsCheckbox.isSelected() && tagsList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one tag name must be selected"); - return; - } - - if (scoreCheckbox.isSelected() && scoreList.getSelectedValuesList().isEmpty()) { - setInvalid("At least one score must be selected"); - return; - } - setValid(); - } - - /** - * The settings are valid so enable the Search button - */ - private void setValid() { - firePropertyChange("FilterError", null, null); - } - - /** - * The settings are not valid so disable the search button and display the - * given error message. - * - * @param error - */ - private void setInvalid(String error) { - firePropertyChange("FilterError", error, error); - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // //GEN-BEGIN:initComponents - private void initComponents() { - java.awt.GridBagConstraints gridBagConstraints; - - javax.swing.ButtonGroup parentPathButtonGroup = new javax.swing.ButtonGroup(); - javax.swing.ButtonGroup parentIncludeButtonGroup = new javax.swing.ButtonGroup(); - javax.swing.JScrollPane filtersScrollPane = new javax.swing.JScrollPane(); - javax.swing.JPanel filtersPanel = new javax.swing.JPanel(); - sizeCheckbox = new javax.swing.JCheckBox(); - dataSourceCheckbox = new javax.swing.JCheckBox(); - crFrequencyCheckbox = new javax.swing.JCheckBox(); - keywordCheckbox = new javax.swing.JCheckBox(); - parentCheckbox = new javax.swing.JCheckBox(); - dataSourceScrollPane = new javax.swing.JScrollPane(); - dataSourceList = new javax.swing.JList<>(); - substringRadioButton = new javax.swing.JRadioButton(); - addButton = new javax.swing.JButton(); - deleteButton = new javax.swing.JButton(); - sizeScrollPane = new javax.swing.JScrollPane(); - sizeList = new javax.swing.JList<>(); - crFrequencyScrollPane = new javax.swing.JScrollPane(); - crFrequencyList = new javax.swing.JList<>(); - keywordScrollPane = new javax.swing.JScrollPane(); - keywordList = new javax.swing.JList<>(); - javax.swing.JLabel parentLabel = new javax.swing.JLabel(); - parentScrollPane = new javax.swing.JScrollPane(); - parentList = new javax.swing.JList<>(); - hashSetCheckbox = new javax.swing.JCheckBox(); - hashSetScrollPane = new javax.swing.JScrollPane(); - hashSetList = new javax.swing.JList<>(); - objectsCheckbox = new javax.swing.JCheckBox(); - tagsCheckbox = new javax.swing.JCheckBox(); - interestingItemsCheckbox = new javax.swing.JCheckBox(); - scoreCheckbox = new javax.swing.JCheckBox(); - userCreatedCheckbox = new javax.swing.JCheckBox(); - notableCheckbox = new javax.swing.JCheckBox(); - objectsScrollPane = new javax.swing.JScrollPane(); - objectsList = new javax.swing.JList<>(); - tagsScrollPane = new javax.swing.JScrollPane(); - tagsList = new javax.swing.JList<>(); - interestingItemsScrollPane = new javax.swing.JScrollPane(); - interestingItemsList = new javax.swing.JList<>(); - scoreScrollPane = new javax.swing.JScrollPane(); - scoreList = new javax.swing.JList<>(); - excludeRadioButton = new javax.swing.JRadioButton(); - knownFilesCheckbox = new javax.swing.JCheckBox(); - javax.swing.JPanel fullRadioPanel = new javax.swing.JPanel(); - fullRadioButton = new javax.swing.JRadioButton(); - javax.swing.JPanel includeRadioPanel = new javax.swing.JPanel(); - javax.swing.Box.Filler filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767)); - includeRadioButton = new javax.swing.JRadioButton(); - javax.swing.JPanel parentTextPanel = new javax.swing.JPanel(); - parentTextField = new javax.swing.JTextField(); - javax.swing.JPanel sortingPanel = new javax.swing.JPanel(); - groupByCombobox = new javax.swing.JComboBox<>(); - orderByCombobox = new javax.swing.JComboBox<>(); - javax.swing.JLabel orderGroupsByLabel = new javax.swing.JLabel(); - javax.swing.JLabel orderByLabel = new javax.swing.JLabel(); - javax.swing.JLabel groupByLabel = new javax.swing.JLabel(); - groupSortingComboBox = new javax.swing.JComboBox<>(); - stepTwoLabel = new javax.swing.JLabel(); - javax.swing.JLabel stepThreeLabel = new javax.swing.JLabel(); - - setMinimumSize(new java.awt.Dimension(10, 0)); - setPreferredSize(new java.awt.Dimension(321, 400)); - - filtersScrollPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.filtersScrollPane.border.title"))); // NOI18N - filtersScrollPane.setPreferredSize(new java.awt.Dimension(309, 400)); - - filtersPanel.setMinimumSize(new java.awt.Dimension(280, 500)); - filtersPanel.setPreferredSize(new java.awt.Dimension(280, 540)); - filtersPanel.setLayout(new java.awt.GridBagLayout()); - - org.openide.awt.Mnemonics.setLocalizedText(sizeCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.sizeCheckbox.text")); // NOI18N - sizeCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - sizeCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(6, 6, 4, 0); - filtersPanel.add(sizeCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(dataSourceCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.dataSourceCheckbox.text")); // NOI18N - dataSourceCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - dataSourceCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(dataSourceCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(crFrequencyCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.crFrequencyCheckbox.text")); // NOI18N - crFrequencyCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - crFrequencyCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(crFrequencyCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(keywordCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.keywordCheckbox.text")); // NOI18N - keywordCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - keywordCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 12; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(keywordCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(parentCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.parentCheckbox.text")); // NOI18N - parentCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - parentCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 7; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(parentCheckbox, gridBagConstraints); - - dataSourceList.setModel(new DefaultListModel()); - dataSourceList.setEnabled(false); - dataSourceList.setVisibleRowCount(5); - dataSourceScrollPane.setViewportView(dataSourceList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 1; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.weighty = 0.1; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(dataSourceScrollPane, gridBagConstraints); - - parentPathButtonGroup.add(substringRadioButton); - org.openide.awt.Mnemonics.setLocalizedText(substringRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.substringRadioButton.text")); // NOI18N - substringRadioButton.setEnabled(false); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 9; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.1; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0); - filtersPanel.add(substringRadioButton, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.addButton.text")); // NOI18N - addButton.setEnabled(false); - addButton.setMaximumSize(new java.awt.Dimension(70, 23)); - addButton.setMinimumSize(new java.awt.Dimension(70, 23)); - addButton.setPreferredSize(new java.awt.Dimension(70, 23)); - addButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - addButtonActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 3; - gridBagConstraints.gridy = 11; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END; - gridBagConstraints.insets = new java.awt.Insets(0, 10, 6, 6); - filtersPanel.add(addButton, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(deleteButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.deleteButton.text")); // NOI18N - deleteButton.setEnabled(false); - deleteButton.setMaximumSize(new java.awt.Dimension(70, 23)); - deleteButton.setMinimumSize(new java.awt.Dimension(70, 23)); - deleteButton.setPreferredSize(new java.awt.Dimension(70, 23)); - deleteButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - deleteButtonActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 3; - gridBagConstraints.gridy = 10; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_END; - gridBagConstraints.insets = new java.awt.Insets(0, 10, 4, 6); - filtersPanel.add(deleteButton, gridBagConstraints); - - sizeList.setModel(new DefaultListModel()); - sizeList.setEnabled(false); - sizeList.setVisibleRowCount(5); - sizeScrollPane.setViewportView(sizeList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 0; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.weighty = 0.1; - gridBagConstraints.insets = new java.awt.Insets(6, 4, 4, 6); - filtersPanel.add(sizeScrollPane, gridBagConstraints); - - crFrequencyList.setModel(new DefaultListModel()); - crFrequencyList.setEnabled(false); - crFrequencyList.setVisibleRowCount(5); - crFrequencyScrollPane.setViewportView(crFrequencyList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 2; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.weighty = 0.1; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(crFrequencyScrollPane, gridBagConstraints); - - keywordList.setModel(new DefaultListModel()); - keywordList.setEnabled(false); - keywordList.setVisibleRowCount(3); - keywordScrollPane.setViewportView(keywordList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 12; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(keywordScrollPane, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(parentLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.parentLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 8; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(parentLabel, gridBagConstraints); - - parentList.setModel(new DefaultListModel()); - parentList.setEnabled(false); - parentList.setVisibleRowCount(4); - parentList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { - public void valueChanged(javax.swing.event.ListSelectionEvent evt) { - parentListValueChanged(evt); - } - }); - parentScrollPane.setViewportView(parentList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 7; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.gridheight = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.weighty = 0.05; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(parentScrollPane, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(hashSetCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.hashSetCheckbox.text")); // NOI18N - hashSetCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - hashSetCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 4; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(hashSetCheckbox, gridBagConstraints); - - hashSetList.setModel(new DefaultListModel()); - hashSetList.setEnabled(false); - hashSetList.setVisibleRowCount(3); - hashSetScrollPane.setViewportView(hashSetList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 4; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.weighty = 0.05; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(hashSetScrollPane, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(objectsCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.objectsCheckbox.text")); // NOI18N - objectsCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - objectsCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 6; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(objectsCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(tagsCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.tagsCheckbox.text")); // NOI18N - tagsCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - tagsCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 13; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(tagsCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(interestingItemsCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.interestingItemsCheckbox.text")); // NOI18N - interestingItemsCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - interestingItemsCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 5; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(interestingItemsCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(scoreCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.scoreCheckbox.text")); // NOI18N - scoreCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - scoreCheckboxActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 14; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0); - filtersPanel.add(scoreCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(userCreatedCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.userCreatedCheckbox.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; - gridBagConstraints.gridwidth = 4; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 6); - filtersPanel.add(userCreatedCheckbox, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(notableCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.notableCheckbox.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 15; - gridBagConstraints.gridwidth = 4; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 6); - filtersPanel.add(notableCheckbox, gridBagConstraints); - - objectsList.setModel(new DefaultListModel()); - objectsList.setEnabled(false); - objectsList.setVisibleRowCount(2); - objectsScrollPane.setViewportView(objectsList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 6; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.weighty = 0.05; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(objectsScrollPane, gridBagConstraints); - - tagsList.setModel(new DefaultListModel()); - tagsList.setEnabled(false); - tagsList.setVisibleRowCount(3); - tagsScrollPane.setViewportView(tagsList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 13; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(tagsScrollPane, gridBagConstraints); - - interestingItemsList.setModel(new DefaultListModel()); - interestingItemsList.setEnabled(false); - interestingItemsList.setVisibleRowCount(2); - interestingItemsScrollPane.setViewportView(interestingItemsList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 5; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.weighty = 0.05; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(interestingItemsScrollPane, gridBagConstraints); - - scoreList.setModel(new DefaultListModel()); - scoreList.setEnabled(false); - scoreList.setVisibleRowCount(3); - scoreScrollPane.setViewportView(scoreList); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 14; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.5; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 6); - filtersPanel.add(scoreScrollPane, gridBagConstraints); - - parentIncludeButtonGroup.add(excludeRadioButton); - org.openide.awt.Mnemonics.setLocalizedText(excludeRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.excludeRadioButton.text")); // NOI18N - excludeRadioButton.setEnabled(false); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 10; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.weightx = 0.1; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0); - filtersPanel.add(excludeRadioButton, gridBagConstraints); - - org.openide.awt.Mnemonics.setLocalizedText(knownFilesCheckbox, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.knownFilesCheckbox.text")); // NOI18N - knownFilesCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.knownFilesCheckbox.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 16; - gridBagConstraints.gridwidth = 4; - gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; - gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 6); - filtersPanel.add(knownFilesCheckbox, gridBagConstraints); - - parentPathButtonGroup.add(fullRadioButton); - fullRadioButton.setSelected(true); - org.openide.awt.Mnemonics.setLocalizedText(fullRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.fullRadioButton.text")); // NOI18N - fullRadioButton.setEnabled(false); - - javax.swing.GroupLayout fullRadioPanelLayout = new javax.swing.GroupLayout(fullRadioPanel); - fullRadioPanel.setLayout(fullRadioPanelLayout); - fullRadioPanelLayout.setHorizontalGroup( - fullRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fullRadioPanelLayout.createSequentialGroup() - .addContainerGap(299, Short.MAX_VALUE) - .addComponent(fullRadioButton) - .addGap(20, 20, 20)) - ); - fullRadioPanelLayout.setVerticalGroup( - fullRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(fullRadioPanelLayout.createSequentialGroup() - .addComponent(fullRadioButton) - .addGap(0, 4, Short.MAX_VALUE)) - ); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 9; - gridBagConstraints.gridwidth = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.weightx = 1.0; - filtersPanel.add(fullRadioPanel, gridBagConstraints); - - parentIncludeButtonGroup.add(includeRadioButton); - includeRadioButton.setSelected(true); - org.openide.awt.Mnemonics.setLocalizedText(includeRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.includeRadioButton.text")); // NOI18N - includeRadioButton.setEnabled(false); - - javax.swing.GroupLayout includeRadioPanelLayout = new javax.swing.GroupLayout(includeRadioPanel); - includeRadioPanel.setLayout(includeRadioPanelLayout); - includeRadioPanelLayout.setHorizontalGroup( - includeRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(includeRadioPanelLayout.createSequentialGroup() - .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 299, Short.MAX_VALUE) - .addComponent(includeRadioButton)) - ); - includeRadioPanelLayout.setVerticalGroup( - includeRadioPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(includeRadioButton) - ); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 10; - gridBagConstraints.gridwidth = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.weightx = 1.0; - filtersPanel.add(includeRadioPanel, gridBagConstraints); - - parentTextField.setEnabled(false); - - javax.swing.GroupLayout parentTextPanelLayout = new javax.swing.GroupLayout(parentTextPanel); - parentTextPanel.setLayout(parentTextPanelLayout); - parentTextPanelLayout.setHorizontalGroup( - parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, parentTextPanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE)) - ); - parentTextPanelLayout.setVerticalGroup( - parentTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - ); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 11; - gridBagConstraints.gridwidth = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.weightx = 1.5; - gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 0); - filtersPanel.add(parentTextPanel, gridBagConstraints); - - filtersScrollPane.setViewportView(filtersPanel); - - sortingPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.sortingPanel.border.title"))); // NOI18N - sortingPanel.setPreferredSize(new java.awt.Dimension(345, 112)); - - org.openide.awt.Mnemonics.setLocalizedText(orderGroupsByLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.orderGroupsByLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(orderByLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.orderByLabel.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(groupByLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.groupByLabel.text")); // NOI18N - - javax.swing.GroupLayout sortingPanelLayout = new javax.swing.GroupLayout(sortingPanel); - sortingPanel.setLayout(sortingPanelLayout); - sortingPanelLayout.setHorizontalGroup( - sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(sortingPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(orderGroupsByLabel) - .addGroup(sortingPanelLayout.createSequentialGroup() - .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(groupByLabel) - .addComponent(orderByLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(groupSortingComboBox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(orderByCombobox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(groupByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) - .addContainerGap()) - ); - sortingPanelLayout.setVerticalGroup( - sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(sortingPanelLayout.createSequentialGroup() - .addGap(6, 6, 6) - .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(groupByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(groupByLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(groupSortingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(orderGroupsByLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(orderByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(orderByLabel)) - .addContainerGap()) - ); - - org.openide.awt.Mnemonics.setLocalizedText(stepThreeLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.stepThreeLabel.text")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(6, 6, 6) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(stepTwoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(stepThreeLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(filtersScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)) - .addGap(6, 6, 6)))) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGap(6, 6, 6) - .addComponent(stepTwoLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(stepThreeLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(64, 64, 64)) - ); - }// //GEN-END:initComponents - - /** - * Set the enabled status of the search controls. - * - * @param enabled Boolean which indicates if the search should be enabled. - * True if the search button and controls should be enabled, - * false otherwise. - */ - private void enableSearch(boolean enabled) { - if (enabled) { - DiscoveryTopComponent.getTopComponent().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } else { - DiscoveryTopComponent.getTopComponent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - } - if (null != fileType) { - switch (fileType) { - case IMAGE: - imagesSelected(enabled, false); - break; - case VIDEO: - videosSelected(enabled, false); - break; - case DOCUMENTS: - documentsSelected(enabled, false); - break; - default: - break; - } - } - orderByCombobox.setEnabled(enabled); - groupByCombobox.setEnabled(enabled); - groupSortingComboBox.setEnabled(enabled); - } - - /** - * Update the user interface when a search has been cancelled. - * - * @param searchCancelledEvent The SearchCancelledEvent which was received. - */ - @Subscribe - void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) { - SwingUtilities.invokeLater(() -> { - enableSearch(true); - }); - } - - /** - * Update the user interface when a search has been successfully completed. - * - * @param searchCompleteEvent The SearchCompleteEvent which was received. - */ - @Subscribe - void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) { - SwingUtilities.invokeLater(() -> { - enableSearch(true); - }); - } - - private void parentCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_parentCheckboxActionPerformed - parentFilterSettings(true, true, parentCheckbox.isSelected(), null); - }//GEN-LAST:event_parentCheckboxActionPerformed - - private void keywordCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keywordCheckboxActionPerformed - keywordList.setEnabled(keywordCheckbox.isSelected()); - }//GEN-LAST:event_keywordCheckboxActionPerformed - - private void sizeCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sizeCheckboxActionPerformed - sizeList.setEnabled(sizeCheckbox.isSelected()); - }//GEN-LAST:event_sizeCheckboxActionPerformed - - private void crFrequencyCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crFrequencyCheckboxActionPerformed - crFrequencyList.setEnabled(crFrequencyCheckbox.isSelected()); - }//GEN-LAST:event_crFrequencyCheckboxActionPerformed - - private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed - if (!parentTextField.getText().isEmpty()) { - ParentSearchTerm searchTerm; - searchTerm = new ParentSearchTerm(parentTextField.getText(), fullRadioButton.isSelected(), includeRadioButton.isSelected()); - parentListModel.add(parentListModel.size(), searchTerm); - validateFields(); - parentTextField.setText(""); - } - }//GEN-LAST:event_addButtonActionPerformed - - /** - * Cancel the current search. - */ - void cancelSearch() { - if (searchWorker != null) { - searchWorker.cancel(true); - } - } - - private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed - int index = parentList.getSelectedIndex(); - if (index >= 0) { - parentListModel.remove(index); - } - validateFields(); - }//GEN-LAST:event_deleteButtonActionPerformed - - private void parentListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_parentListValueChanged - if (parentList.getSelectedValuesList().isEmpty()) { - deleteButton.setEnabled(false); - } else { - deleteButton.setEnabled(true); - } - }//GEN-LAST:event_parentListValueChanged - - private void dataSourceCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataSourceCheckboxActionPerformed - dataSourceList.setEnabled(dataSourceCheckbox.isSelected()); - }//GEN-LAST:event_dataSourceCheckboxActionPerformed - - private void hashSetCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hashSetCheckboxActionPerformed - hashSetList.setEnabled(hashSetCheckbox.isSelected()); - }//GEN-LAST:event_hashSetCheckboxActionPerformed - - private void objectsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_objectsCheckboxActionPerformed - objectsList.setEnabled(objectsCheckbox.isSelected()); - }//GEN-LAST:event_objectsCheckboxActionPerformed - - private void tagsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tagsCheckboxActionPerformed - tagsList.setEnabled(tagsCheckbox.isSelected()); - }//GEN-LAST:event_tagsCheckboxActionPerformed - - private void interestingItemsCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_interestingItemsCheckboxActionPerformed - interestingItemsList.setEnabled(interestingItemsCheckbox.isSelected()); - }//GEN-LAST:event_interestingItemsCheckboxActionPerformed - - private void scoreCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scoreCheckboxActionPerformed - scoreList.setEnabled(scoreCheckbox.isSelected()); - }//GEN-LAST:event_scoreCheckboxActionPerformed - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton addButton; - private javax.swing.JCheckBox crFrequencyCheckbox; - private javax.swing.JList crFrequencyList; - private javax.swing.JScrollPane crFrequencyScrollPane; - private javax.swing.JCheckBox dataSourceCheckbox; - private javax.swing.JList dataSourceList; - private javax.swing.JScrollPane dataSourceScrollPane; - private javax.swing.JButton deleteButton; - private javax.swing.JRadioButton excludeRadioButton; - private javax.swing.JRadioButton fullRadioButton; - private javax.swing.JComboBox groupByCombobox; - private javax.swing.JComboBox groupSortingComboBox; - private javax.swing.JCheckBox hashSetCheckbox; - private javax.swing.JList hashSetList; - private javax.swing.JScrollPane hashSetScrollPane; - private javax.swing.JRadioButton includeRadioButton; - private javax.swing.JCheckBox interestingItemsCheckbox; - private javax.swing.JList interestingItemsList; - private javax.swing.JScrollPane interestingItemsScrollPane; - private javax.swing.JCheckBox keywordCheckbox; - private javax.swing.JList keywordList; - private javax.swing.JScrollPane keywordScrollPane; - private javax.swing.JCheckBox knownFilesCheckbox; - private javax.swing.JCheckBox notableCheckbox; - private javax.swing.JCheckBox objectsCheckbox; - private javax.swing.JList objectsList; - private javax.swing.JScrollPane objectsScrollPane; - private javax.swing.JComboBox orderByCombobox; - private javax.swing.JCheckBox parentCheckbox; - private javax.swing.JList parentList; - private javax.swing.JScrollPane parentScrollPane; - private javax.swing.JTextField parentTextField; - private javax.swing.JCheckBox scoreCheckbox; - private javax.swing.JList scoreList; - private javax.swing.JScrollPane scoreScrollPane; - private javax.swing.JCheckBox sizeCheckbox; - private javax.swing.JList sizeList; - private javax.swing.JScrollPane sizeScrollPane; - private javax.swing.JLabel stepTwoLabel; - private javax.swing.JRadioButton substringRadioButton; - private javax.swing.JCheckBox tagsCheckbox; - private javax.swing.JList tagsList; - private javax.swing.JScrollPane tagsScrollPane; - private javax.swing.JCheckBox userCreatedCheckbox; - // End of variables declaration//GEN-END:variables - -} diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index 0845407451..25a36887fa 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -35,10 +35,8 @@ final class ImageFilterPanel extends AbstractFiltersPanel { addFilter(new UserCreatedFilterPanel(), false, null); addFilter(new HashSetFilterPanel(), false, null); addFilter(new InterestingItemsFilterPanel(), false, null); - addFilter(new DataSourceFilterPanel(), false, null); addFilter(new ParentFolderFilterPanel(), false, null); - endPanel(); } /** From 86539ae8435d5f4a6d82bdb3b2002009b01aedd1 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 26 May 2020 17:04:25 -0400 Subject: [PATCH 19/51] 6305 layout changes and fixes to allignment --- .../AbstractDiscoveryFilterPanel.java | 4 + .../discovery/AbstractFiltersPanel.java | 100 +++++++++++------- .../autopsy/discovery/Bundle.properties | 1 + .../discovery/Bundle.properties-MERGED | 5 +- .../autopsy/discovery/DiscoveryDialog.form | 30 +++--- .../autopsy/discovery/DiscoveryDialog.java | 27 +++-- .../discovery/DocumentFilterPanel.form | 44 +++++--- .../discovery/DocumentFilterPanel.java | 44 +++++--- .../autopsy/discovery/HashSetFilterPanel.java | 5 + .../autopsy/discovery/ImageFilterPanel.form | 36 ++++++- .../autopsy/discovery/ImageFilterPanel.java | 37 +++++-- .../InterestingItemsFilterPanel.form | 2 +- .../InterestingItemsFilterPanel.java | 2 +- .../discovery/ParentFolderFilterPanel.form | 13 +-- .../discovery/ParentFolderFilterPanel.java | 10 +- .../discovery/PastOccurrencesFilterPanel.form | 2 +- .../discovery/PastOccurrencesFilterPanel.java | 2 +- .../autopsy/discovery/SizeFilterPanel.form | 3 +- .../autopsy/discovery/SizeFilterPanel.java | 3 +- .../discovery/UserCreatedFilterPanel.java | 5 + .../autopsy/discovery/VideoFilterPanel.form | 45 +++++--- .../autopsy/discovery/VideoFilterPanel.java | 46 ++++---- 22 files changed, 301 insertions(+), 165 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java index fa287b1bff..558a94fef2 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java @@ -69,4 +69,8 @@ abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel { } } + boolean hasPanel() { + return true; + } + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 10ff50c49a..9b3aca9923 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -13,6 +13,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; +import javax.swing.JPanel; +import javax.swing.JSplitPane; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; @@ -20,58 +22,76 @@ import javax.swing.event.ListSelectionListener; * * @author wschaefer */ -abstract class AbstractFiltersPanel extends javax.swing.JPanel implements ActionListener, ListSelectionListener { +abstract class AbstractFiltersPanel extends JPanel implements ActionListener, ListSelectionListener { - private static boolean isInitialized = false; + private boolean isInitialized = false; private static final double LABEL_WEIGHT = 0; private static final double PANEL_WEIGHT = .1; private static final int LABEL_WIDTH = 1; private static final int PANEL_WIDTH = 2; - private static final int NUMBER_OF_COLUMNS = 6; + private static final int LABEL_HEIGHT = 1; + private static final int PANEL_HEIGHT = 2; private static final long serialVersionUID = 1L; - private final GridBagLayout layout = new GridBagLayout(); private final GridBagConstraints constraints = new GridBagConstraints(); private final List filters = new ArrayList<>(); + private final JPanel firstColumnPanel = new JPanel(); + private final JPanel secondColumnPanel = new JPanel(); + private int firstColumnY = 0; + private int secondColumnY = 0; + + AbstractFiltersPanel() { + firstColumnPanel.setLayout(new GridBagLayout()); + secondColumnPanel.setLayout(new GridBagLayout()); + } abstract FileSearchData.FileType getFileType(); - final synchronized void addFilter(AbstractDiscoveryFilterPanel filterPanel, boolean isSelected, int[] indicesSelected) { + final synchronized void addFilter(AbstractDiscoveryFilterPanel filterPanel, boolean isSelected, int[] indicesSelected, int column) { if (!isInitialized) { - constraints.fill = GridBagConstraints.VERTICAL; - constraints.gridx = 0; constraints.gridy = 0; - constraints.gridheight = 2; - constraints.gridwidth = LABEL_WIDTH; - constraints.weightx = LABEL_WEIGHT; - constraints.anchor = GridBagConstraints.NORTHWEST; - constraints.insets = new Insets(0, 8, 12, 8); + constraints.anchor = GridBagConstraints.FIRST_LINE_START; + constraints.insets = new Insets(8, 8, 8, 8); isInitialized = true; } + if (column == 0) { + constraints.gridy = firstColumnY; + } else { + constraints.gridy = secondColumnY; + } + constraints.gridx = 0; filterPanel.configurePanel(isSelected, indicesSelected); filterPanel.addListeners(this, this); - constraints.fill = GridBagConstraints.VERTICAL; filters.add(filterPanel); - constraints.weightx = LABEL_WEIGHT; + constraints.fill = GridBagConstraints.VERTICAL; + constraints.gridheight = LABEL_HEIGHT; constraints.gridwidth = LABEL_WIDTH; - addToGridBagLayout(filterPanel.getCheckbox(), null); - nextSpot(LABEL_WIDTH); - constraints.fill = GridBagConstraints.BOTH; - constraints.weightx = PANEL_WEIGHT; - constraints.gridwidth = PANEL_WIDTH; - addToGridBagLayout(filterPanel, null); - nextSpot(PANEL_WIDTH); - updateLayout(); - } - - private void nextSpot(int width) { - constraints.gridx += width; - if (constraints.gridx >= NUMBER_OF_COLUMNS) { - constraints.fill = GridBagConstraints.VERTICAL; - constraints.gridy += constraints.gridheight; - constraints.gridx = 0; + constraints.weightx = LABEL_WEIGHT; + constraints.weighty = LABEL_WEIGHT; + constraints.gridwidth = LABEL_WIDTH; + addToGridBagLayout(filterPanel.getCheckbox(), null, column); + if (filterPanel.hasPanel()) { + System.out.println("filterPanel has panel" + filterPanel.getClass().toString()); + constraints.gridx += constraints.gridwidth; + constraints.fill = GridBagConstraints.BOTH; + constraints.gridheight = PANEL_HEIGHT; + constraints.weightx = PANEL_WEIGHT; + constraints.weighty = PANEL_WEIGHT; + constraints.gridwidth = PANEL_WIDTH; + addToGridBagLayout(filterPanel, null, column); + } else { + System.out.println("filterPanel missing panel" + filterPanel.getClass().toString()); + } + if (column == 0) { + firstColumnY += constraints.gridheight; + } else { + secondColumnY += constraints.gridheight; } } + final void addPanelsToScrollPane(JSplitPane splitPane) { + splitPane.setLeftComponent(firstColumnPanel); + splitPane.setRightComponent(secondColumnPanel); + } final synchronized void clearFilters() { for (AbstractDiscoveryFilterPanel filterPanel : filters) { @@ -80,21 +100,21 @@ abstract class AbstractFiltersPanel extends javax.swing.JPanel implements Action filters.clear(); } - private void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd) { + private void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd, int columnIndex) { + addToColumn(componentToAdd, constraints, columnIndex); if (additionalComponentToAdd != null) { - constraints.gridheight /= 2; - add(componentToAdd, constraints); constraints.gridy += constraints.gridheight; - add(additionalComponentToAdd, constraints); + addToColumn(additionalComponentToAdd, constraints, columnIndex); constraints.gridy -= constraints.gridheight; - constraints.gridheight *= 2; - } else { - add(componentToAdd, constraints); - } + } } - private void updateLayout() { - setLayout(layout); + private void addToColumn(Component component, Object constraints, int columnNumber) { + if (columnNumber == 0) { + firstColumnPanel.add(component, constraints); + } else { + secondColumnPanel.add(component, constraints); + } } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index 91acce8122..3254b0c28c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -97,3 +97,4 @@ DiscoveryDialog.sortingPanel.border.title=Grouping DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: +ImageFilterPanel.imageFiltersSplitPane.toolTipText= diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 1361d60a5b..123c679d00 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -137,12 +137,8 @@ FileSearchFiltering.SizeFilter.range=({0} to {1}) FileSearchFiltering.TagsFilter.desc=Files that have been tagged {0} FileSearchFiltering.TagsFilter.or=\ or FileSearchFiltering.UserCreatedFilter.desc=Files that contain EXIF data -FileSearchPanel.dialogTitle.text=Test file search FileSearchPanel.sortingPanel.border.title=Grouping FileSearchPanel.addButton.text=Add -FileSearchPanel.steptwo.documents=Step 2: Filter which documents to show -FileSearchPanel.steptwo.images=Step 2: Filter which images to show -FileSearchPanel.steptwo.videos=Step 2: Filter which videos to show FileSearchPanel.substringRadioButton.text=Substring FileSearchPanel.fullRadioButton.text=Full FileSearchPanel.parentCheckbox.text=Parent Folder: @@ -251,6 +247,7 @@ DiscoveryDialog.sortingPanel.border.title=Grouping DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: +ImageFilterPanel.imageFiltersSplitPane.toolTipText= VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index a026c51818..913e82682d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -163,10 +163,10 @@ - - + + - + @@ -247,21 +247,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 796374c3e6..910f06f6d6 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -259,17 +259,16 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addGroup(sortingPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(sortingPanelLayout.createSequentialGroup() - .addComponent(groupByLabel) - .addGap(88, 88, 88) - .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(groupSortingComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(groupByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(orderByLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(orderByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addComponent(orderGroupsByLabel)) + .addComponent(orderGroupsByLabel) + .addComponent(groupByLabel)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(groupSortingComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(groupByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(orderByLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(orderByCombobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); sortingPanelLayout.setVerticalGroup( @@ -297,10 +296,10 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 662, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE) + .addGap(68, 68, 68) .addComponent(cancelButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(searchButton))) .addContainerGap()) ); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form index 5f3eab1a5f..2fd3b2bfc8 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form @@ -13,16 +13,36 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index fa23484e14..d4834b8c0c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -20,20 +20,22 @@ final class DocumentFilterPanel extends AbstractFiltersPanel { * Creates new form DocumentFilterPanel */ DocumentFilterPanel() { + super(); initComponents(); - addFilter(new SizeFilterPanel(FileSearchData.FileType.DOCUMENTS), false, null); - addFilter(new DataSourceFilterPanel(), false, null); + addFilter(new SizeFilterPanel(FileSearchData.FileType.DOCUMENTS), false, null, 0); + addFilter(new DataSourceFilterPanel(), false, null, 0); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { pastOccurrencesIndices = new int[]{0}; } else { pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; } - addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices); - addFilter(new HashSetFilterPanel(), false, null); - addFilter(new InterestingItemsFilterPanel(), false, null); - addFilter(new ObjectDetectedFilterPanel(), false, null); - addFilter(new ParentFolderFilterPanel(), false, null); + addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices, 0); + addFilter(new HashSetFilterPanel(), false, null, 1); + addFilter(new InterestingItemsFilterPanel(), false, null, 1); + addFilter(new ObjectDetectedFilterPanel(), false, null, 1); + addFilter(new ParentFolderFilterPanel(), false, null, 1); + addPanelsToScrollPane(documentsFiltersSplitPane); } /** @@ -45,21 +47,29 @@ final class DocumentFilterPanel extends AbstractFiltersPanel { // //GEN-BEGIN:initComponents private void initComponents() { - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 400, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 300, Short.MAX_VALUE) - ); + documentFiltersScrollPane = new javax.swing.JScrollPane(); + documentFiltersPanel = new javax.swing.JPanel(); + documentsFiltersSplitPane = new javax.swing.JSplitPane(); + + setLayout(new java.awt.BorderLayout()); + + documentFiltersPanel.setLayout(new java.awt.BorderLayout()); + + documentsFiltersSplitPane.setResizeWeight(0.5); + documentFiltersPanel.add(documentsFiltersSplitPane, java.awt.BorderLayout.CENTER); + + documentFiltersScrollPane.setViewportView(documentFiltersPanel); + + add(documentFiltersScrollPane, java.awt.BorderLayout.CENTER); }// //GEN-END:initComponents @Override FileSearchData.FileType getFileType() { return FILE_TYPE; } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel documentFiltersPanel; + private javax.swing.JScrollPane documentFiltersScrollPane; + private javax.swing.JSplitPane documentsFiltersSplitPane; // End of variables declaration//GEN-END:variables + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index 3ca2505799..e8c97f8a59 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -47,7 +47,9 @@ public class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { hashListModel.add(count, name); count++; } + System.out.println("SETUP COMPLETE"); } catch (TskCoreException ex) { + System.out.println("SETUP ERROR"); logger.log(Level.SEVERE, "Error loading hash set names", ex); hashSetCheckbox.setEnabled(false); hashSetList.setEnabled(false); @@ -106,6 +108,7 @@ public class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { @Override void configurePanel(boolean selected, int[] indicesSelected) { + System.out.println("CONFIG PANEL HASHSET"); boolean hasHashSets = hashSetList.getModel().getSize() > 0; hashSetCheckbox.setEnabled(hasHashSets); hashSetCheckbox.setSelected(selected && hasHashSets); @@ -115,9 +118,11 @@ public class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { if (indicesSelected != null) { hashSetList.setSelectedIndices(indicesSelected); } + System.out.println("PANEL ENABLED SETUP"); } else { hashSetScrollPane.setEnabled(false); hashSetList.setEnabled(false); + System.out.println("PAENL DISABLED SETUP"); } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form index 3c39b407cb..af67f74cbf 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form @@ -14,5 +14,39 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index 25a36887fa..d404af1b66 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -20,23 +20,25 @@ final class ImageFilterPanel extends AbstractFiltersPanel { * Creates new form ImageFilterPanel */ ImageFilterPanel() { + super(); initComponents(); SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FILE_TYPE); int[] sizeIndicesSelected = {1, 2, 3, 4, 5}; - addFilter(sizeFilterPanel, true, sizeIndicesSelected); - addFilter(new ObjectDetectedFilterPanel(), false, null); + addFilter(sizeFilterPanel, true, sizeIndicesSelected, 0); + addFilter(new ObjectDetectedFilterPanel(), false, null, 0); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { pastOccurrencesIndices = new int[]{0}; } else { pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; } - addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices); - addFilter(new UserCreatedFilterPanel(), false, null); - addFilter(new HashSetFilterPanel(), false, null); - addFilter(new InterestingItemsFilterPanel(), false, null); - addFilter(new DataSourceFilterPanel(), false, null); - addFilter(new ParentFolderFilterPanel(), false, null); + addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices, 0); + addFilter(new UserCreatedFilterPanel(), false, null, 1); + addFilter(new HashSetFilterPanel(), false, null, 1); + addFilter(new InterestingItemsFilterPanel(), false, null, 1); + addFilter(new DataSourceFilterPanel(), false, null, 1); + addFilter(new ParentFolderFilterPanel(), false, null, 1); + addPanelsToScrollPane(imageFiltersSplitPane); } /** @@ -48,7 +50,21 @@ final class ImageFilterPanel extends AbstractFiltersPanel { // //GEN-BEGIN:initComponents private void initComponents() { - setLayout(new java.awt.GridBagLayout()); + imageFiltersScrollPane = new javax.swing.JScrollPane(); + imageFiltersPanel = new javax.swing.JPanel(); + imageFiltersSplitPane = new javax.swing.JSplitPane(); + + setLayout(new java.awt.BorderLayout()); + + imageFiltersPanel.setLayout(new java.awt.BorderLayout()); + + imageFiltersSplitPane.setResizeWeight(0.5); + imageFiltersSplitPane.setToolTipText(org.openide.util.NbBundle.getMessage(ImageFilterPanel.class, "ImageFilterPanel.imageFiltersSplitPane.toolTipText")); // NOI18N + imageFiltersPanel.add(imageFiltersSplitPane, java.awt.BorderLayout.CENTER); + + imageFiltersScrollPane.setViewportView(imageFiltersPanel); + + add(imageFiltersScrollPane, java.awt.BorderLayout.CENTER); }// //GEN-END:initComponents @Override @@ -57,5 +73,8 @@ final class ImageFilterPanel extends AbstractFiltersPanel { } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel imageFiltersPanel; + private javax.swing.JScrollPane imageFiltersScrollPane; + private javax.swing.JSplitPane imageFiltersSplitPane; // End of variables declaration//GEN-END:variables } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form index 549a3a0a17..fba8295349 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form @@ -33,7 +33,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java index 721e6ff486..d83e75e964 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java @@ -85,7 +85,7 @@ public class InterestingItemsFilterPanel extends AbstractDiscoveryFilterPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(interestingItemsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(interestingItemsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form index 0cae8b6a91..5348e82bbc 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form @@ -40,7 +40,7 @@ - + @@ -49,17 +49,14 @@ - - - - + - + - - + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index 5613e666ae..5631ae2242 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -127,7 +127,7 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGroup(layout.createSequentialGroup() .addGap(8, 8, 8) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(includeRadioButton) @@ -135,13 +135,11 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(substringRadioButton) - .addGroup(layout.createSequentialGroup() - .addComponent(excludeRadioButton) - .addGap(0, 0, Short.MAX_VALUE)))) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(excludeRadioButton))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(parentScrollPane, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form index 9d052d67d8..8cd6bc5eed 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form @@ -33,7 +33,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index 8014444108..2284ded074 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -59,7 +59,7 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(crFrequencyScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(crFrequencyScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form index d3a628f715..ab4b81577b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form @@ -7,8 +7,7 @@ - - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index 27ca9feb64..957dee4dca 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -43,8 +43,7 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { sizeList = new javax.swing.JList<>(); org.openide.awt.Mnemonics.setLocalizedText(sizeCheckbox, org.openide.util.NbBundle.getMessage(SizeFilterPanel.class, "SizeFilterPanel.sizeCheckbox.text")); // NOI18N - sizeCheckbox.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); - sizeCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); + sizeCheckbox.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); sizeCheckbox.setMaximumSize(new java.awt.Dimension(103, 25)); sizeCheckbox.setMinimumSize(new java.awt.Dimension(103, 25)); sizeCheckbox.setPreferredSize(new java.awt.Dimension(103, 25)); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java index bf4ffde7be..1bfe1fea6e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java @@ -88,4 +88,9 @@ public class UserCreatedFilterPanel extends AbstractDiscoveryFilterPanel { } return null; } + + @Override + boolean hasPanel() { + return false; + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form index 5f3eab1a5f..e7f145d8db 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form @@ -11,18 +11,39 @@ +
- - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index 79df6ec5a4..1c839e445a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -20,21 +20,23 @@ final class VideoFilterPanel extends AbstractFiltersPanel { * Creates new form VideoFilterPanel */ VideoFilterPanel() { + super(); initComponents(); - addFilter(new SizeFilterPanel(FileSearchData.FileType.VIDEO), true, null); - addFilter(new DataSourceFilterPanel(), false, null); + addFilter(new SizeFilterPanel(FileSearchData.FileType.VIDEO), true, null, 0); + addFilter(new DataSourceFilterPanel(), false, null, 0); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { pastOccurrencesIndices = new int[]{0}; } else { pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; } - addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices); - addFilter(new UserCreatedFilterPanel(), false, null); - addFilter(new HashSetFilterPanel(), false, null); - addFilter(new InterestingItemsFilterPanel(), false, null); - addFilter(new ObjectDetectedFilterPanel(), false, null); - addFilter(new ParentFolderFilterPanel(), false, null); + addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices, 0); + addFilter(new UserCreatedFilterPanel(), false, null, 0); + addFilter(new HashSetFilterPanel(), false, null, 0); + addFilter(new InterestingItemsFilterPanel(), false, null, 0); + addFilter(new ObjectDetectedFilterPanel(), false, null, 0); + addFilter(new ParentFolderFilterPanel(), false, null, 0); + addPanelsToScrollPane(videoFiltersSplitPane); } /** @@ -46,16 +48,20 @@ final class VideoFilterPanel extends AbstractFiltersPanel { // //GEN-BEGIN:initComponents private void initComponents() { - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 400, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 300, Short.MAX_VALUE) - ); + videoFiltersScrollPane = new javax.swing.JScrollPane(); + videoFiltersPanel = new javax.swing.JPanel(); + videoFiltersSplitPane = new javax.swing.JSplitPane(); + + setLayout(new java.awt.BorderLayout()); + + videoFiltersPanel.setLayout(new java.awt.BorderLayout()); + + videoFiltersSplitPane.setResizeWeight(0.5); + videoFiltersPanel.add(videoFiltersSplitPane, java.awt.BorderLayout.CENTER); + + videoFiltersScrollPane.setViewportView(videoFiltersPanel); + + add(videoFiltersScrollPane, java.awt.BorderLayout.CENTER); }// //GEN-END:initComponents @Override FileSearchData.FileType getFileType() { @@ -63,5 +69,9 @@ final class VideoFilterPanel extends AbstractFiltersPanel { } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel videoFiltersPanel; + private javax.swing.JScrollPane videoFiltersScrollPane; + private javax.swing.JSplitPane videoFiltersSplitPane; // End of variables declaration//GEN-END:variables + } From df7e9a80271371ba16f8e09cccc6a284780dd98a Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 2 Jun 2020 17:36:13 -0400 Subject: [PATCH 20/51] 6305 resizing changes --- .../discovery/AbstractFiltersPanel.java | 2 ++ .../discovery/DataSourceFilterPanel.form | 22 ++++++++++-- .../discovery/DataSourceFilterPanel.java | 11 ++++-- .../autopsy/discovery/HashSetFilterPanel.form | 14 +++++++- .../autopsy/discovery/HashSetFilterPanel.java | 6 +++- .../autopsy/discovery/ImageFilterPanel.java | 1 + .../InterestingItemsFilterPanel.form | 19 +++++++++- .../InterestingItemsFilterPanel.java | 8 ++++- .../discovery/ObjectDetectedFilterPanel.form | 20 +++++------ .../discovery/ObjectDetectedFilterPanel.java | 16 ++++----- .../discovery/ParentFolderFilterPanel.form | 35 ++++++++++++++++--- .../discovery/ParentFolderFilterPanel.java | 22 ++++++++---- .../discovery/PastOccurrencesFilterPanel.form | 19 +++++++++- .../discovery/PastOccurrencesFilterPanel.java | 10 ++++-- .../autopsy/discovery/SizeFilterPanel.form | 17 +++++---- .../autopsy/discovery/SizeFilterPanel.java | 15 ++++---- .../discovery/UserCreatedFilterPanel.form | 14 +++++++- .../discovery/UserCreatedFilterPanel.java | 6 +++- 18 files changed, 200 insertions(+), 57 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 9b3aca9923..93e3d4b959 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -91,6 +91,8 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li final void addPanelsToScrollPane(JSplitPane splitPane) { splitPane.setLeftComponent(firstColumnPanel); splitPane.setRightComponent(secondColumnPanel); + validate(); + repaint(); } final synchronized void clearFilters() { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form index 3edf84398e..44ea93cd5a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.form @@ -7,6 +7,15 @@ + + + + + + + + +
@@ -14,9 +23,13 @@
- - + + + + + + @@ -47,6 +60,11 @@
+ + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index 84d7ef4656..c0a72c59f1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -48,13 +48,20 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { dataSourceList = new javax.swing.JList<>(); org.openide.awt.Mnemonics.setLocalizedText(dataSourceCheckbox, org.openide.util.NbBundle.getMessage(DataSourceFilterPanel.class, "DataSourceFilterPanel.dataSourceCheckbox.text")); // NOI18N + dataSourceCheckbox.setMaximumSize(new java.awt.Dimension(150, 25)); + dataSourceCheckbox.setMinimumSize(new java.awt.Dimension(150, 25)); + dataSourceCheckbox.setPreferredSize(new java.awt.Dimension(150, 25)); dataSourceCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { dataSourceCheckboxActionPerformed(evt); } }); - setPreferredSize(new java.awt.Dimension(300, 60)); + setMinimumSize(new java.awt.Dimension(250, 30)); + setPreferredSize(new java.awt.Dimension(250, 30)); + setRequestFocusEnabled(false); + + dataSourceScrollPane.setPreferredSize(new java.awt.Dimension(27, 27)); dataSourceList.setModel(new DefaultListModel()); dataSourceList.setEnabled(false); @@ -70,7 +77,7 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(dataSourceScrollPane) + .addComponent(dataSourceScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0)) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form index 4e9c906685..8f83bc0e77 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.form @@ -7,6 +7,15 @@ + + + + + + + + + @@ -14,8 +23,11 @@
+ + + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index e8c97f8a59..9b630c61cf 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -70,13 +70,17 @@ public class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { hashSetList = new javax.swing.JList<>(); org.openide.awt.Mnemonics.setLocalizedText(hashSetCheckbox, org.openide.util.NbBundle.getMessage(HashSetFilterPanel.class, "HashSetFilterPanel.hashSetCheckbox.text")); // NOI18N + hashSetCheckbox.setMaximumSize(new java.awt.Dimension(150, 25)); + hashSetCheckbox.setMinimumSize(new java.awt.Dimension(150, 25)); + hashSetCheckbox.setPreferredSize(new java.awt.Dimension(150, 25)); hashSetCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { hashSetCheckboxActionPerformed(evt); } }); - setPreferredSize(new java.awt.Dimension(300, 60)); + setMinimumSize(new java.awt.Dimension(250, 30)); + setPreferredSize(new java.awt.Dimension(250, 30)); hashSetList.setModel(new DefaultListModel()); hashSetList.setEnabled(false); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index d404af1b66..4b3c6da72f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -39,6 +39,7 @@ final class ImageFilterPanel extends AbstractFiltersPanel { addFilter(new DataSourceFilterPanel(), false, null, 1); addFilter(new ParentFolderFilterPanel(), false, null, 1); addPanelsToScrollPane(imageFiltersSplitPane); + } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form index fba8295349..ff3b7cea10 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.form @@ -7,6 +7,15 @@ + + + + + + + + + @@ -14,8 +23,11 @@
+ + + - + @@ -44,6 +56,11 @@
+ + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java index d83e75e964..1339289441 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java @@ -68,13 +68,19 @@ public class InterestingItemsFilterPanel extends AbstractDiscoveryFilterPanel { interestingItemsList = new javax.swing.JList<>(); org.openide.awt.Mnemonics.setLocalizedText(interestingItemsCheckbox, org.openide.util.NbBundle.getMessage(InterestingItemsFilterPanel.class, "InterestingItemsFilterPanel.interestingItemsCheckbox.text")); // NOI18N + interestingItemsCheckbox.setMaximumSize(new java.awt.Dimension(150, 25)); + interestingItemsCheckbox.setMinimumSize(new java.awt.Dimension(150, 25)); + interestingItemsCheckbox.setPreferredSize(new java.awt.Dimension(150, 25)); interestingItemsCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { interestingItemsCheckboxActionPerformed(evt); } }); - setPreferredSize(new java.awt.Dimension(300, 60)); + setMinimumSize(new java.awt.Dimension(250, 30)); + setPreferredSize(new java.awt.Dimension(250, 30)); + + interestingItemsScrollPane.setPreferredSize(new java.awt.Dimension(27, 27)); interestingItemsList.setModel(new DefaultListModel()); interestingItemsList.setEnabled(false); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form index 0244e0ece0..6c6953c55f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.form @@ -7,17 +7,15 @@ - - - + - + - + @@ -29,10 +27,10 @@ - + - + @@ -62,12 +60,9 @@ - - - - + @@ -82,6 +77,9 @@ + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java index 1381869cc1..6886226007 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java @@ -67,12 +67,10 @@ public class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { objectsList = new javax.swing.JList<>(); org.openide.awt.Mnemonics.setLocalizedText(objectsCheckbox, org.openide.util.NbBundle.getMessage(ObjectDetectedFilterPanel.class, "ObjectDetectedFilterPanel.text")); // NOI18N - objectsCheckbox.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); - objectsCheckbox.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); - objectsCheckbox.setMaximumSize(new java.awt.Dimension(103, 25)); - objectsCheckbox.setMinimumSize(new java.awt.Dimension(103, 25)); + objectsCheckbox.setMaximumSize(new java.awt.Dimension(150, 25)); + objectsCheckbox.setMinimumSize(new java.awt.Dimension(150, 25)); objectsCheckbox.setName(""); // NOI18N - objectsCheckbox.setPreferredSize(new java.awt.Dimension(103, 25)); + objectsCheckbox.setPreferredSize(new java.awt.Dimension(150, 25)); objectsCheckbox.setVerticalAlignment(javax.swing.SwingConstants.TOP); objectsCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.TOP); objectsCheckbox.addActionListener(new java.awt.event.ActionListener() { @@ -81,15 +79,15 @@ public class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { } }); - setMinimumSize(new java.awt.Dimension(200, 30)); - setPreferredSize(new java.awt.Dimension(300, 60)); + setMinimumSize(new java.awt.Dimension(250, 30)); + setPreferredSize(new java.awt.Dimension(250, 30)); - objectsScrollPane.setMinimumSize(new java.awt.Dimension(0, 0)); objectsScrollPane.setName(""); // NOI18N - objectsScrollPane.setPreferredSize(new java.awt.Dimension(260, 50)); + objectsScrollPane.setPreferredSize(new java.awt.Dimension(27, 27)); objectsList.setModel(new DefaultListModel()); objectsList.setEnabled(false); + objectsList.setMaximumSize(new java.awt.Dimension(32767, 32767)); objectsList.setVisibleRowCount(2); objectsScrollPane.setViewportView(objectsList); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form index 5348e82bbc..c35bc16cb4 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.form @@ -7,6 +7,15 @@ + + + + + + + + + @@ -17,12 +26,24 @@ + + + + + + + + + + + + - + @@ -55,7 +76,7 @@ - + @@ -68,8 +89,8 @@ - - + + @@ -85,12 +106,18 @@ +
+ + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index 5631ae2242..f8be6a58a6 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -65,6 +65,9 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { parentTextField = new javax.swing.JTextField(); org.openide.awt.Mnemonics.setLocalizedText(parentCheckbox, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.parentCheckbox.text_1")); // NOI18N + parentCheckbox.setMaximumSize(new java.awt.Dimension(150, 25)); + parentCheckbox.setMinimumSize(new java.awt.Dimension(150, 25)); + parentCheckbox.setPreferredSize(new java.awt.Dimension(150, 25)); parentCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { parentCheckboxActionPerformed(evt); @@ -72,8 +75,14 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { }); org.openide.awt.Mnemonics.setLocalizedText(parentLabel, org.openide.util.NbBundle.getMessage(ParentFolderFilterPanel.class, "ParentFolderFilterPanel.parentLabel.text_1")); // NOI18N + parentLabel.setMaximumSize(new java.awt.Dimension(150, 25)); + parentLabel.setMinimumSize(new java.awt.Dimension(150, 25)); + parentLabel.setPreferredSize(new java.awt.Dimension(150, 25)); - setPreferredSize(new java.awt.Dimension(314, 170)); + setMinimumSize(new java.awt.Dimension(250, 120)); + setPreferredSize(new java.awt.Dimension(250, 120)); + + parentScrollPane.setPreferredSize(new java.awt.Dimension(27, 27)); parentList.setModel(new DefaultListModel()); parentList.setEnabled(false); @@ -137,9 +146,9 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { .addComponent(substringRadioButton) .addComponent(excludeRadioButton))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(parentScrollPane, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(parentScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() - .addComponent(parentTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE) + .addComponent(parentTextField) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -148,8 +157,8 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(parentScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(parentScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(fullRadioButton) .addComponent(substringRadioButton)) @@ -161,7 +170,8 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(parentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, 0)) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form index 8cd6bc5eed..37ea6de900 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.form @@ -7,6 +7,15 @@ + + + + + + + + + @@ -14,8 +23,11 @@ + + + - + @@ -47,6 +59,11 @@
+ + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index 2284ded074..ea4357f542 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -42,13 +42,19 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { crFrequencyList = new javax.swing.JList<>(); org.openide.awt.Mnemonics.setLocalizedText(pastOccurrencesCheckbox, org.openide.util.NbBundle.getMessage(PastOccurrencesFilterPanel.class, "PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text")); // NOI18N + pastOccurrencesCheckbox.setMaximumSize(new java.awt.Dimension(150, 25)); + pastOccurrencesCheckbox.setMinimumSize(new java.awt.Dimension(150, 25)); + pastOccurrencesCheckbox.setPreferredSize(new java.awt.Dimension(150, 25)); pastOccurrencesCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pastOccurrencesCheckboxActionPerformed(evt); } }); - setPreferredSize(new java.awt.Dimension(300, 60)); + setMinimumSize(new java.awt.Dimension(250, 30)); + setPreferredSize(new java.awt.Dimension(250, 30)); + + crFrequencyScrollPane.setPreferredSize(new java.awt.Dimension(27, 27)); crFrequencyList.setModel(new DefaultListModel()); crFrequencyList.setEnabled(false); @@ -64,7 +70,7 @@ public class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(crFrequencyScrollPane) + .addComponent(crFrequencyScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0)) ); }// //GEN-END:initComponents diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form index ab4b81577b..1b77a4329e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.form @@ -7,15 +7,14 @@ - - + - + - + @@ -27,10 +26,11 @@ - + + - + @@ -64,7 +64,7 @@ - + @@ -79,6 +79,9 @@ + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index 957dee4dca..c2e7d56377 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -43,10 +43,9 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { sizeList = new javax.swing.JList<>(); org.openide.awt.Mnemonics.setLocalizedText(sizeCheckbox, org.openide.util.NbBundle.getMessage(SizeFilterPanel.class, "SizeFilterPanel.sizeCheckbox.text")); // NOI18N - sizeCheckbox.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); - sizeCheckbox.setMaximumSize(new java.awt.Dimension(103, 25)); - sizeCheckbox.setMinimumSize(new java.awt.Dimension(103, 25)); - sizeCheckbox.setPreferredSize(new java.awt.Dimension(103, 25)); + sizeCheckbox.setMaximumSize(new java.awt.Dimension(150, 25)); + sizeCheckbox.setMinimumSize(new java.awt.Dimension(150, 25)); + sizeCheckbox.setPreferredSize(new java.awt.Dimension(150, 25)); sizeCheckbox.setVerticalAlignment(javax.swing.SwingConstants.TOP); sizeCheckbox.setVerticalTextPosition(javax.swing.SwingConstants.TOP); sizeCheckbox.addActionListener(new java.awt.event.ActionListener() { @@ -55,13 +54,15 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { } }); - setMinimumSize(new java.awt.Dimension(200, 30)); - setPreferredSize(new java.awt.Dimension(300, 60)); + setMinimumSize(new java.awt.Dimension(250, 30)); + setName(""); // NOI18N + setPreferredSize(new java.awt.Dimension(250, 30)); - sizeScrollPane.setPreferredSize(new java.awt.Dimension(300, 60)); + sizeScrollPane.setPreferredSize(new java.awt.Dimension(27, 27)); sizeList.setModel(new DefaultListModel()); sizeList.setEnabled(false); + sizeList.setMaximumSize(new java.awt.Dimension(32767, 32767)); sizeList.setVisibleRowCount(5); sizeScrollPane.setViewportView(sizeList); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form index 9ee6b00dfb..520bf47dc3 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.form @@ -7,12 +7,24 @@ + + + + + + + + + + + + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java index 1bfe1fea6e..fdd74a91b9 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java @@ -36,8 +36,12 @@ public class UserCreatedFilterPanel extends AbstractDiscoveryFilterPanel { userCreatedCheckbox = new javax.swing.JCheckBox(); org.openide.awt.Mnemonics.setLocalizedText(userCreatedCheckbox, org.openide.util.NbBundle.getMessage(UserCreatedFilterPanel.class, "UserCreatedFilterPanel.userCreatedCheckbox.text_1")); // NOI18N + userCreatedCheckbox.setMaximumSize(new java.awt.Dimension(150, 25)); + userCreatedCheckbox.setMinimumSize(new java.awt.Dimension(150, 25)); + userCreatedCheckbox.setPreferredSize(new java.awt.Dimension(150, 25)); - setPreferredSize(new java.awt.Dimension(300, 42)); + setMinimumSize(new java.awt.Dimension(250, 30)); + setPreferredSize(new java.awt.Dimension(250, 30)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); From 241ffd78990fc10797a407a85ff718a5956eebe3 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 08:03:15 -0400 Subject: [PATCH 21/51] 6305 clean up copyright and access --- .../AbstractDiscoveryFilterPanel.java | 24 +++++-- .../discovery/AbstractFiltersPanel.java | 24 +++++-- .../autopsy/discovery/Bundle.properties | 2 + .../discovery/Bundle.properties-MERGED | 2 + .../discovery/DataSourceFilterPanel.java | 30 +++++--- .../autopsy/discovery/DetailsPanel.java | 9 +-- .../autopsy/discovery/DiscoveryDialog.form | 12 +++- .../autopsy/discovery/DiscoveryDialog.java | 13 +++- .../discovery/DiscoveryExtractAction.java | 4 +- .../discovery/DiscoveryTopComponent.form | 40 +++++++++++ .../discovery/DiscoveryTopComponent.java | 38 +++++++++- .../discovery/DocumentFilterPanel.form | 1 + .../discovery/DocumentFilterPanel.java | 24 +++++-- .../autopsy/discovery/DocumentPanel.java | 4 +- .../discovery/DocumentPreviewViewer.java | 4 +- .../autopsy/discovery/DocumentWrapper.java | 2 +- .../discovery/FileSearchException.java | 19 ++--- .../autopsy/discovery/GroupListPanel.java | 26 ++++--- .../autopsy/discovery/HashSetFilterPanel.java | 31 +++++--- .../autopsy/discovery/ImageFilterPanel.java | 23 ++++-- .../discovery/ImageThumbnailPanel.java | 4 +- .../discovery/ImageThumbnailViewer.java | 4 +- .../discovery/ImageThumbnailWrapper.java | 2 +- .../InterestingItemsFilterPanel.java | 28 +++++--- .../discovery/ObjectDetectedFilterPanel.java | 27 ++++--- .../discovery/ParentFolderFilterPanel.java | 27 ++++--- .../discovery/PastOccurrencesFilterPanel.java | 27 ++++--- .../autopsy/discovery/ResultsPanel.java | 10 ++- .../autopsy/discovery/SizeFilterPanel.java | 29 +++++--- .../autopsy/discovery/SwingAnimator.java | 71 +++++++------------ .../discovery/SwingAnimatorCallback.java | 28 +++++--- .../discovery/UserCreatedFilterPanel.java | 27 ++++--- .../autopsy/discovery/VideoFilterPanel.java | 33 +++++---- .../discovery/VideoThumbnailViewer.java | 4 +- 34 files changed, 437 insertions(+), 216 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java index 558a94fef2..a7f9bcbd28 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.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 + * + * Copyright 2020 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.discovery; @@ -11,10 +24,7 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.event.ListSelectionListener; -/** - * - * @author wschaefer - */ + abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 93e3d4b959..b8f6ba9e5a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.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 + * + * Copyright 2020 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.discovery; @@ -18,10 +31,7 @@ import javax.swing.JSplitPane; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -/** - * - * @author wschaefer - */ + abstract class AbstractFiltersPanel extends JPanel implements ActionListener, ListSelectionListener { private boolean isInitialized = false; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index 3254b0c28c..908acda3eb 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -98,3 +98,5 @@ DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= +DiscoveryTopComponent.jButton1.text=New Search +DiscoveryDialog.jLabel1.text=Step 1: Choose Result Type diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 123c679d00..87c431d20d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -248,6 +248,8 @@ DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= +DiscoveryTopComponent.jButton1.text=New Search +DiscoveryDialog.jLabel1.text=Step 1: Choose Result Type VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index c0a72c59f1..59ccc90055 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.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 + * + * Copyright 2020 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.discovery; @@ -17,10 +30,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.DataSource; import org.sleuthkit.datamodel.TskCoreException; -/** - * - * @author wschaefer - */ + final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; @@ -94,7 +104,7 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { // End of variables declaration//GEN-END:variables @Override - public void configurePanel(boolean selected, int[] indicesSelected) { + void configurePanel(boolean selected, int[] indicesSelected) { dataSourceCheckbox.setSelected(selected); if (dataSourceCheckbox.isEnabled() && dataSourceCheckbox.isSelected()) { dataSourceScrollPane.setEnabled(true); @@ -109,12 +119,12 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { } @Override - public JCheckBox getCheckbox() { + JCheckBox getCheckbox() { return dataSourceCheckbox; } @Override - public JLabel getAdditionalLabel() { + JLabel getAdditionalLabel() { return null; } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java index 46be9cca8c..750d5a7277 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java @@ -44,11 +44,8 @@ import org.sleuthkit.autopsy.timeline.actions.ViewFileInTimelineAction; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException; -/** - * - * @author wschaefer - */ -public class DetailsPanel extends javax.swing.JPanel { + +final class DetailsPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; @@ -59,7 +56,7 @@ public class DetailsPanel extends javax.swing.JPanel { /** * Creates new form DetailsPanel */ - public DetailsPanel() { + DetailsPanel() { initComponents(); dataContentPanel = DataContentPanel.createInstance(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 913e82682d..bc0f98d9c8 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -44,7 +44,9 @@ - + + + @@ -62,6 +64,7 @@ + @@ -146,6 +149,13 @@ + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 910f06f6d6..a70df71418 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -50,7 +50,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { this(null, true); } - public static synchronized DiscoveryDialog getDiscoveryDialogInstance() { + static synchronized DiscoveryDialog getDiscoveryDialogInstance() { if (discoveryDialog == null) { discoveryDialog = new DiscoveryDialog(); } @@ -145,6 +145,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton = new javax.swing.JButton(); videosButton = new javax.swing.JButton(); documentsButton = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); searchButton = new javax.swing.JButton(); errorLabel = new javax.swing.JLabel(); @@ -201,12 +202,16 @@ final class DiscoveryDialog extends javax.swing.JDialog { } }); + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.jLabel1.text")); // NOI18N + javax.swing.GroupLayout toolBarPanelLayout = new javax.swing.GroupLayout(toolBarPanel); toolBarPanel.setLayout(toolBarPanelLayout); toolBarPanelLayout.setHorizontalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap(239, Short.MAX_VALUE) + .addContainerGap(55, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -221,7 +226,8 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(documentsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(documentsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1)) .addContainerGap()) ); @@ -472,6 +478,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { private javax.swing.JComboBox groupByCombobox; private javax.swing.JComboBox groupSortingComboBox; private javax.swing.JButton imagesButton; + private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JComboBox orderByCombobox; private javax.swing.JButton searchButton; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryExtractAction.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryExtractAction.java index 171b7530ee..acaf0ccc99 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryExtractAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryExtractAction.java @@ -29,7 +29,7 @@ import org.sleuthkit.datamodel.AbstractFile; /** * Extracts AbstractFiles to a location selected by the user. */ -public final class DiscoveryExtractAction extends AbstractAction { +final class DiscoveryExtractAction extends AbstractAction { private static final long serialVersionUID = 1L; private final Collection files = new HashSet<>(); @@ -40,7 +40,7 @@ public final class DiscoveryExtractAction extends AbstractAction { * * @param selectedFiles The files to extract from the current case. */ - public DiscoveryExtractAction(Collection selectedFiles) { + DiscoveryExtractAction(Collection selectedFiles) { super(NbBundle.getMessage(DiscoveryExtractAction.class, "DiscoveryExtractAction.title.extractFiles.text")); files.addAll(selectedFiles); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index b5cffa4a96..24b8cea0f0 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -60,5 +60,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index 1fcf108c9f..ca3021efd0 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -104,8 +104,7 @@ public final class DiscoveryTopComponent extends TopComponent { } private void cancelCurrentSearch() { - final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance(); - discDialog.cancelSearch(); + DiscoveryDialog.getDiscoveryDialogInstance().cancelSearch(); } /** @@ -119,6 +118,8 @@ public final class DiscoveryTopComponent extends TopComponent { mainSplitPane = new javax.swing.JSplitPane(); rightSplitPane = new AnimatedSplitPane(); + jPanel1 = new javax.swing.JPanel(); + jButton1 = new javax.swing.JButton(); setMinimumSize(new java.awt.Dimension(199, 200)); setPreferredSize(new java.awt.Dimension(1100, 700)); @@ -133,8 +134,39 @@ public final class DiscoveryTopComponent extends TopComponent { mainSplitPane.setRightComponent(rightSplitPane); add(mainSplitPane, java.awt.BorderLayout.CENTER); + + org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.jButton1.text")); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton1) + .addContainerGap(987, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButton1) + .addContainerGap()) + ); + + add(jPanel1, java.awt.BorderLayout.PAGE_START); }// //GEN-END:initComponents + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + close(); + new OpenDiscoveryAction().actionPerformed(evt); + }//GEN-LAST:event_jButton1ActionPerformed + @Override public List availableModes(List modes) { /* @@ -220,6 +252,8 @@ public final class DiscoveryTopComponent extends TopComponent { } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JPanel jPanel1; private javax.swing.JSplitPane mainSplitPane; private javax.swing.JSplitPane rightSplitPane; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form index 2fd3b2bfc8..b83c2f324f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form @@ -11,6 +11,7 @@ + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index d4834b8c0c..46f05b199d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -1,16 +1,26 @@ /* - * 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 + * + * Copyright 2020 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.discovery; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; -/** - * - * @author wschaefer - */ + final class DocumentFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java index b76f835659..4084d1e082 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java @@ -33,7 +33,7 @@ import org.sleuthkit.autopsy.corecomponents.AutoWrappingJTextPane; /** * Class which displays a preview and details about a document. */ -public class DocumentPanel extends javax.swing.JPanel implements ListCellRenderer { +class DocumentPanel extends javax.swing.JPanel implements ListCellRenderer { private static final long serialVersionUID = 1L; private static final Color SELECTION_COLOR = new Color(0, 120, 215); @@ -42,7 +42,7 @@ public class DocumentPanel extends javax.swing.JPanel implements ListCellRendere /** * Creates new form DocumentPanel */ - public DocumentPanel() { + DocumentPanel() { initComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.java index 057ee777aa..beef70f08f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPreviewViewer.java @@ -27,7 +27,7 @@ import org.sleuthkit.datamodel.AbstractFile; /** * A JPanel to display document previews. */ -public class DocumentPreviewViewer extends javax.swing.JPanel { +final class DocumentPreviewViewer extends javax.swing.JPanel { private static final long serialVersionUID = 1L; private final DefaultListModel documentListModel = new DefaultListModel<>(); @@ -35,7 +35,7 @@ public class DocumentPreviewViewer extends javax.swing.JPanel { /** * Creates new form DocumentViewer */ - public DocumentPreviewViewer() { + DocumentPreviewViewer() { initComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentWrapper.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentWrapper.java index dd35604a82..02a2b0530e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentWrapper.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentWrapper.java @@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.textsummarizer.TextSummary; * Class to wrap all the information necessary for a document summary to be * displayed. */ -public class DocumentWrapper { +final class DocumentWrapper { private TextSummary summary; private final ResultFile resultFile; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java index 1b2b8fdd2a..30dcb20ec1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java @@ -21,25 +21,26 @@ package org.sleuthkit.autopsy.discovery; /** * Exception type used for FileSearch */ -public class FileSearchException extends Exception { +final public class FileSearchException extends Exception { + private static final long serialVersionUID = 1L; - + /** * Create exception from a string - * - * @param message + * + * @param message */ - public FileSearchException(String message) { + FileSearchException(String message) { super(message); } - + /** * Create exception for a string and cause - * + * * @param message - * @param cause + * @param cause */ - public FileSearchException(String message, Throwable cause) { + FileSearchException(String message, Throwable cause) { super(message, cause); } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java index 46e29ab524..a2689db979 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java @@ -19,12 +19,14 @@ package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.Subscribe; +import java.awt.Cursor; import java.util.List; import java.util.Map; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JList; import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; @@ -32,7 +34,7 @@ import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; /** * Panel to display the list of groups which are provided by a search */ -class GroupListPanel extends javax.swing.JPanel { +final class GroupListPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; private FileType resultType = null; @@ -48,6 +50,9 @@ class GroupListPanel extends javax.swing.JPanel { */ GroupListPanel() { initComponents(); + SwingUtilities.invokeLater(() -> { + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); } /** @@ -77,14 +82,17 @@ class GroupListPanel extends javax.swing.JPanel { groupSort = searchCompleteEvent.getGroupSort(); fileSortMethod = searchCompleteEvent.getFileSort(); groupKeyList.setListData(groupMap.keySet().toArray(new GroupKey[groupMap.keySet().size()])); - if (groupKeyList.getModel().getSize() > 0) { - groupKeyList.setSelectedIndex(0); - } else { - JOptionPane.showMessageDialog(DiscoveryTopComponent.getTopComponent(), - Bundle.GroupsListPanel_noResults_message_text(), - Bundle.GroupsListPanel_noResults_title_text(), - JOptionPane.INFORMATION_MESSAGE); - } + SwingUtilities.invokeLater(() -> { + if (groupKeyList.getModel().getSize() > 0) { + groupKeyList.setSelectedIndex(0); + } else { + JOptionPane.showMessageDialog(DiscoveryTopComponent.getTopComponent(), + Bundle.GroupsListPanel_noResults_message_text(), + Bundle.GroupsListPanel_noResults_title_text(), + JOptionPane.INFORMATION_MESSAGE); + } + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index 9b630c61cf..b39fda355a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -1,3 +1,21 @@ +/* + * Autopsy + * + * Copyright 2020 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.discovery; import java.util.List; @@ -11,16 +29,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; -/* - * 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. - */ -/** - * - * @author wschaefer - */ -public class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { +final class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(HashSetFilterPanel.class.getName()); @@ -28,7 +37,7 @@ public class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { /** * Creates new form HashSetFilterPaenl */ - public HashSetFilterPanel() { + HashSetFilterPanel() { initComponents(); setUpHashFilter(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index 4b3c6da72f..393ece054b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -1,16 +1,25 @@ /* - * 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 + * + * Copyright 2020 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.discovery; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; -/** - * - * @author wschaefer - */ final class ImageFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java index 7e44cd345c..6d861d06e9 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java @@ -32,7 +32,7 @@ import org.openide.util.NbBundle; /** * Class which displays a thumbnail and information for an image file. */ -public class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellRenderer { +final class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellRenderer { private static final long serialVersionUID = 1L; private static final Color SELECTION_COLOR = new Color(0, 120, 215); @@ -41,7 +41,7 @@ public class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellR /** * Creates new form ImageThumbnailPanel */ - public ImageThumbnailPanel() { + ImageThumbnailPanel() { initComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java index 5039464ba9..0bf7eeac31 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java @@ -28,7 +28,7 @@ import org.sleuthkit.datamodel.AbstractFile; * A JPanel to display image thumbnails. * */ -public class ImageThumbnailViewer extends javax.swing.JPanel { +final class ImageThumbnailViewer extends javax.swing.JPanel { private static final long serialVersionUID = 1L; @@ -37,7 +37,7 @@ public class ImageThumbnailViewer extends javax.swing.JPanel { /** * Creates new form ImageThumbnailViewer */ - public ImageThumbnailViewer() { + ImageThumbnailViewer() { initComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailWrapper.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailWrapper.java index 09eeb913ca..b4e7bb0b01 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailWrapper.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailWrapper.java @@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.coreutils.ImageUtils; * Class to wrap all the information necessary for an image thumbnail to be * displayed. */ -public class ImageThumbnailWrapper { +final class ImageThumbnailWrapper { private Image thumbnail; private final ResultFile resultFile; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java index 1339289441..dc8a7fe670 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.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 + * + * Copyright 2020 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.discovery; @@ -16,11 +29,8 @@ import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; -/** - * - * @author wschaefer - */ -public class InterestingItemsFilterPanel extends AbstractDiscoveryFilterPanel { + +final class InterestingItemsFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(InterestingItemsFilterPanel.class.getName()); @@ -28,7 +38,7 @@ public class InterestingItemsFilterPanel extends AbstractDiscoveryFilterPanel { /** * Creates new form InterestingItemsFilterPanel */ - public InterestingItemsFilterPanel() { + InterestingItemsFilterPanel() { initComponents(); setUpInterestingItemsFilter(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java index 6886226007..e89b1c5416 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.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 + * + * Copyright 2020 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.discovery; @@ -16,11 +29,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; -/** - * - * @author wschaefer - */ -public class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { +final class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(ObjectDetectedFilterPanel.class.getName()); @@ -28,7 +37,7 @@ public class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { /** * Creates new form ObjectDetectedFilter */ - public ObjectDetectedFilterPanel() { + ObjectDetectedFilterPanel() { initComponents(); setUpObjectFilter(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index f8be6a58a6..766a7e9cd2 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.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 + * + * Copyright 2020 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.discovery; @@ -13,11 +26,7 @@ import javax.swing.JLabel; import javax.swing.JList; import org.sleuthkit.autopsy.discovery.FileSearchFiltering.ParentSearchTerm; -/** - * - * @author wschaefer - */ -public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { +final class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private DefaultListModel parentListModel; @@ -26,7 +35,7 @@ public class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { /** * Creates new form ParentFolderFilterPanel */ - public ParentFolderFilterPanel() { + ParentFolderFilterPanel() { initComponents(); setUpParentPathFilter(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index ea4357f542..39c122ab04 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.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 + * + * Copyright 2020 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.discovery; @@ -12,18 +25,14 @@ import javax.swing.JList; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; -/** - * - * @author wschaefer - */ -public class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { +final class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; /** * Creates new form PastOccurrencesFilterPanel */ - public PastOccurrencesFilterPanel() { + PastOccurrencesFilterPanel() { initComponents(); setUpFrequencyFilter(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 94883b9ea8..908461c478 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -19,6 +19,7 @@ package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.Subscribe; +import java.awt.Cursor; import java.awt.Image; import java.awt.event.ItemEvent; import java.util.ArrayList; @@ -43,7 +44,7 @@ import org.sleuthkit.autopsy.textsummarizer.TextSummary; * Panel for displaying of Discovery results and handling the paging of those * results. */ -public class ResultsPanel extends javax.swing.JPanel { +final class ResultsPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(ResultsPanel.class.getName()); @@ -67,7 +68,7 @@ public class ResultsPanel extends javax.swing.JPanel { */ @Messages({"ResultsPanel.viewFileInDir.name=View File in Directory", "ResultsPanel.openInExternalViewer.name=Open in External Viewer"}) - public ResultsPanel() { + ResultsPanel() { initComponents(); imageThumbnailViewer = new ImageThumbnailViewer(); videoThumbnailViewer = new VideoThumbnailViewer(); @@ -108,7 +109,9 @@ public class ResultsPanel extends javax.swing.JPanel { } } }); - + SwingUtilities.invokeLater(() -> { + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); } /** @@ -254,6 +257,7 @@ public class ResultsPanel extends javax.swing.JPanel { resultType = groupSelectedEvent.getResultType(); groupSize = groupSelectedEvent.getGroupSize(); setPage(0); + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index c2e7d56377..8e9275478e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.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 + * + * Copyright 2020 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.discovery; @@ -13,10 +26,6 @@ import javax.swing.JLabel; import javax.swing.JList; import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; -/** - * - * @author wschaefer - */ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; @@ -92,7 +101,7 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { // End of variables declaration//GEN-END:variables @Override - public void configurePanel(boolean selected, int[] indicesSelected) { + void configurePanel(boolean selected, int[] indicesSelected) { sizeCheckbox.setSelected(selected); if (sizeCheckbox.isEnabled() && sizeCheckbox.isSelected()) { sizeScrollPane.setEnabled(true); @@ -107,12 +116,12 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { } @Override - public JCheckBox getCheckbox() { + JCheckBox getCheckbox() { return sizeCheckbox; } @Override - public JLabel getAdditionalLabel() { + JLabel getAdditionalLabel() { return null; } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java index d744f5c3d8..f01acc0d93 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.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 + * + * Copyright 2020 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.discovery; @@ -13,13 +26,13 @@ import javax.swing.Timer; * * Class to animate Layouts and Fades for a given component. * - * * @author Greg Cope + * https://www.algosome.com/articles/java-swing-panel-animation.html * * * */ -public final class SwingAnimator { +final class SwingAnimator { //callback object private final SwingAnimatorCallback callback; @@ -39,7 +52,7 @@ public final class SwingAnimator { * @param callback The object to callback to * */ - public SwingAnimator(SwingAnimatorCallback callback) { + SwingAnimator(SwingAnimatorCallback callback) { this(callback, false); @@ -55,7 +68,7 @@ public final class SwingAnimator { * otherwise * */ - public SwingAnimator(SwingAnimatorCallback callback, boolean start) { + SwingAnimator(SwingAnimatorCallback callback, boolean start) { this(callback, INITIAL_DURATION, start); @@ -73,18 +86,12 @@ public final class SwingAnimator { * otherwise * */ - public SwingAnimator(SwingAnimatorCallback callback, int frameTiming, boolean start) { - + SwingAnimator(SwingAnimatorCallback callback, int frameTiming, boolean start) { this.callback = callback; - duration = frameTiming; - if (start) { - start(); - } - } /** @@ -96,10 +103,8 @@ public final class SwingAnimator { * @param frameTiming Timing between each call to callback. * */ - public SwingAnimator(SwingAnimatorCallback callback, int frameTiming) { - + SwingAnimator(SwingAnimatorCallback callback, int frameTiming) { this(callback, frameTiming, false); - } /** @@ -109,16 +114,11 @@ public final class SwingAnimator { * @return * */ - public boolean isRunning() { - + boolean isRunning() { if (timer == null) { - return false; - } - return timer.isRunning(); - } /** @@ -126,14 +126,10 @@ public final class SwingAnimator { * Stops the timer * */ - public void stop() { - + void stop() { if (timer != null) { - timer.stop(); - } - } /** @@ -143,18 +139,13 @@ public final class SwingAnimator { * * stop the timer before beginning a new one. * */ - public void start() { + void start() { if (timer != null && timer.isRunning()) { - stop(); - } - timer = new Timer(duration, new CallbackListener()); - timer.start(); - } /** @@ -169,25 +160,15 @@ public final class SwingAnimator { private class CallbackListener implements ActionListener { @Override - public void actionPerformed(ActionEvent e) { - if (callback.hasTerminated()) { - if (timer == null) { - throw new IllegalStateException("Callback listener should not be fired outside of SwingAnimator timer control"); - } - timer.stop(); - } - callback.callback(SwingAnimator.this); - } - } - + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java index 31a8fdba0d..f36f51a885 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.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 + * + * Copyright 2020 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.discovery; @@ -9,11 +22,10 @@ package org.sleuthkit.autopsy.discovery; * * Callback interface to be notified by a SwingAnimator of a new time frame. * * @author Greg Cope - * - * + * https://www.algosome.com/articles/java-swing-panel-animation.html * */ -public interface SwingAnimatorCallback { +interface SwingAnimatorCallback { /** * @@ -22,7 +34,7 @@ public interface SwingAnimatorCallback { * @param caller * */ - public void callback(Object caller); + void callback(Object caller); /** * @@ -30,6 +42,6 @@ public interface SwingAnimatorCallback { * @return * */ - public boolean hasTerminated(); + boolean hasTerminated(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java index fdd74a91b9..e222fdfc41 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.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 + * + * Copyright 2020 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.discovery; @@ -9,18 +22,14 @@ import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JList; -/** - * - * @author wschaefer - */ -public class UserCreatedFilterPanel extends AbstractDiscoveryFilterPanel { +final class UserCreatedFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; /** * Creates new form UserCreatedFilterPanel */ - public UserCreatedFilterPanel() { + UserCreatedFilterPanel() { initComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index 1c839e445a..1d2c2a5d86 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -1,16 +1,25 @@ /* - * 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 + * + * Copyright 2020 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.discovery; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; -/** - * - * @author wschaefer - */ final class VideoFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; @@ -31,11 +40,11 @@ final class VideoFilterPanel extends AbstractFiltersPanel { pastOccurrencesIndices = new int[]{1, 2, 3, 4, 5, 6, 7}; } addFilter(new PastOccurrencesFilterPanel(), true, pastOccurrencesIndices, 0); - addFilter(new UserCreatedFilterPanel(), false, null, 0); - addFilter(new HashSetFilterPanel(), false, null, 0); - addFilter(new InterestingItemsFilterPanel(), false, null, 0); - addFilter(new ObjectDetectedFilterPanel(), false, null, 0); - addFilter(new ParentFolderFilterPanel(), false, null, 0); + addFilter(new UserCreatedFilterPanel(), false, null, 1); + addFilter(new HashSetFilterPanel(), false, null, 1); + addFilter(new InterestingItemsFilterPanel(), false, null, 1); + addFilter(new ObjectDetectedFilterPanel(), false, null, 1); + addFilter(new ParentFolderFilterPanel(), false, null, 1); addPanelsToScrollPane(videoFiltersSplitPane); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java index 84487ad277..ac0dabbdd8 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java @@ -28,7 +28,7 @@ import org.sleuthkit.datamodel.AbstractFile; * A JPanel to display video thumbnails. * */ -public class VideoThumbnailViewer extends javax.swing.JPanel { +final class VideoThumbnailViewer extends javax.swing.JPanel { private static final long serialVersionUID = 1L; private final DefaultListModel thumbnailListModel = new DefaultListModel<>(); @@ -36,7 +36,7 @@ public class VideoThumbnailViewer extends javax.swing.JPanel { /** * Creates new form VideoThumbnailViewer */ - public VideoThumbnailViewer() { + VideoThumbnailViewer() { initComponents(); } From b356d93dacf4648e39bef808c488deb9c3ff6ee4 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 08:14:50 -0400 Subject: [PATCH 22/51] 6305 reset filters when case opened or closed --- .../sleuthkit/autopsy/discovery/DiscoveryDialog.java | 11 +++++++---- .../autopsy/discovery/ImageThumbnailPanel.java | 2 +- .../autopsy/discovery/OpenDiscoveryAction.java | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index a70df71418..e270e83486 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -36,9 +36,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DiscoveryDialog.class.getName()); - private final ImageFilterPanel imageFilterPanel = new ImageFilterPanel(); - private final VideoFilterPanel videoFilterPanel = new VideoFilterPanel(); - private final DocumentFilterPanel documentFilterPanel = new DocumentFilterPanel(); + private ImageFilterPanel imageFilterPanel = new ImageFilterPanel(); + private VideoFilterPanel videoFilterPanel = new VideoFilterPanel(); + private DocumentFilterPanel documentFilterPanel = new DocumentFilterPanel(); private static final Color SELECTED_COLOR = new Color(216, 230, 242); private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); private SearchWorker searchWorker = null; @@ -88,7 +88,10 @@ final class DiscoveryDialog extends javax.swing.JDialog { /** * Update the search settings to a default state. */ - private void updateSearchSettings() { + void updateSearchSettings() { + imageFilterPanel = new ImageFilterPanel(); + videoFilterPanel = new VideoFilterPanel(); + documentFilterPanel = new DocumentFilterPanel(); imagesButton.setSelected(true); imagesButton.setEnabled(false); imagesButton.setBackground(SELECTED_COLOR); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java index 6d861d06e9..8f7b90ad08 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailPanel.java @@ -41,7 +41,7 @@ final class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellRe /** * Creates new form ImageThumbnailPanel */ - ImageThumbnailPanel() { + ImageThumbnailPanel() { initComponents(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java index f72d25e22e..545fca578f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java @@ -64,7 +64,7 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P toolbarButton.addActionListener(OpenDiscoveryAction.this::actionPerformed); this.setEnabled(false); } - + @Override public boolean isEnabled() { return Case.isCaseOpen(); @@ -132,6 +132,7 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P @Override public void setEnabled(boolean value) { super.setEnabled(value); + DiscoveryDialog.getDiscoveryDialogInstance().updateSearchSettings(); toolbarButton.setEnabled(value); } From 535d3869f4aa2ab3203e80f447a18b903bc3a68c Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 10:00:35 -0400 Subject: [PATCH 23/51] 6305 fix wait cursor --- .../AbstractDiscoveryFilterPanel.java | 47 +++++++++++- .../discovery/AbstractFiltersPanel.java | 34 ++++++++- .../discovery/DataSourceFilterPanel.java | 1 + .../autopsy/discovery/DiscoveryDialog.java | 33 ++++++++ .../autopsy/discovery/GroupListPanel.java | 27 +++++-- .../autopsy/discovery/ImageFilterPanel.java | 6 +- .../discovery/OpenDiscoveryAction.java | 1 - .../autopsy/discovery/ResultsPanel.java | 20 ++++- .../autopsy/discovery/SwingAnimator.java | 76 ++++--------------- .../discovery/SwingAnimatorCallback.java | 13 ++-- 10 files changed, 171 insertions(+), 87 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java index a7f9bcbd28..08967a2d86 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java @@ -24,7 +24,9 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.event.ListSelectionListener; - +/** + * Abstract class extending JPanel for filter controls. + */ abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; @@ -40,20 +42,44 @@ abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel { */ abstract void configurePanel(boolean selected, int[] indicesSelected); + /** + * Get the checkbox which enables and disables this filter. + * + * @return The JCheckBox which enables and disables this filter. + */ abstract JCheckBox getCheckbox(); + /** + * Get the list of values associated with this filter if one exists. If one + * does not exist this should return null. + * + * @return The JList which contains the values available for selection for + * this filter. + */ abstract JList getList(); + /** + * Get any additional text that should be displayed under the checkbox. If + * no text should be displayed this should return null. + * + * @return The JLabel to display under the JCheckBox. + */ abstract JLabel getAdditionalLabel(); + /** + * Check if this filter is configured to valid settings. + * + * @return True if the filter is configured with valid search settings, + * false otherwise. + */ abstract String checkForError(); /** * Add listeners to the checkbox/list set if listeners have not already been * added. * - * @param listener - * @param listListener + * @param actionlistener The listener for the checkbox selection events. + * @param listListener The listener for the list selection events. */ void addListeners(ActionListener actionListener, ListSelectionListener listListener) { if (getCheckbox() != null) { @@ -64,8 +90,17 @@ abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel { } } + /** + * Get the FileFilter which is represented by this Panel. + * + * @return The FileFilter for the selected settings, null if the settings + * are not in use. + */ abstract FileSearchFiltering.FileFilter getFilter(); + /** + * Remove listeners from the checkbox and the list if they exist. + */ void removeListeners() { if (getCheckbox() != null) { for (ActionListener listener : getCheckbox().getActionListeners()) { @@ -79,6 +114,12 @@ abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel { } } + /** + * Return whether or not this filter has a panel. + * + * @return True if there is a panel to display associated with this filter, + * return false if the filter only has a checkbox. + */ boolean hasPanel() { return true; } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index b8f6ba9e5a..884a940ddd 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -31,7 +31,10 @@ import javax.swing.JSplitPane; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; - +/** + * Abstract class extending JPanel for displaying all the filters associated + * with a type. + */ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, ListSelectionListener { private boolean isInitialized = false; @@ -49,13 +52,32 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li private int firstColumnY = 0; private int secondColumnY = 0; + /** + * Setup necessary for implementations of this abstract class. + */ AbstractFiltersPanel() { firstColumnPanel.setLayout(new GridBagLayout()); secondColumnPanel.setLayout(new GridBagLayout()); } + /** + * Get the type of results this filters panel is for. + * + * @return The type of results this panel filters. + */ abstract FileSearchData.FileType getFileType(); + /** + * Add a DiscoveryFilterPanel to the specified column with the specified + * settings. + * + * @param filterPanel The DiscoveryFilterPanel to add to this panel. + * @param isSelected True if the checkbox should be selected, false + * otherwise. + * @param indicesSelected The array of indices that are selected in the + * list, null if none are selected. + * @param column The column to add the DiscoveryFilterPanel to. + */ final synchronized void addFilter(AbstractDiscoveryFilterPanel filterPanel, boolean isSelected, int[] indicesSelected, int column) { if (!isInitialized) { constraints.gridy = 0; @@ -98,6 +120,11 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li } } + /** + * Add the panels representing the two columns to the specified JSplitPane. + * + * @param splitPane The JSplitPane which the columns are added to. + */ final void addPanelsToScrollPane(JSplitPane splitPane) { splitPane.setLeftComponent(firstColumnPanel); splitPane.setRightComponent(secondColumnPanel); @@ -105,6 +132,9 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li repaint(); } + /** + * Clear the filters from the panel + */ final synchronized void clearFilters() { for (AbstractDiscoveryFilterPanel filterPanel : filters) { filterPanel.removeListeners(); @@ -118,7 +148,7 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li constraints.gridy += constraints.gridheight; addToColumn(additionalComponentToAdd, constraints, columnIndex); constraints.gridy -= constraints.gridheight; - } + } } private void addToColumn(Component component, Object constraints, int columnNumber) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index 59ccc90055..fed38d0083 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -136,6 +136,7 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { try { DefaultListModel dsListModel = (DefaultListModel) dataSourceList.getModel(); dsListModel.removeAllElements(); + System.out.println("CASE: " + Case.getCurrentCase().getName()); for (DataSource ds : Case.getCurrentCase().getSleuthkitCase().getDataSources()) { dsListModel.add(count, new DataSourceItem(ds)); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index e270e83486..31aff3d8ae 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -22,9 +22,12 @@ import static java.awt.BorderLayout.CENTER; import java.awt.Color; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.util.EnumSet; import java.util.List; +import java.util.Set; import java.util.logging.Level; import org.apache.commons.lang.StringUtils; +import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.coreutils.Logger; @@ -34,6 +37,8 @@ import org.sleuthkit.autopsy.discovery.FileSorter.SortingMethod; final class DiscoveryDialog extends javax.swing.JDialog { + private static final Set CASE_EVENTS_OF_INTEREST = EnumSet.of(Case.Events.CURRENT_CASE, + Case.Events.DATA_SOURCE_ADDED, Case.Events.DATA_SOURCE_DELETED); private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DiscoveryDialog.class.getName()); private ImageFilterPanel imageFilterPanel = new ImageFilterPanel(); @@ -83,12 +88,14 @@ final class DiscoveryDialog extends javax.swing.JDialog { groupSortingComboBox.addItem(groupSortAlgorithm); } updateSearchSettings(); + Case.addEventTypeSubscriber(CASE_EVENTS_OF_INTEREST, this.new CasePropertyChangeListener()); } /** * Update the search settings to a default state. */ void updateSearchSettings() { + System.out.println("UPDATE CALLED"); imageFilterPanel = new ImageFilterPanel(); videoFilterPanel = new VideoFilterPanel(); documentFilterPanel = new DocumentFilterPanel(); @@ -487,4 +494,30 @@ final class DiscoveryDialog extends javax.swing.JDialog { private javax.swing.JButton searchButton; private javax.swing.JButton videosButton; // End of variables declaration//GEN-END:variables + + private class CasePropertyChangeListener implements PropertyChangeListener { + + @Override + @SuppressWarnings("fallthrough") + public void propertyChange(PropertyChangeEvent evt) { + System.out.println("EVENT RECEIVED"); + switch (Case.Events.valueOf(evt.getPropertyName())) { + case CURRENT_CASE: { + if (evt.getNewValue() == null) { + //do not refresh when a case is closed only when it is opened. + break; + } + //else fallthrough + } + case DATA_SOURCE_ADDED: + //fallthrough + case DATA_SOURCE_DELETED: + updateSearchSettings(); + break; + default: + //do nothing if the event is not one of the above events. + break; + } + } + } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java index a2689db979..c25d211036 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java @@ -50,15 +50,12 @@ final class GroupListPanel extends javax.swing.JPanel { */ GroupListPanel() { initComponents(); - SwingUtilities.invokeLater(() -> { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - }); } /** - * Subscribe to and reset the panel in response to SearchStartedEvents + * Subscribe to and reset the panel in response to SearchStartedEvents. * - * @param searchStartedEvent the SearchStartedEvent which was received + * @param searchStartedEvent The SearchStartedEvent which was received. */ @Subscribe void handleSearchStartedEvent(DiscoveryEventUtils.SearchStartedEvent searchStartedEvent) { @@ -70,9 +67,9 @@ final class GroupListPanel extends javax.swing.JPanel { "GroupsListPanel.noResults.title.text=No results found"}) /** * Subscribe to and update list of groups in response to - * SearchCompleteEvents + * SearchCompleteEvents. * - * @param searchCompleteEvent the SearchCompleteEvent which was received + * @param searchCompleteEvent The SearchCompleteEvent which was received. */ @Subscribe void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) { @@ -95,6 +92,18 @@ final class GroupListPanel extends javax.swing.JPanel { }); } + /** + * Subscribe to SearchCancelledEvent and reset the panel in response to it. + * + * @param searchCancelledEvent The SearchCancelledEvent which was received. + */ + @Subscribe + void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) { + SwingUtilities.invokeLater(() -> { + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -138,6 +147,9 @@ final class GroupListPanel extends javax.swing.JPanel { * Reset the group list to be empty. */ void resetGroupList() { + SwingUtilities.invokeLater(() -> { + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); groupKeyList.setListData(new GroupKey[0]); } @@ -160,6 +172,7 @@ final class GroupListPanel extends javax.swing.JPanel { } } else { DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.NoResultsEvent()); + } } }//GEN-LAST:event_groupSelected diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index 393ece054b..ca31818390 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -34,7 +34,7 @@ final class ImageFilterPanel extends AbstractFiltersPanel { SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(FILE_TYPE); int[] sizeIndicesSelected = {1, 2, 3, 4, 5}; addFilter(sizeFilterPanel, true, sizeIndicesSelected, 0); - addFilter(new ObjectDetectedFilterPanel(), false, null, 0); + addFilter(new DataSourceFilterPanel(), false, null, 0); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { pastOccurrencesIndices = new int[]{0}; @@ -45,10 +45,10 @@ final class ImageFilterPanel extends AbstractFiltersPanel { addFilter(new UserCreatedFilterPanel(), false, null, 1); addFilter(new HashSetFilterPanel(), false, null, 1); addFilter(new InterestingItemsFilterPanel(), false, null, 1); - addFilter(new DataSourceFilterPanel(), false, null, 1); + addFilter(new ObjectDetectedFilterPanel(), false, null, 1); addFilter(new ParentFolderFilterPanel(), false, null, 1); addPanelsToScrollPane(imageFiltersSplitPane); - + } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java index 545fca578f..64088c815e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java @@ -132,7 +132,6 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P @Override public void setEnabled(boolean value) { super.setEnabled(value); - DiscoveryDialog.getDiscoveryDialogInstance().updateSearchSettings(); toolbarButton.setEnabled(value); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 908461c478..4b580dfc70 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -108,9 +108,6 @@ final class ResultsPanel extends javax.swing.JPanel { DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.ClearInstanceSelectionEvent()); } } - }); - SwingUtilities.invokeLater(() -> { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); }); } @@ -137,6 +134,18 @@ final class ResultsPanel extends javax.swing.JPanel { return new ArrayList<>(); } + /** + * Subscribe to and reset the panel in response to SearchStartedEvents + * + * @param searchStartedEvent the SearchStartedEvent which was received + */ + @Subscribe + void handleSearchStartedEvent(DiscoveryEventUtils.SearchStartedEvent searchStartedEvent) { + SwingUtilities.invokeLater(() -> { + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + }); + } + /** * Subscribe and respond to PageRetrievedEvents. * @@ -145,6 +154,7 @@ final class ResultsPanel extends javax.swing.JPanel { @Subscribe void handlePageRetrievedEvent(DiscoveryEventUtils.PageRetrievedEvent pageRetrievedEvent) { SwingUtilities.invokeLater(() -> { + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); //send populateMesage DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.PopulateInstancesListEvent(getInstancesForSelected())); @@ -257,7 +267,6 @@ final class ResultsPanel extends javax.swing.JPanel { resultType = groupSelectedEvent.getResultType(); groupSize = groupSelectedEvent.getGroupSize(); setPage(0); - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }); } @@ -270,6 +279,7 @@ final class ResultsPanel extends javax.swing.JPanel { @Subscribe void handleNoResultsEvent(DiscoveryEventUtils.NoResultsEvent noResultsEvent) { SwingUtilities.invokeLater(() -> { + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); groupSize = 0; currentPage = 0; updateControls(); @@ -281,6 +291,8 @@ final class ResultsPanel extends javax.swing.JPanel { }); } + @Subscribe + /** * Set the page number and retrieve its contents. * diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java index f01acc0d93..1276bf81e5 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java @@ -24,13 +24,11 @@ import javax.swing.Timer; /** * - * Class to animate Layouts and Fades for a given component. + * Class to animate Layouts for a given component. * * @author Greg Cope * https://www.algosome.com/articles/java-swing-panel-animation.html * - * - * */ final class SwingAnimator { @@ -41,77 +39,38 @@ final class SwingAnimator { private Timer timer = null; //duration in milliseconds betweeen each firing of the Timer - private static final int INITIAL_DURATION = 10; - private static int duration = INITIAL_DURATION; + private static final int INITIAL_TIMING = 10; + private static int timing = INITIAL_TIMING; /** * * Constructs a new SwingAnimator. * - * - * @param callback The object to callback to + * @param callback The SwingAnimatorCallback to call. * */ SwingAnimator(SwingAnimatorCallback callback) { - - this(callback, false); - + this(callback, INITIAL_TIMING); } /** * + * Constructs a new SwingAnimator. * - * - * @param callback The object to callback to - * - * @param start true to automatically start the animation, false - * otherwise - * - */ - SwingAnimator(SwingAnimatorCallback callback, boolean start) { - - this(callback, INITIAL_DURATION, start); - - } - - /** - * - * - * - * @param callback The object to callback to - * - * @param frameTiming Timing between each call to callback. - * - * @param start true to automatically start the animation, false - * otherwise - * - */ - SwingAnimator(SwingAnimatorCallback callback, int frameTiming, boolean start) { - this.callback = callback; - duration = frameTiming; - if (start) { - start(); - } - } - - /** - * - * - * - * @param callback The object to callback to - * + * @param callback The SwingAnimatorCallback to call. * @param frameTiming Timing between each call to callback. * */ SwingAnimator(SwingAnimatorCallback callback, int frameTiming) { - this(callback, frameTiming, false); + this.callback = callback; + timing = frameTiming; } /** * * Checks if this animator is running. * - * @return + * @return True if the animator is running, false otherwise. * */ boolean isRunning() { @@ -135,26 +94,19 @@ final class SwingAnimator { /** * * Starts the timer to fire. If the current timer is non-null and running, - * this method will first - * - * stop the timer before beginning a new one. * + * this method will first stop the timer before beginning a new one. */ void start() { - if (timer != null && timer.isRunning()) { stop(); } - timer = new Timer(duration, new CallbackListener()); + timer = new Timer(timing, new CallbackListener()); timer.start(); } /** * - * ActionListener implements to be passed to the internal timer instance - * - * @author Greg Cope - * - * + * ActionListener implements to be passed to the internal timer instance. * */ private class CallbackListener implements ActionListener { @@ -170,5 +122,5 @@ final class SwingAnimator { callback.callback(SwingAnimator.this); } } - + } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java index f36f51a885..86f7d2f7fb 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimatorCallback.java @@ -20,7 +20,9 @@ package org.sleuthkit.autopsy.discovery; /** * - * Callback interface to be notified by a SwingAnimator of a new time frame. * + * Callback interface to be notified by a SwingAnimator of a new time frame. + * + * * @author Greg Cope * https://www.algosome.com/articles/java-swing-panel-animation.html * @@ -29,17 +31,18 @@ interface SwingAnimatorCallback { /** * - * Callback method for the SwingAnimator + * Callback method for the SwingAnimator. * - * @param caller + * @param caller The object which is calling the Callback. * */ void callback(Object caller); /** * - * Returns true if the SwingAnimator should terminate. * - * @return + * Returns true if the SwingAnimator has terminated. + * + * @return True if the animator has terminated, false otherwise. * */ boolean hasTerminated(); From f6a88a8ecac0db085c992375a20d4d942e6179a9 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 10:38:17 -0400 Subject: [PATCH 24/51] 6305 fix listener for case events --- .../discovery/AbstractFiltersPanel.java | 69 +++++++++++-------- .../discovery/DataSourceFilterPanel.java | 9 +-- .../autopsy/discovery/DetailsPanel.java | 17 ++++- .../autopsy/discovery/DiscoveryDialog.java | 28 +++++--- 4 files changed, 78 insertions(+), 45 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 884a940ddd..2139306f11 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -142,16 +142,32 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li filters.clear(); } + /** + * Update the constraints and add a component to one of the columns. + * + * @param componentToAdd The Component to add to the specified + * column. + * @param additionalComponentToAdd An additional Component which may appear + * below the componentToAdd in the specified + * column. + * @param columnIndex The column to add the Component to. + */ private void addToGridBagLayout(Component componentToAdd, Component additionalComponentToAdd, int columnIndex) { - addToColumn(componentToAdd, constraints, columnIndex); + addToColumn(componentToAdd, columnIndex); if (additionalComponentToAdd != null) { constraints.gridy += constraints.gridheight; - addToColumn(additionalComponentToAdd, constraints, columnIndex); + addToColumn(additionalComponentToAdd, columnIndex); constraints.gridy -= constraints.gridheight; } } - private void addToColumn(Component component, Object constraints, int columnNumber) { + /** + * Add the Component to the specified column with the current constraints. + * + * @param component The Component to add. + * @param columnNumber The column to add the Component to. + */ + private void addToColumn(Component component, int columnNumber) { if (columnNumber == 0) { firstColumnPanel.add(component, constraints); } else { @@ -160,36 +176,23 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li } /** - * The settings are not valid so disable the search button and display the - * given error message. - * - * @param error + * Check if the fields are valid, and fire a property change event to + * indicate any errors. */ - private void setInvalid(String error) { - System.out.println("ERROR FIRED " + error); - firePropertyChange("FilterError", error, error); - } - - /** - * The settings are valid so enable the Search button - */ - private void setValid() { - System.out.println("VALID FIRED"); - firePropertyChange("FilterError", null, null); - } - private void validateFields() { String errorString; System.out.println("VALIDATE FIELDS"); for (AbstractDiscoveryFilterPanel filterPanel : filters) { errorString = filterPanel.checkForError(); if (errorString != null) { - setInvalid(errorString); + System.out.println("ERROR FIRED " + errorString); + firePropertyChange("FilterError", errorString, errorString); return; } System.out.println("FILTER VALID"); } - setValid(); + System.out.println("VALID FIRED"); + firePropertyChange("FilterError", null, null); } @Override @@ -198,6 +201,11 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li validateFields(); } + /** + * Is the Objects Detected Filter Supported. + * + * @return True if the ObjectsDetectedFilter is supported, false otherwise. + */ boolean isObjectsFilterSupported() { for (AbstractDiscoveryFilterPanel filter : filters) { if (filter instanceof ObjectDetectedFilterPanel) { @@ -207,6 +215,11 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li return false; } + /** + * Is the Hash Set Filter Supported. + * + * @return True if the HashSetFilter is supported, false otherwise. + */ boolean isHashSetFilterSupported() { for (AbstractDiscoveryFilterPanel filter : filters) { if (filter instanceof HashSetFilterPanel) { @@ -216,6 +229,11 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li return false; } + /** + * Is the Interesting Items Filter Supported. + * + * @return True if the InterestingItemsFilter is supported, false otherwise. + */ boolean isInterestingItemsFilterSupported() { for (AbstractDiscoveryFilterPanel filter : filters) { if (filter instanceof InterestingItemsFilterPanel) { @@ -228,12 +246,7 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li /** * Get a list of all filters selected by the user. * - * @return the list of filters - */ - /** - * Get a list of all filters selected by the user. - * - * @return the list of filters + * @return The list of filters selected by the user. */ synchronized List getFilters() { List filtersToUse = new ArrayList<>(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index fed38d0083..bbf5760680 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -30,14 +30,16 @@ import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.DataSource; import org.sleuthkit.datamodel.TskCoreException; - +/** + * A panel which displays the controls for the Data Source Filter. + */ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DataSourceFilterPanel.class.getName()); /** - * Creates new form DataSourceFilterPanel + * Creates new form DataSourceFilterPanel. */ DataSourceFilterPanel() { initComponents(); @@ -129,14 +131,13 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { } /** - * Initialize the data source filter + * Initialize the data source filter. */ private void setUpDataSourceFilter() { int count = 0; try { DefaultListModel dsListModel = (DefaultListModel) dataSourceList.getModel(); dsListModel.removeAllElements(); - System.out.println("CASE: " + Case.getCurrentCase().getName()); for (DataSource ds : Case.getCurrentCase().getSleuthkitCase().getDataSources()) { dsListModel.add(count, new DataSourceItem(ds)); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java index 750d5a7277..fed9cd4f6b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java @@ -44,7 +44,9 @@ import org.sleuthkit.autopsy.timeline.actions.ViewFileInTimelineAction; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException; - +/** + * Panel to display the details of the selected result. + */ final class DetailsPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; @@ -54,12 +56,11 @@ final class DetailsPanel extends javax.swing.JPanel { private ListSelectionListener listener = null; /** - * Creates new form DetailsPanel + * Creates new form DetailsPanel. */ DetailsPanel() { initComponents(); dataContentPanel = DataContentPanel.createInstance(); - detailsSplitPane.setBottomComponent(dataContentPanel); //Add the context menu when right clicking instancesList.addMouseListener(new MouseAdapter() { @@ -101,6 +102,13 @@ final class DetailsPanel extends javax.swing.JPanel { instancesList.addListSelectionListener(listener); } + /** + * Clears the instances list in response to the clear instance selection + * event. + * + * @param clearEvent The ClearInstanceSelectionEvent which has been + * received. + */ @Subscribe void handleClearSelectionListener(DiscoveryEventUtils.ClearInstanceSelectionEvent clearEvent) { instancesList.clearSelection(); @@ -108,6 +116,9 @@ final class DetailsPanel extends javax.swing.JPanel { /** * Populate the instances list. + * + * @param populateEvent The PopulateInstancesListEvent which indicates the + * instances list should be populated */ @Subscribe synchronized void handlePopulateInstancesListEvent(DiscoveryEventUtils.PopulateInstancesListEvent populateEvent) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 31aff3d8ae..f4fca6092a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -41,9 +41,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { Case.Events.DATA_SOURCE_ADDED, Case.Events.DATA_SOURCE_DELETED); private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(DiscoveryDialog.class.getName()); - private ImageFilterPanel imageFilterPanel = new ImageFilterPanel(); - private VideoFilterPanel videoFilterPanel = new VideoFilterPanel(); - private DocumentFilterPanel documentFilterPanel = new DocumentFilterPanel(); + private ImageFilterPanel imageFilterPanel = null; + private VideoFilterPanel videoFilterPanel = null; + private DocumentFilterPanel documentFilterPanel = null; private static final Color SELECTED_COLOR = new Color(216, 230, 242); private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); private SearchWorker searchWorker = null; @@ -95,7 +95,21 @@ final class DiscoveryDialog extends javax.swing.JDialog { * Update the search settings to a default state. */ void updateSearchSettings() { - System.out.println("UPDATE CALLED"); + if (imageFilterPanel != null) { + imageFilterPanel.removePropertyChangeListener(listener); + remove(imageFilterPanel); + imageFilterPanel = null; + } + if (videoFilterPanel != null) { + videoFilterPanel.removePropertyChangeListener(listener); + remove(videoFilterPanel); + videoFilterPanel = null; + } + if (documentFilterPanel != null) { + documentFilterPanel.removePropertyChangeListener(listener); + remove(documentFilterPanel); + documentFilterPanel = null; + } imageFilterPanel = new ImageFilterPanel(); videoFilterPanel = new VideoFilterPanel(); documentFilterPanel = new DocumentFilterPanel(); @@ -110,13 +124,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setEnabled(true); documentsButton.setBackground(UNSELECTED_COLOR); fileType = FileSearchData.FileType.IMAGE; - remove(imageFilterPanel); - remove(videoFilterPanel); - videoFilterPanel.removePropertyChangeListener(listener); - remove(documentFilterPanel); - documentFilterPanel.removePropertyChangeListener(listener); add(imageFilterPanel, CENTER); - imageFilterPanel.removePropertyChangeListener(listener); imageFilterPanel.addPropertyChangeListener(listener); groupByCombobox.removeAllItems(); // Set up the grouping attributes From 766ab20fe63d0233ef82813832e02982ad33dcda Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 12:36:10 -0400 Subject: [PATCH 25/51] 6305 fix event listening for validation --- .../discovery/AbstractFiltersPanel.java | 21 ++++++------------- .../autopsy/discovery/DiscoveryDialog.java | 20 +++++++----------- .../autopsy/discovery/HashSetFilterPanel.java | 5 ----- 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 2139306f11..ad3367ee42 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -30,6 +30,7 @@ import javax.swing.JPanel; import javax.swing.JSplitPane; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import org.apache.commons.lang3.StringUtils; /** * Abstract class extending JPanel for displaying all the filters associated @@ -102,7 +103,6 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li constraints.gridwidth = LABEL_WIDTH; addToGridBagLayout(filterPanel.getCheckbox(), null, column); if (filterPanel.hasPanel()) { - System.out.println("filterPanel has panel" + filterPanel.getClass().toString()); constraints.gridx += constraints.gridwidth; constraints.fill = GridBagConstraints.BOTH; constraints.gridheight = PANEL_HEIGHT; @@ -110,8 +110,6 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li constraints.weighty = PANEL_WEIGHT; constraints.gridwidth = PANEL_WIDTH; addToGridBagLayout(filterPanel, null, column); - } else { - System.out.println("filterPanel missing panel" + filterPanel.getClass().toString()); } if (column == 0) { firstColumnY += constraints.gridheight; @@ -179,25 +177,19 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li * Check if the fields are valid, and fire a property change event to * indicate any errors. */ - private void validateFields() { - String errorString; - System.out.println("VALIDATE FIELDS"); + void validateFields() { + String errorString = null; for (AbstractDiscoveryFilterPanel filterPanel : filters) { errorString = filterPanel.checkForError(); - if (errorString != null) { - System.out.println("ERROR FIRED " + errorString); - firePropertyChange("FilterError", errorString, errorString); - return; + if (!StringUtils.isBlank(errorString)) { + break; } - System.out.println("FILTER VALID"); } - System.out.println("VALID FIRED"); - firePropertyChange("FilterError", null, null); + firePropertyChange("FilterError", null, errorString); } @Override public void actionPerformed(ActionEvent e) { - System.out.println("ACTION PERFORMED"); validateFields(); } @@ -264,7 +256,6 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li @Override public void valueChanged(ListSelectionEvent evt) { - System.out.println("VALUE CHANGED"); if (!evt.getValueIsAdjusting()) { validateFields(); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index f4fca6092a..b36aee9bbc 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -71,17 +71,14 @@ final class DiscoveryDialog extends javax.swing.JDialog { listener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - System.out.println("PROPERTY CHANGE EVENT"); - if (evt.getNewValue() instanceof String) { - System.out.println("IS A STRING"); - String errorMessage = (String) evt.getNewValue(); - if (StringUtils.isBlank(errorMessage)) { - setValid(); - } else { + if (evt.getNewValue() != null) { + String errorMessage = evt.getNewValue().toString(); + if (!StringUtils.isBlank(errorMessage)) { setInvalid(errorMessage); + return; } } - + setValid(); } }; for (GroupSortingAlgorithm groupSortAlgorithm : GroupSortingAlgorithm.values()) { @@ -364,6 +361,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setBackground(UNSELECTED_COLOR); fileType = FileSearchData.FileType.IMAGE; imageFilterPanel.addPropertyChangeListener(listener); + imageFilterPanel.validateFields(); pack(); repaint(); }//GEN-LAST:event_imagesButtonActionPerformed @@ -386,6 +384,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setBackground(UNSELECTED_COLOR); videoFilterPanel.addPropertyChangeListener(listener); fileType = FileSearchData.FileType.VIDEO; + videoFilterPanel.validateFields(); pack(); repaint(); }//GEN-LAST:event_videosButtonActionPerformed @@ -396,7 +395,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { remove(videoFilterPanel); videoFilterPanel.removePropertyChangeListener(listener); add(documentFilterPanel, CENTER); - documentFilterPanel.removePropertyChangeListener(listener); documentsButton.setSelected(true); documentsButton.setEnabled(false); documentsButton.setBackground(SELECTED_COLOR); @@ -409,6 +407,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton.setBackground(UNSELECTED_COLOR); fileType = FileSearchData.FileType.DOCUMENTS; documentFilterPanel.addPropertyChangeListener(listener); + documentFilterPanel.validateFields(); pack(); repaint(); }//GEN-LAST:event_documentsButtonActionPerformed @@ -473,7 +472,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { * The settings are valid so enable the Search button */ private void setValid() { - System.out.println("SET VALID"); errorLabel.setText(""); searchButton.setEnabled(true); } @@ -485,7 +483,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { * @param error */ private void setInvalid(String error) { - System.out.println("SET INVALID"); errorLabel.setText(error); searchButton.setEnabled(false); } @@ -508,7 +505,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { @Override @SuppressWarnings("fallthrough") public void propertyChange(PropertyChangeEvent evt) { - System.out.println("EVENT RECEIVED"); switch (Case.Events.valueOf(evt.getPropertyName())) { case CURRENT_CASE: { if (evt.getNewValue() == null) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index b39fda355a..7a35db4053 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -56,9 +56,7 @@ final class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { hashListModel.add(count, name); count++; } - System.out.println("SETUP COMPLETE"); } catch (TskCoreException ex) { - System.out.println("SETUP ERROR"); logger.log(Level.SEVERE, "Error loading hash set names", ex); hashSetCheckbox.setEnabled(false); hashSetList.setEnabled(false); @@ -121,7 +119,6 @@ final class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { @Override void configurePanel(boolean selected, int[] indicesSelected) { - System.out.println("CONFIG PANEL HASHSET"); boolean hasHashSets = hashSetList.getModel().getSize() > 0; hashSetCheckbox.setEnabled(hasHashSets); hashSetCheckbox.setSelected(selected && hasHashSets); @@ -131,11 +128,9 @@ final class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { if (indicesSelected != null) { hashSetList.setSelectedIndices(indicesSelected); } - System.out.println("PANEL ENABLED SETUP"); } else { hashSetScrollPane.setEnabled(false); hashSetList.setEnabled(false); - System.out.println("PAENL DISABLED SETUP"); } } From 33fc4195730e84d9bd856c2f5af139a0bc151471 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 12:42:07 -0400 Subject: [PATCH 26/51] 6305 disable size filter for video at start --- .../sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java | 2 +- Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index 39c122ab04..dbb386adae 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -140,7 +140,7 @@ final class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { @Override String checkForError() { if (pastOccurrencesCheckbox.isSelected() && crFrequencyList.getSelectedValuesList().isEmpty()) { - return "At least one CR frequency must be selected"; + return "At least one value in the past occurrence filter must be selected"; } return null; } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index 1d2c2a5d86..d0b078ea9f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -31,7 +31,7 @@ final class VideoFilterPanel extends AbstractFiltersPanel { VideoFilterPanel() { super(); initComponents(); - addFilter(new SizeFilterPanel(FileSearchData.FileType.VIDEO), true, null, 0); + addFilter(new SizeFilterPanel(FileSearchData.FileType.VIDEO), false, null, 0); addFilter(new DataSourceFilterPanel(), false, null, 0); int[] pastOccurrencesIndices; if (!CentralRepository.isEnabled()) { From bb90da65442a7ac0312e126212e3e013409c3b68 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 13:10:24 -0400 Subject: [PATCH 27/51] 6305 clean up validation of filter settings --- .../discovery/DataSourceFilterPanel.java | 10 ++++++ .../autopsy/discovery/DiscoveryDialog.java | 36 ++++++++++++++++--- .../discovery/DiscoveryTopComponent.java | 6 ++-- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index bbf5760680..e6b937d2f4 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -161,10 +161,20 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { private final DataSource ds; + /** + * Construct a new DataSourceItem. + * + * @param ds The data source being wrapped. + */ DataSourceItem(DataSource ds) { this.ds = ds; } + /** + * Get the data source represented by this data source item. + * + * @return The data source represented by this data source item. + */ DataSource getDataSource() { return ds; } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index b36aee9bbc..faf4b8be0f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -28,6 +28,7 @@ import java.util.Set; import java.util.logging.Level; import org.apache.commons.lang.StringUtils; import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.casemodule.ImageFilePanel; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.coreutils.Logger; @@ -59,6 +60,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { if (discoveryDialog == null) { discoveryDialog = new DiscoveryDialog(); } + discoveryDialog.validateDialog(); return discoveryDialog; } @@ -71,7 +73,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { listener = new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - if (evt.getNewValue() != null) { + if (evt.getPropertyName().equals("FilterError") && evt.getNewValue() != null) { String errorMessage = evt.getNewValue().toString(); if (!StringUtils.isBlank(errorMessage)) { setInvalid(errorMessage); @@ -147,6 +149,32 @@ final class DiscoveryDialog extends javax.swing.JDialog { repaint(); } + /** + * Validate the current filter settings of the selected type. + */ + private void validateDialog() { + switch (fileType) { + case IMAGE: + if (imageFilterPanel != null) { + imageFilterPanel.validateFields(); + } + return; + case VIDEO: + if (videoFilterPanel != null) { + videoFilterPanel.validateFields(); + } + return; + case DOCUMENTS: + if (documentFilterPanel != null) { + documentFilterPanel.validateFields(); + } + return; + default: + break; + } + setInvalid("No filter panels exist"); + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -361,7 +389,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setBackground(UNSELECTED_COLOR); fileType = FileSearchData.FileType.IMAGE; imageFilterPanel.addPropertyChangeListener(listener); - imageFilterPanel.validateFields(); + validateDialog(); pack(); repaint(); }//GEN-LAST:event_imagesButtonActionPerformed @@ -384,7 +412,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { documentsButton.setBackground(UNSELECTED_COLOR); videoFilterPanel.addPropertyChangeListener(listener); fileType = FileSearchData.FileType.VIDEO; - videoFilterPanel.validateFields(); + validateDialog(); pack(); repaint(); }//GEN-LAST:event_videosButtonActionPerformed @@ -407,7 +435,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton.setBackground(UNSELECTED_COLOR); fileType = FileSearchData.FileType.DOCUMENTS; documentFilterPanel.addPropertyChangeListener(listener); - documentFilterPanel.validateFields(); + validateDialog(); pack(); repaint(); }//GEN-LAST:event_documentsButtonActionPerformed diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index ca3021efd0..238a8f066c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -31,7 +31,7 @@ import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.coreutils.ThreadConfined; /** - * Create a dialog for displaying the file discovery tool + * Create a dialog for displaying the Discovery results. */ @TopComponent.Description(preferredID = "DiscoveryTopComponent", persistenceType = TopComponent.PERSISTENCE_NEVER) @TopComponent.Registration(mode = "discovery", openAtStartup = false) @@ -52,7 +52,7 @@ public final class DiscoveryTopComponent extends TopComponent { private SwingAnimator animator = null; /** - * Creates new form FileDiscoveryDialog + * Creates new form DiscoveryTopComponent. */ @ThreadConfined(type = ThreadConfined.ThreadType.AWT) public DiscoveryTopComponent() { @@ -164,7 +164,7 @@ public final class DiscoveryTopComponent extends TopComponent { private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed close(); - new OpenDiscoveryAction().actionPerformed(evt); + new OpenDiscoveryAction().actionPerformed(evt); }//GEN-LAST:event_jButton1ActionPerformed @Override From 88683f5d4416a3c817bc112ea8520335392fb692 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 15:30:19 -0400 Subject: [PATCH 28/51] 6305 fix X and reseting --- .../discovery/AbstractFiltersPanel.java | 2 +- .../autopsy/discovery/Bundle.properties | 2 +- .../discovery/Bundle.properties-MERGED | 3 +- .../autopsy/discovery/DiscoveryDialog.java | 118 ++++++++++++------ .../discovery/DiscoveryEventUtils.java | 6 +- .../discovery/DiscoveryTopComponent.form | 11 +- .../discovery/DiscoveryTopComponent.java | 44 +++++-- .../autopsy/discovery/FileSearchData.java | 2 +- .../discovery/OpenDiscoveryAction.java | 44 +------ 9 files changed, 132 insertions(+), 100 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index ad3367ee42..0cc697aa76 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -177,7 +177,7 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li * Check if the fields are valid, and fire a property change event to * indicate any errors. */ - void validateFields() { + synchronized void validateFields() { String errorString = null; for (AbstractDiscoveryFilterPanel filterPanel : filters) { errorString = filterPanel.checkForError(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index 908acda3eb..c3fe677fa4 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -98,5 +98,5 @@ DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= -DiscoveryTopComponent.jButton1.text=New Search DiscoveryDialog.jLabel1.text=Step 1: Choose Result Type +DiscoveryTopComponent.newSearchButton.text=New Search diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 87c431d20d..cdcbf742fb 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -5,6 +5,7 @@ DataSourceModuleWrapper.exifModule.text=Exif Parser module was not run on data s DataSourceModuleWrapper.fileTypeModule.text=File Type Identification module was not run on data source: {0}\n # {0} - dataSourceName DataSourceModuleWrapper.hashModule.text=Hash Lookup module was not run on data source: {0}\n +DiscoveryTopComponent.cancelButton.text=Cancel Search DiscoveryTopComponent.name=\ Discovery DiscoveryUiUtility.bytes.text=bytes DiscoveryUiUtility.gigaBytes.text=GB @@ -248,8 +249,8 @@ DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= -DiscoveryTopComponent.jButton1.text=New Search DiscoveryDialog.jLabel1.text=Step 1: Choose Result Type +DiscoveryTopComponent.newSearchButton.text=New Search VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index faf4b8be0f..ac8f2cb18e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -23,19 +23,32 @@ import java.awt.Color; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.EnumSet; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.logging.Level; +import javax.swing.JOptionPane; import org.apache.commons.lang.StringUtils; +import org.openide.util.NbBundle.Messages; +import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.casemodule.ImageFilePanel; +import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.discovery.FileGroup.GroupSortingAlgorithm; import org.sleuthkit.autopsy.discovery.FileSearch.GroupingAttributeType; import org.sleuthkit.autopsy.discovery.FileSorter.SortingMethod; +import org.sleuthkit.datamodel.DataSource; +import org.sleuthkit.datamodel.IngestJobInfo; +import org.sleuthkit.datamodel.SleuthkitCase; +import org.sleuthkit.datamodel.TskCoreException; +/** + * Dialog for displaying the controls and filters for configuration of a + * Discovery search. + */ final class DiscoveryDialog extends javax.swing.JDialog { private static final Set CASE_EVENTS_OF_INTEREST = EnumSet.of(Case.Events.CURRENT_CASE, @@ -52,15 +65,19 @@ final class DiscoveryDialog extends javax.swing.JDialog { private FileSearchData.FileType fileType = FileSearchData.FileType.IMAGE; private final PropertyChangeListener listener; + /** + * Private constructor to construct a new DiscoveryDialog + */ + @Messages("DiscoveryDialog.name.text=Discovery") private DiscoveryDialog() { - this(null, true); + this(WindowManager.getDefault().getMainWindow(), true); + setName(Bundle.DiscoveryDialog_name_text()); } static synchronized DiscoveryDialog getDiscoveryDialogInstance() { if (discoveryDialog == null) { discoveryDialog = new DiscoveryDialog(); } - discoveryDialog.validateDialog(); return discoveryDialog; } @@ -94,21 +111,10 @@ final class DiscoveryDialog extends javax.swing.JDialog { * Update the search settings to a default state. */ void updateSearchSettings() { - if (imageFilterPanel != null) { - imageFilterPanel.removePropertyChangeListener(listener); - remove(imageFilterPanel); - imageFilterPanel = null; - } - if (videoFilterPanel != null) { - videoFilterPanel.removePropertyChangeListener(listener); - remove(videoFilterPanel); - videoFilterPanel = null; - } - if (documentFilterPanel != null) { - documentFilterPanel.removePropertyChangeListener(listener); - remove(documentFilterPanel); - documentFilterPanel = null; - } + removeAllPanels(); + imageFilterPanel = null; + videoFilterPanel = null; + documentFilterPanel = null; imageFilterPanel = new ImageFilterPanel(); videoFilterPanel = new VideoFilterPanel(); documentFilterPanel = new DocumentFilterPanel(); @@ -135,7 +141,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { groupByCombobox.addItem(type); } } - orderByCombobox.removeAllItems(); // Set up the file order list for (FileSorter.SortingMethod method : FileSorter.SortingMethod.getOptionsForOrdering()) { @@ -143,7 +148,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { orderByCombobox.addItem(method); } } - groupSortingComboBox.setSelectedIndex(0); pack(); repaint(); @@ -152,7 +156,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { /** * Validate the current filter settings of the selected type. */ - private void validateDialog() { + synchronized void validateDialog() { switch (fileType) { case IMAGE: if (imageFilterPanel != null) { @@ -172,7 +176,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { default: break; } - setInvalid("No filter panels exist"); } /** @@ -371,11 +374,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { }// //GEN-END:initComponents private void imagesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imagesButtonActionPerformed -// resetTopComponent(); - remove(videoFilterPanel); - videoFilterPanel.removePropertyChangeListener(listener); - remove(documentFilterPanel); - documentFilterPanel.removePropertyChangeListener(listener); + removeAllPanels(); add(imageFilterPanel, CENTER); imagesButton.setSelected(true); imagesButton.setEnabled(false); @@ -395,10 +394,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { }//GEN-LAST:event_imagesButtonActionPerformed private void videosButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_videosButtonActionPerformed - remove(imageFilterPanel); - imageFilterPanel.removePropertyChangeListener(listener); - remove(documentFilterPanel); - documentFilterPanel.removePropertyChangeListener(listener); + removeAllPanels(); add(videoFilterPanel, CENTER); imagesButton.setSelected(false); imagesButton.setEnabled(true); @@ -418,10 +414,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { }//GEN-LAST:event_videosButtonActionPerformed private void documentsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_documentsButtonActionPerformed - remove(imageFilterPanel); - imageFilterPanel.removePropertyChangeListener(listener); - remove(videoFilterPanel); - videoFilterPanel.removePropertyChangeListener(listener); + removeAllPanels(); add(documentFilterPanel, CENTER); documentsButton.setSelected(true); documentsButton.setEnabled(false); @@ -440,6 +433,24 @@ final class DiscoveryDialog extends javax.swing.JDialog { repaint(); }//GEN-LAST:event_documentsButtonActionPerformed + /** + * Helper method to remove all filter panels and their listeners + */ + private void removeAllPanels() { + if (imageFilterPanel != null) { + remove(imageFilterPanel); + imageFilterPanel.removePropertyChangeListener(listener); + } + if (documentFilterPanel != null) { + remove(documentFilterPanel); + documentFilterPanel.removePropertyChangeListener(listener); + } + if (videoFilterPanel != null) { + remove(videoFilterPanel); + videoFilterPanel.removePropertyChangeListener(listener); + } + } + private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed // Get the selected filters final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); @@ -475,7 +486,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { centralRepoDb = CentralRepository.getInstance(); } catch (CentralRepoException ex) { centralRepoDb = null; - logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for File Discovery", ex); + logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for Discovery", ex); } } searchWorker = new SearchWorker(centralRepoDb, filters, groupingAttr, groupSortAlgorithm, fileSort); @@ -485,6 +496,10 @@ final class DiscoveryDialog extends javax.swing.JDialog { tc.requestActive(); }//GEN-LAST:event_searchButtonActionPerformed + @Override + public void dispose(){ + setVisible(false); + } private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed this.setVisible(false); @@ -496,6 +511,37 @@ final class DiscoveryDialog extends javax.swing.JDialog { } } + /** + * Helper method to display an error message when the results of the + * Discovery Top component may be incomplete. + * + * @param tc The Discovery Top component. + */ + void displayErrorMessage() { + //check if modules run and assemble message + try { + SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); + Map dataSourceIngestModules = new HashMap<>(); + for (DataSource dataSource : skCase.getDataSources()) { + dataSourceIngestModules.put(dataSource.getId(), new DataSourceModulesWrapper(dataSource.getName())); + } + + for (IngestJobInfo jobInfo : skCase.getIngestJobs()) { + dataSourceIngestModules.get(jobInfo.getObjectId()).updateModulesRun(jobInfo); + } + String message = ""; + for (DataSourceModulesWrapper dsmodulesWrapper : dataSourceIngestModules.values()) { + message += dsmodulesWrapper.getMessage(); + } + if (!message.isEmpty()) { + JOptionPane.showMessageDialog(discoveryDialog, message, Bundle.OpenDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE); + } + } catch (NoCurrentCaseException | TskCoreException ex) { + logger.log(Level.WARNING, "Exception while determining which modules have been run for Discovery", ex); + } + validateDialog(); + } + /** * The settings are valid so enable the Search button */ diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java index 4151a09c4b..2b8a531110 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java @@ -27,16 +27,16 @@ import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; import org.sleuthkit.datamodel.AbstractFile; /** - * Class to handle event bus and events for file discovery tool. + * Class to handle event bus and events for discovery tool. */ final class DiscoveryEventUtils { private final static EventBus discoveryEventBus = new EventBus(); /** - * Get the file discovery event bus. + * Get the discovery event bus. * - * @return The file discovery event bus. + * @return The discovery event bus. */ static EventBus getDiscoveryEventBus() { return discoveryEventBus; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index 24b8cea0f0..3c589f3e52 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -41,6 +41,7 @@ + @@ -72,7 +73,7 @@ - + @@ -81,21 +82,21 @@ - + - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index 238a8f066c..9449ed71cc 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.stream.Collectors; import javax.swing.JSplitPane; import org.openide.util.NbBundle; +import org.openide.util.NbBundle.Messages; import org.openide.windows.Mode; import org.openide.windows.RetainLocation; import org.openide.windows.TopComponent; @@ -119,7 +120,7 @@ public final class DiscoveryTopComponent extends TopComponent { mainSplitPane = new javax.swing.JSplitPane(); rightSplitPane = new AnimatedSplitPane(); jPanel1 = new javax.swing.JPanel(); - jButton1 = new javax.swing.JButton(); + newSearchButton = new javax.swing.JButton(); setMinimumSize(new java.awt.Dimension(199, 200)); setPreferredSize(new java.awt.Dimension(1100, 700)); @@ -128,6 +129,7 @@ public final class DiscoveryTopComponent extends TopComponent { mainSplitPane.setDividerLocation(250); mainSplitPane.setPreferredSize(new java.awt.Dimension(1100, 700)); + rightSplitPane.setDividerSize(15); rightSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); rightSplitPane.setResizeWeight(1.0); rightSplitPane.setPreferredSize(new java.awt.Dimension(800, 700)); @@ -135,10 +137,10 @@ public final class DiscoveryTopComponent extends TopComponent { add(mainSplitPane, java.awt.BorderLayout.CENTER); - org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.jButton1.text")); // NOI18N - jButton1.addActionListener(new java.awt.event.ActionListener() { + org.openide.awt.Mnemonics.setLocalizedText(newSearchButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.newSearchButton.text")); // NOI18N + newSearchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(evt); + newSearchButtonActionPerformed(evt); } }); @@ -148,24 +150,27 @@ public final class DiscoveryTopComponent extends TopComponent { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(jButton1) + .addComponent(newSearchButton) .addContainerGap(987, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(jButton1) + .addComponent(newSearchButton) .addContainerGap()) ); add(jPanel1, java.awt.BorderLayout.PAGE_START); }// //GEN-END:initComponents - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + private void newSearchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newSearchButtonActionPerformed close(); - new OpenDiscoveryAction().actionPerformed(evt); - }//GEN-LAST:event_jButton1ActionPerformed + final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance(); + discDialog.cancelSearch(); + discDialog.setVisible(true); + discDialog.validateDialog(); + }//GEN-LAST:event_newSearchButtonActionPerformed @Override public List availableModes(List modes) { @@ -196,6 +201,22 @@ public final class DiscoveryTopComponent extends TopComponent { animator.start(); } + @Messages({"DiscoveryTopComponent.cancelButton.text=Cancel Search"}) + @Subscribe + void handleSearchStartedEvent(DiscoveryEventUtils.SearchStartedEvent searchStartedEvent) { + newSearchButton.setText(Bundle.DiscoveryTopComponent_cancelButton_text()); + } + + @Subscribe + void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) { + newSearchButton.setText("New Search"); + } + + @Subscribe + void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) { + newSearchButton.setText("New Search"); + } + /** * * Callback implementation for fading in @@ -252,12 +273,15 @@ public final class DiscoveryTopComponent extends TopComponent { } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton jButton1; private javax.swing.JPanel jPanel1; private javax.swing.JSplitPane mainSplitPane; + private javax.swing.JButton newSearchButton; private javax.swing.JSplitPane rightSplitPane; // End of variables declaration//GEN-END:variables + /** + * Class for the split pane which will be animated + */ private final class AnimatedSplitPane extends JSplitPane { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java index 588fa015da..734773ca69 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java @@ -268,7 +268,7 @@ final class FileSearchData { } } - //File discovery uses a different list of document mime types than FileTypeUtils.FileTypeCategory.DOCUMENTS + //Discovery uses a different list of document mime types than FileTypeUtils.FileTypeCategory.DOCUMENTS private static final ImmutableSet DOCUMENT_MIME_TYPES = new ImmutableSet.Builder() .add("text/html", //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java index 64088c815e..e28add8592 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java @@ -19,12 +19,8 @@ package org.sleuthkit.autopsy.discovery; import java.awt.Component; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; import javax.swing.ImageIcon; import javax.swing.JButton; -import javax.swing.JOptionPane; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; @@ -34,12 +30,7 @@ import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.Presenter; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.datamodel.DataSource; -import org.sleuthkit.datamodel.IngestJobInfo; -import org.sleuthkit.datamodel.SleuthkitCase; -import org.sleuthkit.datamodel.TskCoreException; /** * Class to open the Discovery top component. Allows the user to run searches @@ -64,7 +55,7 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P toolbarButton.addActionListener(OpenDiscoveryAction.this::actionPerformed); this.setEnabled(false); } - + @Override public boolean isEnabled() { return Case.isCaseOpen(); @@ -73,42 +64,11 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P @NbBundle.Messages({"OpenDiscoveryAction.resultsIncomplete.text=Results may be incomplete"}) @Override - @SuppressWarnings("fallthrough") public void performAction() { final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance(); discDialog.cancelSearch(); discDialog.setVisible(true); - displayErrorMessage(discDialog); - } - - /** - * Private helper method to display an error message when the results of the - * Discovery Top component may be incomplete. - * - * @param tc The Discovery Top component. - */ - private void displayErrorMessage(DiscoveryDialog discDialog) { - //check if modules run and assemble message - try { - SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); - Map dataSourceIngestModules = new HashMap<>(); - for (DataSource dataSource : skCase.getDataSources()) { - dataSourceIngestModules.put(dataSource.getId(), new DataSourceModulesWrapper(dataSource.getName())); - } - - for (IngestJobInfo jobInfo : skCase.getIngestJobs()) { - dataSourceIngestModules.get(jobInfo.getObjectId()).updateModulesRun(jobInfo); - } - String message = ""; - for (DataSourceModulesWrapper dsmodulesWrapper : dataSourceIngestModules.values()) { - message += dsmodulesWrapper.getMessage(); - } - if (!message.isEmpty()) { - JOptionPane.showMessageDialog(discDialog, message, Bundle.OpenDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE); - } - } catch (NoCurrentCaseException | TskCoreException ex) { - logger.log(Level.WARNING, "Exception while determining which modules have been run for Discovery", ex); - } + discDialog.displayErrorMessage(); } /** From 59a0293599f3cb348e9c823495f0a2078c0eb44a Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 16:19:28 -0400 Subject: [PATCH 29/51] 6305 formatting and comments --- .../discovery/AbstractFiltersPanel.java | 2 +- .../autopsy/discovery/Bundle.properties | 1 - .../discovery/Bundle.properties-MERGED | 3 +- .../autopsy/discovery/DiscoveryDialog.java | 32 +++++----- .../discovery/DiscoveryEventUtils.java | 23 +++++++- .../discovery/DiscoveryTopComponent.form | 4 +- .../discovery/DiscoveryTopComponent.java | 59 +++++++++++-------- .../autopsy/discovery/DiscoveryUiUtils.java | 4 +- .../discovery/DocumentFilterPanel.java | 8 ++- .../autopsy/discovery/DocumentPanel.java | 2 +- .../discovery/DocumentPreviewViewer.java | 2 +- .../autopsy/discovery/FileSearchData.java | 15 ++--- .../discovery/FileSearchException.java | 12 ++-- .../discovery/FileSearchFiltering.java | 3 +- .../autopsy/discovery/GroupListPanel.java | 4 +- .../autopsy/discovery/HashSetFilterPanel.java | 5 +- .../autopsy/discovery/ImageFilterPanel.java | 5 +- .../discovery/ImageThumbnailViewer.java | 2 +- .../InterestingItemsFilterPanel.java | 6 +- .../discovery/ObjectDetectedFilterPanel.java | 7 ++- .../discovery/OpenDiscoveryAction.java | 7 ++- .../discovery/ParentFolderFilterPanel.java | 9 ++- .../discovery/PastOccurrencesFilterPanel.java | 7 ++- .../autopsy/discovery/ResultFile.java | 2 +- .../autopsy/discovery/ResultsPanel.java | 4 +- .../autopsy/discovery/SearchResults.java | 24 ++++---- .../autopsy/discovery/SearchWorker.java | 15 ++--- .../autopsy/discovery/SizeFilterPanel.java | 9 ++- .../autopsy/discovery/SwingAnimator.java | 2 +- .../discovery/UserCreatedFilterPanel.java | 5 +- .../autopsy/discovery/VideoFilterPanel.java | 5 +- .../discovery/VideoThumbnailPanel.java | 7 ++- .../discovery/VideoThumbnailViewer.java | 2 +- 33 files changed, 184 insertions(+), 113 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 0cc697aa76..9491f2baa2 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -177,7 +177,7 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li * Check if the fields are valid, and fire a property change event to * indicate any errors. */ - synchronized void validateFields() { + synchronized void validateFields() { String errorString = null; for (AbstractDiscoveryFilterPanel filterPanel : filters) { errorString = filterPanel.checkForError(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index c3fe677fa4..e81837cfce 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -99,4 +99,3 @@ DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= DiscoveryDialog.jLabel1.text=Step 1: Choose Result Type -DiscoveryTopComponent.newSearchButton.text=New Search diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index cdcbf742fb..088fe9f86f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -5,8 +5,10 @@ DataSourceModuleWrapper.exifModule.text=Exif Parser module was not run on data s DataSourceModuleWrapper.fileTypeModule.text=File Type Identification module was not run on data source: {0}\n # {0} - dataSourceName DataSourceModuleWrapper.hashModule.text=Hash Lookup module was not run on data source: {0}\n +DiscoveryDialog.name.text=Discovery DiscoveryTopComponent.cancelButton.text=Cancel Search DiscoveryTopComponent.name=\ Discovery +DiscoveryTopComponent.newSearch.text=New Search DiscoveryUiUtility.bytes.text=bytes DiscoveryUiUtility.gigaBytes.text=GB DiscoveryUiUtility.kiloBytes.text=KB @@ -250,7 +252,6 @@ DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= DiscoveryDialog.jLabel1.text=Step 1: Choose Result Type -DiscoveryTopComponent.newSearchButton.text=New Search VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index ac8f2cb18e..dc2390eb83 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -66,14 +66,10 @@ final class DiscoveryDialog extends javax.swing.JDialog { private final PropertyChangeListener listener; /** - * Private constructor to construct a new DiscoveryDialog + * Get the Discovery dialog instance. + * + * @return The instance of the Discovery Dialog. */ - @Messages("DiscoveryDialog.name.text=Discovery") - private DiscoveryDialog() { - this(WindowManager.getDefault().getMainWindow(), true); - setName(Bundle.DiscoveryDialog_name_text()); - } - static synchronized DiscoveryDialog getDiscoveryDialogInstance() { if (discoveryDialog == null) { discoveryDialog = new DiscoveryDialog(); @@ -82,10 +78,11 @@ final class DiscoveryDialog extends javax.swing.JDialog { } /** - * Creates new form DiscoveryDialog + * Private constructor to construct a new DiscoveryDialog */ - private DiscoveryDialog(java.awt.Frame parent, boolean modal) { - super(parent, modal); + @Messages("DiscoveryDialog.name.text=Discovery") + private DiscoveryDialog() { + super(WindowManager.getDefault().getMainWindow(), Bundle.DiscoveryDialog_name_text(), true); initComponents(); listener = new PropertyChangeListener() { @Override @@ -458,11 +455,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { setInvalid("No Top Component Found"); return; } - if (tc.isOpened() == false) { tc.open(); } - tc.resetTopComponent(); List filters; if (videosButton.isSelected()) { @@ -497,7 +492,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { }//GEN-LAST:event_searchButtonActionPerformed @Override - public void dispose(){ + public void dispose() { setVisible(false); } @@ -505,6 +500,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { this.setVisible(false); }//GEN-LAST:event_cancelButtonActionPerformed + /** + * Cancel the searchWorker if it exists. + */ void cancelSearch() { if (searchWorker != null) { searchWorker.cancel(true); @@ -514,8 +512,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { /** * Helper method to display an error message when the results of the * Discovery Top component may be incomplete. - * - * @param tc The Discovery Top component. */ void displayErrorMessage() { //check if modules run and assemble message @@ -554,7 +550,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { * The settings are not valid so disable the search button and display the * given error message. * - * @param error + * @param error The error message to display. */ private void setInvalid(String error) { errorLabel.setText(error); @@ -574,6 +570,10 @@ final class DiscoveryDialog extends javax.swing.JDialog { private javax.swing.JButton videosButton; // End of variables declaration//GEN-END:variables + /** + * PropertyChangeListener to listen to case level events that may modify the + * filters available. + */ private class CasePropertyChangeListener implements PropertyChangeListener { @Override diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java index 2b8a531110..aca3519b49 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java @@ -42,7 +42,11 @@ final class DiscoveryEventUtils { return discoveryEventBus; } + /** + * Private no arg constructor for Utility class. + */ private DiscoveryEventUtils() { + //Utility class private constructor intentionally left blank. } /** @@ -71,6 +75,9 @@ final class DiscoveryEventUtils { } } + /** + * Event to signal that the Instances list should have selection cleared. + */ static final class ClearInstanceSelectionEvent { /** @@ -81,6 +88,9 @@ final class DiscoveryEventUtils { } } + /** + * Event to signal that the Instances list should be populated. + */ static final class PopulateInstancesListEvent { private final List instances; @@ -364,17 +374,28 @@ final class DiscoveryEventUtils { } + /** + * Event to signal that the visibility of the Details area should change. + */ static class DetailsVisibleEvent { private final boolean showDetailsArea; + /** + * Construct a new DetailsVisibleEvent. + * + * @param isVisible True if the details area should be visible, false + * otherwise. + */ DetailsVisibleEvent(boolean isVisible) { showDetailsArea = isVisible; //no arg constructor } /** - * @return the showDetailsArea + * Get the visibility of the Details area. + * + * @return True if the details area should be visible, false otherwise. */ boolean isShowDetailsArea() { return showDetailsArea; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index 3c589f3e52..ee8e195973 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -74,7 +74,7 @@ - + @@ -92,7 +92,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index 9449ed71cc..2781060c13 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -104,6 +104,9 @@ public final class DiscoveryTopComponent extends TopComponent { super.componentClosed(); } + /** + * Cancel the in progress search. + */ private void cancelCurrentSearch() { DiscoveryDialog.getDiscoveryDialogInstance().cancelSearch(); } @@ -137,7 +140,7 @@ public final class DiscoveryTopComponent extends TopComponent { add(mainSplitPane, java.awt.BorderLayout.CENTER); - org.openide.awt.Mnemonics.setLocalizedText(newSearchButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "DiscoveryTopComponent.newSearchButton.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(newSearchButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "FileSearchDialog.cancelButton.text")); // NOI18N newSearchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newSearchButtonActionPerformed(evt); @@ -151,7 +154,7 @@ public final class DiscoveryTopComponent extends TopComponent { .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(newSearchButton) - .addContainerGap(987, Short.MAX_VALUE)) + .addContainerGap(1017, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -184,8 +187,11 @@ public final class DiscoveryTopComponent extends TopComponent { } /** + * Subscribe to the DetailsVisible event and animate the panel as it changes + * visibility. * - * Fades this JPanel in. * + * @param detailsVisibleEvent The DetailsVisibleEvent which indicates if the + * panel should be made visible or hidden. */ @Subscribe void handleDetailsVisibleEvent(DiscoveryEventUtils.DetailsVisibleEvent detailsVisibleEvent) { @@ -201,30 +207,43 @@ public final class DiscoveryTopComponent extends TopComponent { animator.start(); } + /** + * Subscribe to the SearchStartedEvent for updating the UI accordingly. + * + * @param searchStartedEvent The event which indicates the start of a + * search. + */ @Messages({"DiscoveryTopComponent.cancelButton.text=Cancel Search"}) @Subscribe void handleSearchStartedEvent(DiscoveryEventUtils.SearchStartedEvent searchStartedEvent) { newSearchButton.setText(Bundle.DiscoveryTopComponent_cancelButton_text()); } + /** + * Subscribe to the SearchCompleteEvent for updating the UI accordingly. + * + * @param searchCompleteEvent The event which indicates the completion of a + * search. + */ @Subscribe + @Messages("DiscoveryTopComponent.newSearch.text=New Search") void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) { - newSearchButton.setText("New Search"); - } - - @Subscribe - void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) { - newSearchButton.setText("New Search"); + newSearchButton.setText(Bundle.DiscoveryTopComponent_newSearch_text()); } /** + * Subscribe to the SearchCancelledEvent for updating the UI accordingly. * - * Callback implementation for fading in - * - * @author Greg Cope - * - * - * + * @param searchCancelledEvent The event which indicates the cancellation of + * a search. + */ + @Subscribe + void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) { + newSearchButton.setText(Bundle.DiscoveryTopComponent_newSearch_text()); + } + + /** + * Callback for animating the details area into a visible position. */ private final class ShowDetailsAreaCallback implements SwingAnimatorCallback { @@ -246,13 +265,7 @@ public final class DiscoveryTopComponent extends TopComponent { } /** - * - * Callback implementation to fade out - * - * @author Greg Cope - * - * - * + * Callback for animating the details area into a hidden position. */ private final class HideDetailsAreaCallback implements SwingAnimatorCallback { @@ -280,7 +293,7 @@ public final class DiscoveryTopComponent extends TopComponent { // End of variables declaration//GEN-END:variables /** - * Class for the split pane which will be animated + * Class for the split pane which will be animated. */ private final class AnimatedSplitPane extends JSplitPane { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java index b844f7613c..4c1497d898 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java @@ -102,7 +102,7 @@ final class DiscoveryUiUtils { return UNSUPPORTED_DOCUMENT_THUMBNAIL; } - /** + /** * Get the names of the sets which exist in the case database for the * specified artifact and attribute types. * @@ -130,7 +130,7 @@ final class DiscoveryUiUtils { Collections.sort(setNames); return setNames; } - + /** * Helper method to see if point is on the icon. * diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index 46f05b199d..2fa7977058 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -20,14 +20,16 @@ package org.sleuthkit.autopsy.discovery; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; - +/** + * Class which displays all filters available for the Documents search type. + */ final class DocumentFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; - private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.DOCUMENTS; + private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.DOCUMENTS; /** - * Creates new form DocumentFilterPanel + * Constructs a new DocumentFilterPanel. */ DocumentFilterPanel() { super(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java index 4084d1e082..2852c7579a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentPanel.java @@ -40,7 +40,7 @@ class DocumentPanel extends javax.swing.JPanel implements ListCellRenderer documentListModel = new DefaultListModel<>(); /** - * Creates new form DocumentViewer + * Creates new form DocumentViewer. */ DocumentPreviewViewer() { initComponents(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java index 734773ca69..7ef5e1188f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java @@ -28,7 +28,7 @@ import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.FileTypeUtils; /** - * Utility enums for FileSearch + * Utility enums for FileSearch. */ final class FileSearchData { @@ -291,14 +291,15 @@ final class FileSearchData { "application/vnd.oasis.opendocument.text" //NON-NLS ).build(); - private static final ImmutableSet IMAGE_UNSUPPORTED_DOC_TYPES + private static final ImmutableSet IMAGE_UNSUPPORTED_DOC_TYPES = new ImmutableSet.Builder() .add("application/pdf", //NON-NLS - "application/xhtml+xml").build(); //NON-NLS - - static Collection getDocTypesWithoutImageExtraction(){ - return Collections.unmodifiableCollection(IMAGE_UNSUPPORTED_DOC_TYPES); - } + "application/xhtml+xml").build(); //NON-NLS + + static Collection getDocTypesWithoutImageExtraction() { + return Collections.unmodifiableCollection(IMAGE_UNSUPPORTED_DOC_TYPES); + } + /** * Enum representing the file type. We don't simply use * FileTypeUtils.FileTypeCategory because: - Some file types categories diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java index 30dcb20ec1..df22e26488 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchException.java @@ -19,26 +19,26 @@ package org.sleuthkit.autopsy.discovery; /** - * Exception type used for FileSearch + * Exception type used for FileSearch. */ final public class FileSearchException extends Exception { private static final long serialVersionUID = 1L; /** - * Create exception from a string + * Create exception from a string. * - * @param message + * @param message The message to associate with this exception. */ FileSearchException(String message) { super(message); } /** - * Create exception for a string and cause + * Create exception for a string and cause. * - * @param message - * @param cause + * @param message The message to associate with this exception. + * @param cause The Throwable cause of the exception. */ FileSearchException(String message, Throwable cause) { super(message, cause); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchFiltering.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchFiltering.java index 4b4830518b..326bc7c15c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchFiltering.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchFiltering.java @@ -842,7 +842,8 @@ class FileSearchFiltering { } /** - * A filter for specifying that the file must have user content suspected data. + * A filter for specifying that the file must have user content suspected + * data. */ static class UserCreatedFilter extends FileFilter { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java index c25d211036..6e3951b47b 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/GroupListPanel.java @@ -32,7 +32,7 @@ import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; import org.sleuthkit.autopsy.discovery.FileSearchData.FileType; /** - * Panel to display the list of groups which are provided by a search + * Panel to display the list of groups which are provided by a search. */ final class GroupListPanel extends javax.swing.JPanel { @@ -46,7 +46,7 @@ final class GroupListPanel extends javax.swing.JPanel { private GroupKey selectedGroupKey; /** - * Creates new form GroupListPanel + * Creates new form GroupListPanel. */ GroupListPanel() { initComponents(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index 7a35db4053..478c7c7fc4 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -29,13 +29,16 @@ import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; +/** + * Panel for displaying the Hash Set filter controls. + */ final class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(HashSetFilterPanel.class.getName()); /** - * Creates new form HashSetFilterPaenl + * Creates new form HashSetFilterPaenl. */ HashSetFilterPanel() { initComponents(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index ca31818390..f1ca2ef7d6 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -20,13 +20,16 @@ package org.sleuthkit.autopsy.discovery; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; +/** + * Panel for displaying all the filters associated with the Image type. + */ final class ImageFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.IMAGE; /** - * Creates new form ImageFilterPanel + * Creates new form ImageFilterPanel. */ ImageFilterPanel() { super(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java index 0bf7eeac31..b1f5ce97e7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageThumbnailViewer.java @@ -35,7 +35,7 @@ final class ImageThumbnailViewer extends javax.swing.JPanel { private final DefaultListModel thumbnailListModel = new DefaultListModel<>(); /** - * Creates new form ImageThumbnailViewer + * Creates new form ImageThumbnailViewer. */ ImageThumbnailViewer() { initComponents(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java index dc8a7fe670..cc2dbb9009 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java @@ -29,14 +29,16 @@ import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; - +/** + * Class to allow configuration of the Interesting Items filter. + */ final class InterestingItemsFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(InterestingItemsFilterPanel.class.getName()); /** - * Creates new form InterestingItemsFilterPanel + * Creates new form InterestingItemsFilterPanel. */ InterestingItemsFilterPanel() { initComponents(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java index e89b1c5416..aa212dcd01 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java @@ -29,13 +29,16 @@ import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; +/** + * Class to allow configuration of the Objects Detected filter. + */ final class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private final static Logger logger = Logger.getLogger(ObjectDetectedFilterPanel.class.getName()); /** - * Creates new form ObjectDetectedFilter + * Creates new form ObjectDetectedFilter. */ ObjectDetectedFilterPanel() { initComponents(); @@ -43,7 +46,7 @@ final class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { } /** - * Initialize the object filter + * Initialize the object filter. */ private void setUpObjectFilter() { int count = 0; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java index e28add8592..4613617c86 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java @@ -33,8 +33,8 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; /** - * Class to open the Discovery top component. Allows the user to run searches - * and see results. + * Class to open the Discovery dialog. Allows the user to run searches and see + * results in the DiscoveryTopComponent. */ @ActionID(category = "Tools", id = "org.sleuthkit.autopsy.newpackage.OpenDiscoveryAction") @ActionReferences(value = { @@ -51,6 +51,9 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P private static final long serialVersionUID = 1L; private final JButton toolbarButton = new JButton(); + /** + * Construct a new OpenDiscoveryAction. + */ public OpenDiscoveryAction() { toolbarButton.addActionListener(OpenDiscoveryAction.this::actionPerformed); this.setEnabled(false); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index 766a7e9cd2..98df249c77 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -26,14 +26,17 @@ import javax.swing.JLabel; import javax.swing.JList; import org.sleuthkit.autopsy.discovery.FileSearchFiltering.ParentSearchTerm; +/** + * Panel to allow configuration of the Parent Folder filter. + */ final class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; private DefaultListModel parentListModel; private static final String[] DEFAULT_IGNORED_PATHS = {"/Windows/", "/Program Files/"}; //NON-NLS - + /** - * Creates new form ParentFolderFilterPanel + * Creates new form ParentFolderFilterPanel. */ ParentFolderFilterPanel() { initComponents(); @@ -41,7 +44,7 @@ final class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { } /** - * Initialize the parent path filter + * Initialize the parent path filter. */ private void setUpParentPathFilter() { fullRadioButton.setSelected(true); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index dbb386adae..3c730f533f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -25,12 +25,15 @@ import javax.swing.JList; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.discovery.FileSearchData.Frequency; +/** + * Panel to allow configuration of the Past Occurrences filter. + */ final class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; /** - * Creates new form PastOccurrencesFilterPanel + * Creates new form PastOccurrencesFilterPanel. */ PastOccurrencesFilterPanel() { initComponents(); @@ -89,7 +92,7 @@ final class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { }//GEN-LAST:event_pastOccurrencesCheckboxActionPerformed /** - * Initialize the frequency filter + * Initialize the frequency filter. */ private void setUpFrequencyFilter() { int count = 0; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultFile.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultFile.java index be174dbc6e..73d57ccf37 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultFile.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultFile.java @@ -37,7 +37,7 @@ import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; /** - * Container for files that holds all necessary data for grouping and sorting + * Container for files that holds all necessary data for grouping and sorting. */ class ResultFile { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 4b580dfc70..60f7cbe6ec 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -135,9 +135,9 @@ final class ResultsPanel extends javax.swing.JPanel { } /** - * Subscribe to and reset the panel in response to SearchStartedEvents + * Subscribe to and reset the panel in response to SearchStartedEvents. * - * @param searchStartedEvent the SearchStartedEvent which was received + * @param searchStartedEvent The SearchStartedEvent which was received. */ @Subscribe void handleSearchStartedEvent(DiscoveryEventUtils.SearchStartedEvent searchStartedEvent) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SearchResults.java b/Core/src/org/sleuthkit/autopsy/discovery/SearchResults.java index 9e2b6f162c..29e6eb924d 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SearchResults.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SearchResults.java @@ -28,7 +28,7 @@ import java.util.stream.Collectors; import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; /** - * Class to hold the results of the filtering/grouping/sorting operations + * Class to hold the results of the filtering/grouping/sorting operations. */ class SearchResults { @@ -42,13 +42,13 @@ class SearchResults { private static final long MAX_OUTPUT_FILES = 2000; // For debug UI - maximum number of lines to print /** - * Create an empty SearchResults object + * Create an empty SearchResults object. * * @param groupSortingType The method that should be used to - * sortGroupsAndFiles the groups - * @param attrType The attribute type to use for grouping + * sortGroupsAndFiles the groups. + * @param attrType The attribute type to use for grouping. * @param fileSortingMethod The method that should be used to - * sortGroupsAndFiles the files in each group + * sortGroupsAndFiles the files in each group. */ SearchResults(FileGroup.GroupSortingAlgorithm groupSortingType, FileSearch.AttributeType attrType, FileSorter.SortingMethod fileSortingMethod) { @@ -68,9 +68,9 @@ class SearchResults { } /** - * Add a list of ResultFile to the results + * Add a list of ResultFile to the results. * - * @param files the ResultFiles + * @param files The list of ResultFiles to add. */ void add(List files) { for (ResultFile file : files) { @@ -124,20 +124,20 @@ class SearchResults { } /** - * Get the names of the groups with counts + * Get the names of the groups with counts. * - * @return the group names + * @return The list of group names. */ List getGroupNamesWithCounts() { return groupList.stream().map(p -> p.getDisplayName() + " (" + p.getFiles().size() + ")").collect(Collectors.toList()); } /** - * Get the result files for the selected group + * Get the result files for the selected group. * * @param groupName The name of the group. Can have the size appended. * - * @return the list of result files + * @return The list of result files. */ List getResultFilesInGroup(String groupName) { if (groupName != null) { @@ -154,7 +154,7 @@ class SearchResults { /** * Transform the results into a LinkedHashMap with result files. * - * @return the grouped and sorted results + * @return The grouped and sorted results. */ Map> toLinkedHashMap() throws FileSearchException { Map> map = new LinkedHashMap<>(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SearchWorker.java b/Core/src/org/sleuthkit/autopsy/discovery/SearchWorker.java index feda6671ea..1a513afda1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SearchWorker.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SearchWorker.java @@ -29,7 +29,7 @@ import org.sleuthkit.autopsy.discovery.FileSearch.GroupKey; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; /** - * SwingWorker to perform search on a background thread + * SwingWorker to perform search on a background thread. */ final class SearchWorker extends SwingWorker { @@ -43,13 +43,14 @@ final class SearchWorker extends SwingWorker { private final Map results = new LinkedHashMap<>(); /** - * Create a SwingWorker which performs a search + * Create a SwingWorker which performs a search. * - * @param centralRepo the central repository being used for the search - * @param searchfilters the FileFilters to use for the search - * @param groupingAttribute the AttributeType to group by - * @param groupSort the Algorithm to sort groups by - * @param fileSortMethod the SortingMethod to use for files + * @param centralRepo The central repository being used for the + * search. + * @param searchfilters The FileFilters to use for the search. + * @param groupingAttribute The AttributeType to group by. + * @param groupSort The Algorithm to sort groups by. + * @param fileSortMethod The SortingMethod to use for files. */ SearchWorker(CentralRepository centralRepo, List searchfilters, FileSearch.AttributeType groupingAttribute, FileGroup.GroupSortingAlgorithm groupSort, FileSorter.SortingMethod fileSortMethod) { centralRepoDb = centralRepo; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index 8e9275478e..530cc24963 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -26,12 +26,17 @@ import javax.swing.JLabel; import javax.swing.JList; import org.sleuthkit.autopsy.discovery.FileSearchData.FileSize; +/** + * Panel to allow configuration of the Size Filter. + */ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; /** - * Creates new form SizeFilterPanel + * Creates new form SizeFilterPanel= + * + * @param type The type of result being searched for. */ SizeFilterPanel(FileSearchData.FileType type) { initComponents(); @@ -126,7 +131,7 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { } /** - * Initialize the file size filter + * Initialize the file size filter. */ private void setUpSizeFilter(FileSearchData.FileType fileType) { int count = 0; diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java index 1276bf81e5..c3457c43c6 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java @@ -94,7 +94,7 @@ final class SwingAnimator { /** * * Starts the timer to fire. If the current timer is non-null and running, - * this method will first stop the timer before beginning a new one. + * this method will first stop the timer before beginning a new one. */ void start() { if (timer != null && timer.isRunning()) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java index e222fdfc41..5ee4a2e5c0 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java @@ -22,12 +22,15 @@ import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JList; +/** + * Panel to allow configuration of the User Created Filter. + */ final class UserCreatedFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; /** - * Creates new form UserCreatedFilterPanel + * Creates new form UserCreatedFilterPanel. */ UserCreatedFilterPanel() { initComponents(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index d0b078ea9f..0d51b071c7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -20,13 +20,16 @@ package org.sleuthkit.autopsy.discovery; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; +/** + * Panel for displaying all filters available for the searches of type Video. + */ final class VideoFilterPanel extends AbstractFiltersPanel { private static final long serialVersionUID = 1L; private static final FileSearchData.FileType FILE_TYPE = FileSearchData.FileType.VIDEO; /** - * Creates new form VideoFilterPanel + * Creates new form VideoFilterPanel. */ VideoFilterPanel() { super(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.java index 2fff08f87b..d8845f565a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailPanel.java @@ -43,9 +43,9 @@ final class VideoThumbnailPanel extends javax.swing.JPanel implements ListCellRe private static final int BYTE_UNIT_CONVERSION = 1000; private static final long serialVersionUID = 1L; private static final int MAX_NAME_STRING = 120; - + /** - * Creates new form VideoThumbnailPanel + * Creates new form VideoThumbnailPanel. */ VideoThumbnailPanel() { initComponents(); @@ -55,7 +55,8 @@ final class VideoThumbnailPanel extends javax.swing.JPanel implements ListCellRe /** * Add the thumbnails to the panel. * - * @param thumbnailWrapper + * @param thumbnailWrapper The object which contains the video thumbnails to + * add. */ private void addThumbnails(VideoThumbnailsWrapper thumbnailWrapper) { imagePanel.removeAll(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java index ac0dabbdd8..bb3c5a30ea 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoThumbnailViewer.java @@ -34,7 +34,7 @@ final class VideoThumbnailViewer extends javax.swing.JPanel { private final DefaultListModel thumbnailListModel = new DefaultListModel<>(); /** - * Creates new form VideoThumbnailViewer + * Creates new form VideoThumbnailViewer. */ VideoThumbnailViewer() { initComponents(); From 1503ff12213c72e18690a88a58a499f20b4b2199 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 17:06:07 -0400 Subject: [PATCH 30/51] 6305 clean up and labeling --- .../autopsy/discovery/Bundle.properties | 7 ++- .../discovery/Bundle.properties-MERGED | 12 +++- .../autopsy/discovery/DiscoveryDialog.form | 61 +++++++++++++------ .../autopsy/discovery/DiscoveryDialog.java | 43 +++++++------ .../discovery/DiscoveryTopComponent.form | 57 +++++++++++++++-- .../discovery/DiscoveryTopComponent.java | 49 ++++++++++++--- .../discovery/DocumentFilterPanel.form | 7 +++ .../discovery/DocumentFilterPanel.java | 1 + .../autopsy/discovery/ImageFilterPanel.form | 7 +++ .../autopsy/discovery/ImageFilterPanel.java | 1 + .../autopsy/discovery/VideoFilterPanel.form | 7 +++ .../autopsy/discovery/VideoFilterPanel.java | 1 + 12 files changed, 202 insertions(+), 51 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index e81837cfce..ae464e98e1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -93,9 +93,12 @@ InterestingItemsFilterPanel.interestingItemsCheckbox.text=Interesting Item: UserCreatedFilterPanel.userCreatedCheckbox.text_1=Possibly User Created PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text=Past Occurrences: ObjectDetectedFilterPanel.text=Object Detected: -DiscoveryDialog.sortingPanel.border.title=Grouping +DiscoveryDialog.sortingPanel.border.title=Step 3: Choose display settings DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= -DiscoveryDialog.jLabel1.text=Step 1: Choose Result Type +DocumentFilterPanel.documentsFiltersSplitPane.border.title=Step 2: Filter which documents to show +ImageFilterPanel.imageFiltersSplitPane.border.title=Step 2: Filter which images to show +VideoFilterPanel.videoFiltersSplitPane.border.title=Step 2: Filter which videos to show +DiscoveryDialog.step1Label.text=Step 1: Choose result type diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 088fe9f86f..9a676bb1b9 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -9,6 +9,11 @@ DiscoveryDialog.name.text=Discovery DiscoveryTopComponent.cancelButton.text=Cancel Search DiscoveryTopComponent.name=\ Discovery DiscoveryTopComponent.newSearch.text=New Search +DiscoveryTopComponent.searchCancelled.text=Search has been cancelled. +# {0} - search +DiscoveryTopComponent.searchComplete.text=Results displayed have the following filters applied: {0} +# {0} - searchType +DiscoveryTopComponent.searchInProgress.text=Performing search for results of type {0}. Please wait. DiscoveryUiUtility.bytes.text=bytes DiscoveryUiUtility.gigaBytes.text=GB DiscoveryUiUtility.kiloBytes.text=KB @@ -246,12 +251,15 @@ InterestingItemsFilterPanel.interestingItemsCheckbox.text=Interesting Item: UserCreatedFilterPanel.userCreatedCheckbox.text_1=Possibly User Created PastOccurrencesFilterPanel.pastOccurrencesCheckbox.text=Past Occurrences: ObjectDetectedFilterPanel.text=Object Detected: -DiscoveryDialog.sortingPanel.border.title=Grouping +DiscoveryDialog.sortingPanel.border.title=Step 3: Choose display settings DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= -DiscoveryDialog.jLabel1.text=Step 1: Choose Result Type +DiscoveryDialog.jLabel1.text=Step 1: Choose result type +DocumentFilterPanel.documentsFiltersSplitPane.border.title=Step 2: Filter which documents to show +ImageFilterPanel.imageFiltersSplitPane.border.title=Step 2: Filter which images to show +VideoFilterPanel.videoFiltersSplitPane.border.title=Step 2: Filter which videos to show VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index bc0f98d9c8..37c11ebe28 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -24,7 +24,7 @@ - + @@ -43,28 +43,39 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - @@ -149,13 +160,29 @@ - + - + + + + + + + + + + + + + + + + + @@ -171,9 +198,9 @@ - + - + @@ -237,7 +264,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index dc2390eb83..226e48d302 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -188,7 +188,8 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton = new javax.swing.JButton(); videosButton = new javax.swing.JButton(); documentsButton = new javax.swing.JButton(); - jLabel1 = new javax.swing.JLabel(); + step1Label = new javax.swing.JLabel(); + filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(104, 0), new java.awt.Dimension(104, 0), new java.awt.Dimension(104, 32767)); jPanel1 = new javax.swing.JPanel(); searchButton = new javax.swing.JButton(); errorLabel = new javax.swing.JLabel(); @@ -245,32 +246,39 @@ final class DiscoveryDialog extends javax.swing.JDialog { } }); - org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.jLabel1.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(step1Label, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.step1Label.text")); // NOI18N javax.swing.GroupLayout toolBarPanelLayout = new javax.swing.GroupLayout(toolBarPanel); toolBarPanel.setLayout(toolBarPanelLayout); toolBarPanelLayout.setHorizontalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap(55, Short.MAX_VALUE) - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(documentsButton) - .addContainerGap(230, Short.MAX_VALUE)) + .addContainerGap(196, Short.MAX_VALUE) + .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, toolBarPanelLayout.createSequentialGroup() + .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(step1Label, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(toolBarPanelLayout.createSequentialGroup() + .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(documentsButton))) + .addContainerGap(196, Short.MAX_VALUE)) ); toolBarPanelLayout.setVerticalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addContainerGap() + .addGap(6, 6, 6) + .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(step1Label)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(documentsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel1)) + .addComponent(documentsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); @@ -343,9 +351,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE) + .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 733, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE) + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 517, Short.MAX_VALUE) .addGap(68, 68, 68) .addComponent(cancelButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) @@ -560,13 +568,14 @@ final class DiscoveryDialog extends javax.swing.JDialog { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton documentsButton; private javax.swing.JLabel errorLabel; + private javax.swing.Box.Filler filler1; private javax.swing.JComboBox groupByCombobox; private javax.swing.JComboBox groupSortingComboBox; private javax.swing.JButton imagesButton; - private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JComboBox orderByCombobox; private javax.swing.JButton searchButton; + private javax.swing.JLabel step1Label; private javax.swing.JButton videosButton; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index ee8e195973..2cfc3be255 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -72,17 +72,27 @@ - - - + + + + + - - - + + + + + + + + + + + @@ -94,11 +104,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index 2781060c13..eb5af839e8 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -19,6 +19,7 @@ package org.sleuthkit.autopsy.discovery; import com.google.common.eventbus.Subscribe; +import java.awt.Color; import java.awt.Graphics; import java.util.List; import java.util.stream.Collectors; @@ -30,6 +31,7 @@ import org.openide.windows.RetainLocation; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.coreutils.ThreadConfined; +import org.sleuthkit.autopsy.discovery.FileSearchFiltering.FileFilter; /** * Create a dialog for displaying the Discovery results. @@ -124,6 +126,8 @@ public final class DiscoveryTopComponent extends TopComponent { rightSplitPane = new AnimatedSplitPane(); jPanel1 = new javax.swing.JPanel(); newSearchButton = new javax.swing.JButton(); + progressMessageScrollPane = new javax.swing.JScrollPane(); + progressMessageTextArea = new javax.swing.JTextArea(); setMinimumSize(new java.awt.Dimension(199, 200)); setPreferredSize(new java.awt.Dimension(1100, 700)); @@ -141,26 +145,44 @@ public final class DiscoveryTopComponent extends TopComponent { add(mainSplitPane, java.awt.BorderLayout.CENTER); org.openide.awt.Mnemonics.setLocalizedText(newSearchButton, org.openide.util.NbBundle.getMessage(DiscoveryTopComponent.class, "FileSearchDialog.cancelButton.text")); // NOI18N + newSearchButton.setMaximumSize(new java.awt.Dimension(110, 26)); + newSearchButton.setMinimumSize(new java.awt.Dimension(110, 26)); + newSearchButton.setPreferredSize(new java.awt.Dimension(110, 26)); newSearchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newSearchButtonActionPerformed(evt); } }); + progressMessageScrollPane.setBorder(null); + + progressMessageTextArea.setBackground(new java.awt.Color(240, 240, 240)); + progressMessageTextArea.setColumns(20); + progressMessageTextArea.setRows(2); + progressMessageTextArea.setBorder(null); + progressMessageScrollPane.setViewportView(progressMessageTextArea); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(newSearchButton) - .addContainerGap(1017, Short.MAX_VALUE)) + .addComponent(newSearchButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(progressMessageScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 954, Short.MAX_VALUE) + .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(newSearchButton) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(progressMessageScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(17, 17, 17) + .addComponent(newSearchButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); @@ -213,10 +235,14 @@ public final class DiscoveryTopComponent extends TopComponent { * @param searchStartedEvent The event which indicates the start of a * search. */ - @Messages({"DiscoveryTopComponent.cancelButton.text=Cancel Search"}) + @Messages({"DiscoveryTopComponent.cancelButton.text=Cancel Search", + "# {0} - searchType", + "DiscoveryTopComponent.searchInProgress.text=Performing search for results of type {0}. Please wait."}) @Subscribe void handleSearchStartedEvent(DiscoveryEventUtils.SearchStartedEvent searchStartedEvent) { newSearchButton.setText(Bundle.DiscoveryTopComponent_cancelButton_text()); + progressMessageTextArea.setForeground(Color.red); + progressMessageTextArea.setText(Bundle.DiscoveryTopComponent_searchInProgress_text(searchStartedEvent.getType().name())); } /** @@ -226,9 +252,13 @@ public final class DiscoveryTopComponent extends TopComponent { * search. */ @Subscribe - @Messages("DiscoveryTopComponent.newSearch.text=New Search") + @Messages({"DiscoveryTopComponent.newSearch.text=New Search", + "# {0} - search", + "DiscoveryTopComponent.searchComplete.text=Results displayed have the following filters applied: {0}"}) void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) { newSearchButton.setText(Bundle.DiscoveryTopComponent_newSearch_text()); + progressMessageTextArea.setForeground(Color.black); + progressMessageTextArea.setText(Bundle.DiscoveryTopComponent_searchComplete_text(searchCompleteEvent.getFilters().stream().map(FileFilter::getDesc).collect(Collectors.joining(", ")))); } /** @@ -237,9 +267,12 @@ public final class DiscoveryTopComponent extends TopComponent { * @param searchCancelledEvent The event which indicates the cancellation of * a search. */ + @Messages({"DiscoveryTopComponent.searchCancelled.text=Search has been cancelled."}) @Subscribe void handleSearchCancelledEvent(DiscoveryEventUtils.SearchCancelledEvent searchCancelledEvent) { newSearchButton.setText(Bundle.DiscoveryTopComponent_newSearch_text()); + progressMessageTextArea.setForeground(Color.red); + progressMessageTextArea.setText(Bundle.DiscoveryTopComponent_searchCancelled_text()); } /** @@ -289,6 +322,8 @@ public final class DiscoveryTopComponent extends TopComponent { private javax.swing.JPanel jPanel1; private javax.swing.JSplitPane mainSplitPane; private javax.swing.JButton newSearchButton; + private javax.swing.JScrollPane progressMessageScrollPane; + private javax.swing.JTextArea progressMessageTextArea; private javax.swing.JSplitPane rightSplitPane; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form index b83c2f324f..c3763f3983 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form @@ -31,6 +31,13 @@ + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index 2fa7977058..0328036e80 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -67,6 +67,7 @@ final class DocumentFilterPanel extends AbstractFiltersPanel { documentFiltersPanel.setLayout(new java.awt.BorderLayout()); + documentsFiltersSplitPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DocumentFilterPanel.class, "DocumentFilterPanel.documentsFiltersSplitPane.border.title"))); // NOI18N documentsFiltersSplitPane.setResizeWeight(0.5); documentFiltersPanel.add(documentsFiltersSplitPane, java.awt.BorderLayout.CENTER); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form index af67f74cbf..b88fcefeaf 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form @@ -31,6 +31,13 @@ + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index f1ca2ef7d6..cd81891882 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -71,6 +71,7 @@ final class ImageFilterPanel extends AbstractFiltersPanel { imageFiltersPanel.setLayout(new java.awt.BorderLayout()); + imageFiltersSplitPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ImageFilterPanel.class, "ImageFilterPanel.imageFiltersSplitPane.border.title"))); // NOI18N imageFiltersSplitPane.setResizeWeight(0.5); imageFiltersSplitPane.setToolTipText(org.openide.util.NbBundle.getMessage(ImageFilterPanel.class, "ImageFilterPanel.imageFiltersSplitPane.toolTipText")); // NOI18N imageFiltersPanel.add(imageFiltersSplitPane, java.awt.BorderLayout.CENTER); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form index e7f145d8db..06beb9bfc2 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form @@ -31,6 +31,13 @@ + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index 0d51b071c7..9503340c49 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -68,6 +68,7 @@ final class VideoFilterPanel extends AbstractFiltersPanel { videoFiltersPanel.setLayout(new java.awt.BorderLayout()); + videoFiltersSplitPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(VideoFilterPanel.class, "VideoFilterPanel.videoFiltersSplitPane.border.title"))); // NOI18N videoFiltersSplitPane.setResizeWeight(0.5); videoFiltersPanel.add(videoFiltersSplitPane, java.awt.BorderLayout.CENTER); From a3762850c31eb684cafb539b5a06824f3a3d5a65 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 18:01:24 -0400 Subject: [PATCH 31/51] 6305 add spacing between panels --- .../autopsy/discovery/DiscoveryDialog.form | 31 ++++++++--------- .../autopsy/discovery/DiscoveryDialog.java | 29 ++++++++-------- .../discovery/DocumentFilterPanel.form | 28 ++++++++++++---- .../discovery/DocumentFilterPanel.java | 20 +++++++++-- .../autopsy/discovery/ImageFilterPanel.form | 28 ++++++++++++---- .../autopsy/discovery/ImageFilterPanel.java | 20 +++++++++-- .../autopsy/discovery/VideoFilterPanel.form | 33 +++++++++++++++---- .../autopsy/discovery/VideoFilterPanel.java | 20 +++++++++-- 8 files changed, 151 insertions(+), 58 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 37c11ebe28..737ee86d50 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -24,7 +24,7 @@ - + @@ -66,18 +66,18 @@ - + - + - + @@ -196,26 +196,27 @@ - + - + - - + + - + - - + + + @@ -223,7 +224,7 @@ - + @@ -303,19 +304,19 @@ - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 226e48d302..2dad36864f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -270,16 +270,16 @@ final class DiscoveryDialog extends javax.swing.JDialog { toolBarPanelLayout.setVerticalGroup( toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(toolBarPanelLayout.createSequentialGroup() - .addGap(6, 6, 6) + .addGap(8, 8, 8) .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(step1Label)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGap(8, 8, 8) .addGroup(toolBarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(videosButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(imagesButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(documentsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap()) + .addGap(8, 8, 8)) ); getContentPane().add(toolBarPanel, java.awt.BorderLayout.PAGE_START); @@ -331,17 +331,17 @@ final class DiscoveryDialog extends javax.swing.JDialog { sortingPanelLayout.setVerticalGroup( sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(sortingPanelLayout.createSequentialGroup() - .addGap(6, 6, 6) + .addGap(8, 8, 8) .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(groupByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(groupByLabel) .addComponent(orderByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(orderByLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGap(8, 8, 8) .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(groupSortingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(orderGroupsByLabel)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(8, 8, 8)) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); @@ -349,28 +349,29 @@ final class DiscoveryDialog extends javax.swing.JDialog { jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap() + .addGap(8, 8, 8) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 733, Short.MAX_VALUE) + .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 517, Short.MAX_VALUE) - .addGap(68, 68, 68) + .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 575, Short.MAX_VALUE) + .addGap(18, 18, 18) .addComponent(cancelButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(searchButton))) - .addContainerGap()) + .addGap(8, 8, 8)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGap(8, 8, 8) + .addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(8, 8, 8) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cancelButton) .addComponent(searchButton))) - .addContainerGap()) + .addGap(8, 8, 8)) ); getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_END); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form index c3763f3983..3f721b2d96 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form @@ -11,7 +11,7 @@ - + @@ -27,7 +27,26 @@ - + + + + + + + + + + + + + + + + + + + + @@ -40,11 +59,6 @@ - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index 0328036e80..5bb182368f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -65,11 +65,25 @@ final class DocumentFilterPanel extends AbstractFiltersPanel { setLayout(new java.awt.BorderLayout()); - documentFiltersPanel.setLayout(new java.awt.BorderLayout()); - documentsFiltersSplitPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DocumentFilterPanel.class, "DocumentFilterPanel.documentsFiltersSplitPane.border.title"))); // NOI18N documentsFiltersSplitPane.setResizeWeight(0.5); - documentFiltersPanel.add(documentsFiltersSplitPane, java.awt.BorderLayout.CENTER); + + javax.swing.GroupLayout documentFiltersPanelLayout = new javax.swing.GroupLayout(documentFiltersPanel); + documentFiltersPanel.setLayout(documentFiltersPanelLayout); + documentFiltersPanelLayout.setHorizontalGroup( + documentFiltersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(documentFiltersPanelLayout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(documentsFiltersSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE) + .addGap(8, 8, 8)) + ); + documentFiltersPanelLayout.setVerticalGroup( + documentFiltersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(documentFiltersPanelLayout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(documentsFiltersSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE) + .addGap(8, 8, 8)) + ); documentFiltersScrollPane.setViewportView(documentFiltersPanel); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form index b88fcefeaf..f48616f1ca 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form @@ -11,7 +11,7 @@ - + @@ -27,7 +27,26 @@ - + + + + + + + + + + + + + + + + + + + + @@ -43,11 +62,6 @@ - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index cd81891882..d73c79d795 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -69,12 +69,26 @@ final class ImageFilterPanel extends AbstractFiltersPanel { setLayout(new java.awt.BorderLayout()); - imageFiltersPanel.setLayout(new java.awt.BorderLayout()); - imageFiltersSplitPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(ImageFilterPanel.class, "ImageFilterPanel.imageFiltersSplitPane.border.title"))); // NOI18N imageFiltersSplitPane.setResizeWeight(0.5); imageFiltersSplitPane.setToolTipText(org.openide.util.NbBundle.getMessage(ImageFilterPanel.class, "ImageFilterPanel.imageFiltersSplitPane.toolTipText")); // NOI18N - imageFiltersPanel.add(imageFiltersSplitPane, java.awt.BorderLayout.CENTER); + + javax.swing.GroupLayout imageFiltersPanelLayout = new javax.swing.GroupLayout(imageFiltersPanel); + imageFiltersPanel.setLayout(imageFiltersPanelLayout); + imageFiltersPanelLayout.setHorizontalGroup( + imageFiltersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(imageFiltersPanelLayout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(imageFiltersSplitPane) + .addGap(8, 8, 8)) + ); + imageFiltersPanelLayout.setVerticalGroup( + imageFiltersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(imageFiltersPanelLayout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(imageFiltersSplitPane) + .addGap(8, 8, 8)) + ); imageFiltersScrollPane.setViewportView(imageFiltersPanel); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form index 06beb9bfc2..ec4b154c7c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form @@ -11,7 +11,7 @@ - + @@ -26,8 +26,32 @@ + + + + + - + + + + + + + + + + + + + + + + + + + + @@ -40,11 +64,6 @@ - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index 9503340c49..30b813c3c1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -66,11 +66,27 @@ final class VideoFilterPanel extends AbstractFiltersPanel { setLayout(new java.awt.BorderLayout()); - videoFiltersPanel.setLayout(new java.awt.BorderLayout()); + videoFiltersPanel.setPreferredSize(new java.awt.Dimension(223, 66)); videoFiltersSplitPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(VideoFilterPanel.class, "VideoFilterPanel.videoFiltersSplitPane.border.title"))); // NOI18N videoFiltersSplitPane.setResizeWeight(0.5); - videoFiltersPanel.add(videoFiltersSplitPane, java.awt.BorderLayout.CENTER); + + javax.swing.GroupLayout videoFiltersPanelLayout = new javax.swing.GroupLayout(videoFiltersPanel); + videoFiltersPanel.setLayout(videoFiltersPanelLayout); + videoFiltersPanelLayout.setHorizontalGroup( + videoFiltersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(videoFiltersPanelLayout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(videoFiltersSplitPane) + .addGap(8, 8, 8)) + ); + videoFiltersPanelLayout.setVerticalGroup( + videoFiltersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(videoFiltersPanelLayout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(videoFiltersSplitPane) + .addGap(8, 8, 8)) + ); videoFiltersScrollPane.setViewportView(videoFiltersPanel); From 2af7b14da98dc3025db51e7a92d62baf2ba67fc8 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 19:45:50 -0400 Subject: [PATCH 32/51] 6305 hcange some text --- .../org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED | 4 ++-- .../src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form | 2 +- .../src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java | 2 +- .../sleuthkit/autopsy/discovery/DiscoveryTopComponent.form | 2 ++ .../sleuthkit/autopsy/discovery/DiscoveryTopComponent.java | 5 ++++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 9a676bb1b9..4c619694a1 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -11,7 +11,7 @@ DiscoveryTopComponent.name=\ Discovery DiscoveryTopComponent.newSearch.text=New Search DiscoveryTopComponent.searchCancelled.text=Search has been cancelled. # {0} - search -DiscoveryTopComponent.searchComplete.text=Results displayed have the following filters applied: {0} +DiscoveryTopComponent.searchComplete.text=Results for {0} # {0} - searchType DiscoveryTopComponent.searchInProgress.text=Performing search for results of type {0}. Please wait. DiscoveryUiUtility.bytes.text=bytes @@ -256,10 +256,10 @@ DiscoveryDialog.groupByLabel.text=Group By: DiscoveryDialog.orderByLabel.text=Order Within Groups By: DiscoveryDialog.orderGroupsByLabel.text=Order Groups By: ImageFilterPanel.imageFiltersSplitPane.toolTipText= -DiscoveryDialog.jLabel1.text=Step 1: Choose result type DocumentFilterPanel.documentsFiltersSplitPane.border.title=Step 2: Filter which documents to show ImageFilterPanel.imageFiltersSplitPane.border.title=Step 2: Filter which images to show VideoFilterPanel.videoFiltersSplitPane.border.title=Step 2: Filter which videos to show +DiscoveryDialog.step1Label.text=Step 1: Choose result type VideoThumbnailPanel.bytes.text=bytes VideoThumbnailPanel.deleted.text=All instances of file are deleted. VideoThumbnailPanel.gigaBytes.text=GB diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 737ee86d50..3450ae7817 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -7,7 +7,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 2dad36864f..9cd5d922d9 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -204,7 +204,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setMinimumSize(new java.awt.Dimension(600, 300)); - setPreferredSize(new java.awt.Dimension(1200, 600)); + setPreferredSize(new java.awt.Dimension(1000, 650)); imagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/pictures-icon.png"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(imagesButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.imagesButton.text")); // NOI18N diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index 2cfc3be255..bb144b8173 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -136,7 +136,9 @@ + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index eb5af839e8..a0577b46cf 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -158,7 +158,9 @@ public final class DiscoveryTopComponent extends TopComponent { progressMessageTextArea.setBackground(new java.awt.Color(240, 240, 240)); progressMessageTextArea.setColumns(20); + progressMessageTextArea.setLineWrap(true); progressMessageTextArea.setRows(2); + progressMessageTextArea.setWrapStyleWord(true); progressMessageTextArea.setBorder(null); progressMessageScrollPane.setViewportView(progressMessageTextArea); @@ -254,11 +256,12 @@ public final class DiscoveryTopComponent extends TopComponent { @Subscribe @Messages({"DiscoveryTopComponent.newSearch.text=New Search", "# {0} - search", - "DiscoveryTopComponent.searchComplete.text=Results displayed have the following filters applied: {0}"}) + "DiscoveryTopComponent.searchComplete.text=Results for {0}"}) void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) { newSearchButton.setText(Bundle.DiscoveryTopComponent_newSearch_text()); progressMessageTextArea.setForeground(Color.black); progressMessageTextArea.setText(Bundle.DiscoveryTopComponent_searchComplete_text(searchCompleteEvent.getFilters().stream().map(FileFilter::getDesc).collect(Collectors.joining(", ")))); + progressMessageTextArea.setCaretPosition(0); } /** From 628c2384d480b9e0d9f4438eeb6747ce11d484d4 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 20:38:38 -0400 Subject: [PATCH 33/51] 6305 first batch of codacy fixes --- .../autopsy/discovery/DetailsPanel.java | 2 +- .../autopsy/discovery/DiscoveryDialog.form | 12 +- .../autopsy/discovery/DiscoveryDialog.java | 128 ++++++------------ .../discovery/DiscoveryTopComponent.form | 8 +- .../discovery/DiscoveryTopComponent.java | 39 ++---- .../autopsy/discovery/DiscoveryUiUtils.java | 39 ++++++ .../discovery/DocumentFilterPanel.form | 8 ++ .../discovery/DocumentFilterPanel.java | 6 +- .../autopsy/discovery/ImageFilterPanel.form | 8 ++ .../autopsy/discovery/ImageFilterPanel.java | 6 +- .../discovery/OpenDiscoveryAction.java | 5 +- .../autopsy/discovery/ResultsPanel.java | 4 +- .../autopsy/discovery/SwingAnimator.java | 2 +- .../autopsy/discovery/VideoFilterPanel.form | 8 ++ .../autopsy/discovery/VideoFilterPanel.java | 6 +- 15 files changed, 150 insertions(+), 131 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java index fed9cd4f6b..6b0a37e276 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DetailsPanel.java @@ -53,7 +53,7 @@ final class DetailsPanel extends javax.swing.JPanel { private final DataContentPanel dataContentPanel; private final DefaultListModel instancesListModel = new DefaultListModel<>(); - private ListSelectionListener listener = null; + private final ListSelectionListener listener; /** * Creates new form DetailsPanel. diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 3450ae7817..743a25fc1c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -166,6 +166,10 @@ + + + + @@ -180,12 +184,18 @@ + + - + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 9cd5d922d9..cdbe78473f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -23,27 +23,19 @@ import java.awt.Color; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.EnumSet; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.logging.Level; -import javax.swing.JOptionPane; import org.apache.commons.lang.StringUtils; import org.openide.util.NbBundle.Messages; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.discovery.FileGroup.GroupSortingAlgorithm; import org.sleuthkit.autopsy.discovery.FileSearch.GroupingAttributeType; import org.sleuthkit.autopsy.discovery.FileSorter.SortingMethod; -import org.sleuthkit.datamodel.DataSource; -import org.sleuthkit.datamodel.IngestJobInfo; -import org.sleuthkit.datamodel.SleuthkitCase; -import org.sleuthkit.datamodel.TskCoreException; /** * Dialog for displaying the controls and filters for configuration of a @@ -61,7 +53,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { private static final Color SELECTED_COLOR = new Color(216, 230, 242); private static final Color UNSELECTED_COLOR = new Color(240, 240, 240); private SearchWorker searchWorker = null; - private static DiscoveryDialog discoveryDialog; + private static DiscoveryDialog discDialog; private FileSearchData.FileType fileType = FileSearchData.FileType.IMAGE; private final PropertyChangeListener listener; @@ -71,10 +63,10 @@ final class DiscoveryDialog extends javax.swing.JDialog { * @return The instance of the Discovery Dialog. */ static synchronized DiscoveryDialog getDiscoveryDialogInstance() { - if (discoveryDialog == null) { - discoveryDialog = new DiscoveryDialog(); + if (discDialog == null) { + discDialog = new DiscoveryDialog(); } - return discoveryDialog; + return discDialog; } /** @@ -88,13 +80,8 @@ final class DiscoveryDialog extends javax.swing.JDialog { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("FilterError") && evt.getNewValue() != null) { - String errorMessage = evt.getNewValue().toString(); - if (!StringUtils.isBlank(errorMessage)) { - setInvalid(errorMessage); - return; - } + setValid(evt.getNewValue().toString()); } - setValid(); } }; for (GroupSortingAlgorithm groupSortAlgorithm : GroupSortingAlgorithm.values()) { @@ -128,6 +115,15 @@ final class DiscoveryDialog extends javax.swing.JDialog { fileType = FileSearchData.FileType.IMAGE; add(imageFilterPanel, CENTER); imageFilterPanel.addPropertyChangeListener(listener); + updateComboBoxes(); + pack(); + repaint(); + } + + /** + * Private helper method to perform combo box updates. + */ + private void updateComboBoxes() { groupByCombobox.removeAllItems(); // Set up the grouping attributes for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGrouping()) { @@ -146,8 +142,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { } } groupSortingComboBox.setSelectedIndex(0); - pack(); - repaint(); } /** @@ -169,7 +163,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { if (documentFilterPanel != null) { documentFilterPanel.validateFields(); } - return; + break; default: break; } @@ -188,9 +182,9 @@ final class DiscoveryDialog extends javax.swing.JDialog { imagesButton = new javax.swing.JButton(); videosButton = new javax.swing.JButton(); documentsButton = new javax.swing.JButton(); - step1Label = new javax.swing.JLabel(); - filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(104, 0), new java.awt.Dimension(104, 0), new java.awt.Dimension(104, 32767)); - jPanel1 = new javax.swing.JPanel(); + javax.swing.JLabel step1Label = new javax.swing.JLabel(); + javax.swing.Box.Filler filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(104, 0), new java.awt.Dimension(104, 0), new java.awt.Dimension(104, 32767)); + javax.swing.JPanel displaySettingsPanel = new javax.swing.JPanel(); searchButton = new javax.swing.JButton(); errorLabel = new javax.swing.JLabel(); javax.swing.JButton cancelButton = new javax.swing.JButton(); @@ -344,15 +338,15 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addGap(8, 8, 8)) ); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + javax.swing.GroupLayout displaySettingsPanelLayout = new javax.swing.GroupLayout(displaySettingsPanel); + displaySettingsPanel.setLayout(displaySettingsPanelLayout); + displaySettingsPanelLayout.setHorizontalGroup( + displaySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, displaySettingsPanelLayout.createSequentialGroup() .addGap(8, 8, 8) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(displaySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE) - .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(displaySettingsPanelLayout.createSequentialGroup() .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 575, Short.MAX_VALUE) .addGap(18, 18, 18) .addComponent(cancelButton) @@ -360,21 +354,21 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addComponent(searchButton))) .addGap(8, 8, 8)) ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + displaySettingsPanelLayout.setVerticalGroup( + displaySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, displaySettingsPanelLayout.createSequentialGroup() .addGap(8, 8, 8) .addComponent(sortingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(8, 8, 8) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(displaySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(displaySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cancelButton) .addComponent(searchButton))) .addGap(8, 8, 8)) ); - getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_END); + getContentPane().add(displaySettingsPanel, java.awt.BorderLayout.PAGE_END); pack(); }// //GEN-END:initComponents @@ -461,7 +455,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { // Get the selected filters final DiscoveryTopComponent tc = DiscoveryTopComponent.getTopComponent(); if (tc == null) { - setInvalid("No Top Component Found"); + setValid("No Top Component Found"); return; } if (tc.isOpened() == false) { @@ -519,64 +513,30 @@ final class DiscoveryDialog extends javax.swing.JDialog { } /** - * Helper method to display an error message when the results of the - * Discovery Top component may be incomplete. - */ - void displayErrorMessage() { - //check if modules run and assemble message - try { - SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); - Map dataSourceIngestModules = new HashMap<>(); - for (DataSource dataSource : skCase.getDataSources()) { - dataSourceIngestModules.put(dataSource.getId(), new DataSourceModulesWrapper(dataSource.getName())); - } - - for (IngestJobInfo jobInfo : skCase.getIngestJobs()) { - dataSourceIngestModules.get(jobInfo.getObjectId()).updateModulesRun(jobInfo); - } - String message = ""; - for (DataSourceModulesWrapper dsmodulesWrapper : dataSourceIngestModules.values()) { - message += dsmodulesWrapper.getMessage(); - } - if (!message.isEmpty()) { - JOptionPane.showMessageDialog(discoveryDialog, message, Bundle.OpenDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE); - } - } catch (NoCurrentCaseException | TskCoreException ex) { - logger.log(Level.WARNING, "Exception while determining which modules have been run for Discovery", ex); - } - validateDialog(); - } - - /** - * The settings are valid so enable the Search button - */ - private void setValid() { - errorLabel.setText(""); - searchButton.setEnabled(true); - } - - /** - * The settings are not valid so disable the search button and display the - * given error message. + * The adjust the controls to reflect whether the settings are valid based + * on the error. * - * @param error The error message to display. + * @param error The error message to display, null if there is no error. */ - private void setInvalid(String error) { - errorLabel.setText(error); - searchButton.setEnabled(false); + private void setValid(String error) { + if (StringUtils.isBlank(error)) { + errorLabel.setText(""); + searchButton.setEnabled(true); + } else { + errorLabel.setText(error); + searchButton.setEnabled(false); + } } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton documentsButton; private javax.swing.JLabel errorLabel; - private javax.swing.Box.Filler filler1; private javax.swing.JComboBox groupByCombobox; private javax.swing.JComboBox groupSortingComboBox; private javax.swing.JButton imagesButton; - private javax.swing.JPanel jPanel1; private javax.swing.JComboBox orderByCombobox; private javax.swing.JButton searchButton; - private javax.swing.JLabel step1Label; private javax.swing.JButton videosButton; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form index bb144b8173..4e62b44cb9 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.form @@ -61,7 +61,11 @@ - + + + + + @@ -125,6 +129,8 @@ + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java index a0577b46cf..30341184ad 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryTopComponent.java @@ -98,7 +98,7 @@ public final class DiscoveryTopComponent extends TopComponent { @Override protected void componentClosed() { - cancelCurrentSearch(); + DiscoveryDialog.getDiscoveryDialogInstance().cancelSearch(); DiscoveryEventUtils.getDiscoveryEventBus().unregister(this); DiscoveryEventUtils.getDiscoveryEventBus().unregister(groupListPanel); DiscoveryEventUtils.getDiscoveryEventBus().unregister(resultsPanel); @@ -106,13 +106,6 @@ public final class DiscoveryTopComponent extends TopComponent { super.componentClosed(); } - /** - * Cancel the in progress search. - */ - private void cancelCurrentSearch() { - DiscoveryDialog.getDiscoveryDialogInstance().cancelSearch(); - } - /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -124,9 +117,9 @@ public final class DiscoveryTopComponent extends TopComponent { mainSplitPane = new javax.swing.JSplitPane(); rightSplitPane = new AnimatedSplitPane(); - jPanel1 = new javax.swing.JPanel(); + javax.swing.JPanel searchDetailsPanel = new javax.swing.JPanel(); newSearchButton = new javax.swing.JButton(); - progressMessageScrollPane = new javax.swing.JScrollPane(); + javax.swing.JScrollPane progressMessageScrollPane = new javax.swing.JScrollPane(); progressMessageTextArea = new javax.swing.JTextArea(); setMinimumSize(new java.awt.Dimension(199, 200)); @@ -164,31 +157,31 @@ public final class DiscoveryTopComponent extends TopComponent { progressMessageTextArea.setBorder(null); progressMessageScrollPane.setViewportView(progressMessageTextArea); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() + javax.swing.GroupLayout searchDetailsPanelLayout = new javax.swing.GroupLayout(searchDetailsPanel); + searchDetailsPanel.setLayout(searchDetailsPanelLayout); + searchDetailsPanelLayout.setHorizontalGroup( + searchDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(searchDetailsPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(newSearchButton, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(progressMessageScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 954, Short.MAX_VALUE) .addContainerGap()) ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() + searchDetailsPanelLayout.setVerticalGroup( + searchDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(searchDetailsPanelLayout.createSequentialGroup() + .addGroup(searchDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(searchDetailsPanelLayout.createSequentialGroup() .addGap(8, 8, 8) .addComponent(progressMessageScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(searchDetailsPanelLayout.createSequentialGroup() .addGap(17, 17, 17) .addComponent(newSearchButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); - add(jPanel1, java.awt.BorderLayout.PAGE_START); + add(searchDetailsPanel, java.awt.BorderLayout.PAGE_START); }// //GEN-END:initComponents private void newSearchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newSearchButtonActionPerformed @@ -322,10 +315,8 @@ public final class DiscoveryTopComponent extends TopComponent { } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JPanel jPanel1; private javax.swing.JSplitPane mainSplitPane; private javax.swing.JButton newSearchButton; - private javax.swing.JScrollPane progressMessageScrollPane; private javax.swing.JTextArea progressMessageTextArea; private javax.swing.JSplitPane rightSplitPane; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java index 4c1497d898..3890751dc7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryUiUtils.java @@ -22,14 +22,23 @@ import java.awt.Component; import java.awt.Point; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.logging.Level; import javax.swing.ImageIcon; import javax.swing.JComponent; +import javax.swing.JOptionPane; import org.openide.util.ImageUtilities; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.DataSource; +import org.sleuthkit.datamodel.IngestJobInfo; +import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; /** @@ -37,6 +46,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ final class DiscoveryUiUtils { + private final static Logger logger = Logger.getLogger(DiscoveryUiUtils.class.getName()); private static final int BYTE_UNIT_CONVERSION = 1000; private static final int ICON_SIZE = 16; private static final String RED_CIRCLE_ICON_PATH = "org/sleuthkit/autopsy/images/red-circle-exclamation.png"; @@ -193,6 +203,35 @@ final class DiscoveryUiUtils { return ICON_SIZE; } + /** + * Helper method to display an error message when the results of the + * Discovery Top component may be incomplete. + */ + static void displayErrorMessage(DiscoveryDialog dialog) { + //check if modules run and assemble message + try { + SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); + Map dataSourceIngestModules = new HashMap<>(); + for (DataSource dataSource : skCase.getDataSources()) { + dataSourceIngestModules.put(dataSource.getId(), new DataSourceModulesWrapper(dataSource.getName())); + } + + for (IngestJobInfo jobInfo : skCase.getIngestJobs()) { + dataSourceIngestModules.get(jobInfo.getObjectId()).updateModulesRun(jobInfo); + } + String message = ""; + for (DataSourceModulesWrapper dsmodulesWrapper : dataSourceIngestModules.values()) { + message += dsmodulesWrapper.getMessage(); + } + if (!message.isEmpty()) { + JOptionPane.showMessageDialog(dialog, message, Bundle.OpenDiscoveryAction_resultsIncomplete_text(), JOptionPane.INFORMATION_MESSAGE); + } + } catch (NoCurrentCaseException | TskCoreException ex) { + logger.log(Level.WARNING, "Exception while determining which modules have been run for Discovery", ex); + } + dialog.validateDialog(); + } + /** * Private constructor for DiscoveryUiUtils utility class. */ diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form index 3f721b2d96..a1c49c4c07 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.form @@ -17,6 +17,10 @@ + + + + @@ -26,6 +30,10 @@ + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java index 5bb182368f..9756045387 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DocumentFilterPanel.java @@ -59,8 +59,8 @@ final class DocumentFilterPanel extends AbstractFiltersPanel { // //GEN-BEGIN:initComponents private void initComponents() { - documentFiltersScrollPane = new javax.swing.JScrollPane(); - documentFiltersPanel = new javax.swing.JPanel(); + javax.swing.JScrollPane documentFiltersScrollPane = new javax.swing.JScrollPane(); + javax.swing.JPanel documentFiltersPanel = new javax.swing.JPanel(); documentsFiltersSplitPane = new javax.swing.JSplitPane(); setLayout(new java.awt.BorderLayout()); @@ -94,8 +94,6 @@ final class DocumentFilterPanel extends AbstractFiltersPanel { return FILE_TYPE; } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JPanel documentFiltersPanel; - private javax.swing.JScrollPane documentFiltersScrollPane; private javax.swing.JSplitPane documentsFiltersSplitPane; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form index f48616f1ca..7a3374f5cb 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.form @@ -17,6 +17,10 @@ + + + + @@ -26,6 +30,10 @@ + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java index d73c79d795..8eec6dd60f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ImageFilterPanel.java @@ -63,8 +63,8 @@ final class ImageFilterPanel extends AbstractFiltersPanel { // //GEN-BEGIN:initComponents private void initComponents() { - imageFiltersScrollPane = new javax.swing.JScrollPane(); - imageFiltersPanel = new javax.swing.JPanel(); + javax.swing.JScrollPane imageFiltersScrollPane = new javax.swing.JScrollPane(); + javax.swing.JPanel imageFiltersPanel = new javax.swing.JPanel(); imageFiltersSplitPane = new javax.swing.JSplitPane(); setLayout(new java.awt.BorderLayout()); @@ -101,8 +101,6 @@ final class ImageFilterPanel extends AbstractFiltersPanel { } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JPanel imageFiltersPanel; - private javax.swing.JScrollPane imageFiltersScrollPane; private javax.swing.JSplitPane imageFiltersSplitPane; // End of variables declaration//GEN-END:variables } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java index 4613617c86..9ef7d5dfe6 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/OpenDiscoveryAction.java @@ -30,7 +30,6 @@ import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.Presenter; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.coreutils.Logger; /** * Class to open the Discovery dialog. Allows the user to run searches and see @@ -45,8 +44,6 @@ import org.sleuthkit.autopsy.coreutils.Logger; @NbBundle.Messages({"CTL_OpenDiscoveryAction=Discovery"}) public final class OpenDiscoveryAction extends CallableSystemAction implements Presenter.Toolbar { - private static final Logger logger = Logger.getLogger(OpenDiscoveryAction.class.getName()); - private static final String DISPLAY_NAME = Bundle.CTL_OpenDiscoveryAction(); private static final long serialVersionUID = 1L; private final JButton toolbarButton = new JButton(); @@ -71,7 +68,7 @@ public final class OpenDiscoveryAction extends CallableSystemAction implements P final DiscoveryDialog discDialog = DiscoveryDialog.getDiscoveryDialogInstance(); discDialog.cancelSearch(); discDialog.setVisible(true); - discDialog.displayErrorMessage(); + DiscoveryUiUtils.displayErrorMessage(discDialog); } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 60f7cbe6ec..33f6846660 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -87,7 +87,6 @@ final class ResultsPanel extends javax.swing.JPanel { imageThumbnailViewer.addListSelectionListener((e) -> { if (resultType == FileSearchData.FileType.IMAGE) { if (!e.getValueIsAdjusting()) { - List files = getInstancesForSelected(); //send populateMesage DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.PopulateInstancesListEvent(getInstancesForSelected())); } else { @@ -291,14 +290,13 @@ final class ResultsPanel extends javax.swing.JPanel { }); } - @Subscribe - /** * Set the page number and retrieve its contents. * * @param startingEntry The index of the first file in the group to include * in this page. */ + @Subscribe private synchronized void setPage(int startingEntry) { int pageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex()); synchronized (this) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java index c3457c43c6..eb5ba0d26f 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SwingAnimator.java @@ -40,7 +40,7 @@ final class SwingAnimator { //duration in milliseconds betweeen each firing of the Timer private static final int INITIAL_TIMING = 10; - private static int timing = INITIAL_TIMING; + private int timing = INITIAL_TIMING; /** * diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form index ec4b154c7c..259a188967 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.form @@ -17,6 +17,10 @@ + + + + @@ -31,6 +35,10 @@ + + + + diff --git a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java index 30b813c3c1..48522a9474 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/VideoFilterPanel.java @@ -60,8 +60,8 @@ final class VideoFilterPanel extends AbstractFiltersPanel { // //GEN-BEGIN:initComponents private void initComponents() { - videoFiltersScrollPane = new javax.swing.JScrollPane(); - videoFiltersPanel = new javax.swing.JPanel(); + javax.swing.JScrollPane videoFiltersScrollPane = new javax.swing.JScrollPane(); + javax.swing.JPanel videoFiltersPanel = new javax.swing.JPanel(); videoFiltersSplitPane = new javax.swing.JSplitPane(); setLayout(new java.awt.BorderLayout()); @@ -98,8 +98,6 @@ final class VideoFilterPanel extends AbstractFiltersPanel { } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JPanel videoFiltersPanel; - private javax.swing.JScrollPane videoFiltersScrollPane; private javax.swing.JSplitPane videoFiltersSplitPane; // End of variables declaration//GEN-END:variables From 693e2c849fe5da5e04145f43a9cd6f4254f25382 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 20:48:21 -0400 Subject: [PATCH 34/51] 6305 second pass at codacy fixes --- .../autopsy/discovery/DiscoveryDialog.java | 16 ++++++++++++---- .../autopsy/discovery/ResultsPanel.java | 1 - 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index cdbe78473f..8f27bd0f29 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -115,15 +115,17 @@ final class DiscoveryDialog extends javax.swing.JDialog { fileType = FileSearchData.FileType.IMAGE; add(imageFilterPanel, CENTER); imageFilterPanel.addPropertyChangeListener(listener); - updateComboBoxes(); + updateGroupByComboBox(); + updateOrderByComboBox(); + groupSortingComboBox.setSelectedIndex(0); pack(); repaint(); } /** - * Private helper method to perform combo box updates. + * Private helper method to perform groupByComboBox update. */ - private void updateComboBoxes() { + private void updateGroupByComboBox() { groupByCombobox.removeAllItems(); // Set up the grouping attributes for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGrouping()) { @@ -134,6 +136,12 @@ final class DiscoveryDialog extends javax.swing.JDialog { groupByCombobox.addItem(type); } } + } + + /** + * Private helper method to perform orderByComboBox update. + */ + private void updateOrderByComboBox() { orderByCombobox.removeAllItems(); // Set up the file order list for (FileSorter.SortingMethod method : FileSorter.SortingMethod.getOptionsForOrdering()) { @@ -141,7 +149,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { orderByCombobox.addItem(method); } } - groupSortingComboBox.setSelectedIndex(0); + } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 33f6846660..23e457a300 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -99,7 +99,6 @@ final class ResultsPanel extends javax.swing.JPanel { documentPreviewViewer.addListSelectionListener((e) -> { if (resultType == FileSearchData.FileType.DOCUMENTS) { if (!e.getValueIsAdjusting()) { - List files = getInstancesForSelected(); //send populateMesage DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.PopulateInstancesListEvent(getInstancesForSelected())); } else { From 88fcf5381d78aa60a2ad71045ab11194ae74d36d Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 21:08:11 -0400 Subject: [PATCH 35/51] 6305 third try on codacy --- .../autopsy/discovery/DiscoveryDialog.java | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 8f27bd0f29..3351defd85 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -129,12 +129,31 @@ final class DiscoveryDialog extends javax.swing.JDialog { groupByCombobox.removeAllItems(); // Set up the grouping attributes for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGrouping()) { - if ((type != GroupingAttributeType.FREQUENCY || CentralRepository.isEnabled()) - && (type != GroupingAttributeType.OBJECT_DETECTED || imageFilterPanel.isObjectsFilterSupported()) - && (type != GroupingAttributeType.INTERESTING_ITEM_SET || imageFilterPanel.isInterestingItemsFilterSupported()) - && (type != GroupingAttributeType.HASH_LIST_NAME || imageFilterPanel.isHashSetFilterSupported())) { - groupByCombobox.addItem(type); + switch (type) { + case FREQUENCY: + if (!CentralRepository.isEnabled()) { + continue; + } + break; + case OBJECT_DETECTED: + if (!imageFilterPanel.isObjectsFilterSupported()) { + continue; + } + break; + case INTERESTING_ITEM_SET: + if (!imageFilterPanel.isInterestingItemsFilterSupported()) { + continue; + } + break; + case HASH_LIST_NAME: + if (!imageFilterPanel.isHashSetFilterSupported()) { + continue; + } + break; + default: + break; } + groupByCombobox.addItem(type); } } From 886d4017747ceb1b464d794afe829a9abf6334b9 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 22:36:38 -0400 Subject: [PATCH 36/51] 6305 attempt to reduce cyclomatic complexity --- .../autopsy/discovery/DiscoveryDialog.java | 81 ++++++++++--------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 3351defd85..e6103e16c7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -115,52 +115,20 @@ final class DiscoveryDialog extends javax.swing.JDialog { fileType = FileSearchData.FileType.IMAGE; add(imageFilterPanel, CENTER); imageFilterPanel.addPropertyChangeListener(listener); - updateGroupByComboBox(); - updateOrderByComboBox(); - groupSortingComboBox.setSelectedIndex(0); + updateComboBoxes(); pack(); repaint(); } /** - * Private helper method to perform groupByComboBox update. + * Private helper method to perform update of comboboxes update. */ - private void updateGroupByComboBox() { + private void updateComboBoxes() { groupByCombobox.removeAllItems(); // Set up the grouping attributes for (FileSearch.GroupingAttributeType type : FileSearch.GroupingAttributeType.getOptionsForGrouping()) { - switch (type) { - case FREQUENCY: - if (!CentralRepository.isEnabled()) { - continue; - } - break; - case OBJECT_DETECTED: - if (!imageFilterPanel.isObjectsFilterSupported()) { - continue; - } - break; - case INTERESTING_ITEM_SET: - if (!imageFilterPanel.isInterestingItemsFilterSupported()) { - continue; - } - break; - case HASH_LIST_NAME: - if (!imageFilterPanel.isHashSetFilterSupported()) { - continue; - } - break; - default: - break; - } - groupByCombobox.addItem(type); + addTypeToGroupByComboBox(type); } - } - - /** - * Private helper method to perform orderByComboBox update. - */ - private void updateOrderByComboBox() { orderByCombobox.removeAllItems(); // Set up the file order list for (FileSorter.SortingMethod method : FileSorter.SortingMethod.getOptionsForOrdering()) { @@ -168,6 +136,47 @@ final class DiscoveryDialog extends javax.swing.JDialog { orderByCombobox.addItem(method); } } + groupSortingComboBox.setSelectedIndex(0); + } + + /** + * Private helper method to add GroupingAttributeType to the + * groupByCombobox. + * + * @param type The Type of GroupingAttribute to add. + */ + private void addTypeToGroupByComboBox(GroupingAttributeType type) { + switch (type) { + case FREQUENCY: + if (!CentralRepository.isEnabled()) { + return; + } + break; + case OBJECT_DETECTED: + if (!imageFilterPanel.isObjectsFilterSupported()) { + return; + } + break; + case INTERESTING_ITEM_SET: + if (!imageFilterPanel.isInterestingItemsFilterSupported()) { + return; + } + break; + case HASH_LIST_NAME: + if (!imageFilterPanel.isHashSetFilterSupported()) { + return; + } + break; + default: + break; + } + groupByCombobox.addItem(type); + } + + /** + * Private helper method to perform orderByComboBox update. + */ + private void updateOrderByComboBox() { } From f912179353dd3101661d4f785485e1b182025f69 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 4 Jun 2020 22:55:56 -0400 Subject: [PATCH 37/51] 6305 remove unused method --- .../org/sleuthkit/autopsy/discovery/DiscoveryDialog.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index e6103e16c7..0a29ca9524 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -173,13 +173,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { groupByCombobox.addItem(type); } - /** - * Private helper method to perform orderByComboBox update. - */ - private void updateOrderByComboBox() { - - } - /** * Validate the current filter settings of the selected type. */ From b66951e74610dc3f913cbeeb225df2e299778b22 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Mon, 8 Jun 2020 13:35:20 -0400 Subject: [PATCH 38/51] 6305 remove cancel button --- .../AbstractDiscoveryFilterPanel.java | 3 +-- .../discovery/AbstractFiltersPanel.java | 4 +++ .../autopsy/discovery/Bundle.properties | 3 +-- .../discovery/Bundle.properties-MERGED | 3 +-- .../discovery/DataSourceFilterPanel.java | 2 +- .../autopsy/discovery/DiscoveryDialog.form | 25 +++---------------- .../autopsy/discovery/DiscoveryDialog.java | 24 +++--------------- .../autopsy/discovery/HashSetFilterPanel.java | 2 +- .../InterestingItemsFilterPanel.java | 2 +- .../discovery/ObjectDetectedFilterPanel.java | 2 +- .../discovery/ParentFolderFilterPanel.java | 2 +- .../discovery/PastOccurrencesFilterPanel.java | 2 +- .../autopsy/discovery/SizeFilterPanel.java | 2 +- .../discovery/UserCreatedFilterPanel.java | 2 +- 14 files changed, 22 insertions(+), 56 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java index 08967a2d86..24d8a8e946 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractDiscoveryFilterPanel.java @@ -69,8 +69,7 @@ abstract class AbstractDiscoveryFilterPanel extends javax.swing.JPanel { /** * Check if this filter is configured to valid settings. * - * @return True if the filter is configured with valid search settings, - * false otherwise. + * @return If the settings are invalid returns the error that has occurred, otherwise returns empty string. */ abstract String checkForError(); diff --git a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java index 9491f2baa2..7bcd1c8243 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/AbstractFiltersPanel.java @@ -191,6 +191,8 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li @Override public void actionPerformed(ActionEvent e) { validateFields(); + validate(); + repaint(); } /** @@ -258,6 +260,8 @@ abstract class AbstractFiltersPanel extends JPanel implements ActionListener, Li public void valueChanged(ListSelectionEvent evt) { if (!evt.getValueIsAdjusting()) { validateFields(); + validate(); + repaint(); } } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties index ae464e98e1..52c989c8e7 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties @@ -62,8 +62,7 @@ FileSearchPanel.userCreatedCheckbox.text=Possibly User Created DiscoveryDialog.documentsButton.text=Documents DiscoveryDialog.videosButton.text=Videos DiscoveryDialog.imagesButton.text=Images -DiscoveryDialog.searchButton.text=Show -DiscoveryDialog.cancelButton.text=Cancel +DiscoveryDialog.searchButton.text=Search DetailsPanel.instancesList.border.title=Instances SizeFilterPanel.sizeCheckbox.text=File Size: DataSourceFilterPanel.dataSourceCheckbox.text=Data Source: diff --git a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED index 4c619694a1..0779798a6e 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/discovery/Bundle.properties-MERGED @@ -218,8 +218,7 @@ FileSearchPanel.userCreatedCheckbox.text=Possibly User Created DiscoveryDialog.documentsButton.text=Documents DiscoveryDialog.videosButton.text=Videos DiscoveryDialog.imagesButton.text=Images -DiscoveryDialog.searchButton.text=Show -DiscoveryDialog.cancelButton.text=Cancel +DiscoveryDialog.searchButton.text=Search DetailsPanel.instancesList.border.title=Instances ResultsPanel.unableToCreate.text=Unable to create summary. ResultsPanel.viewFileInDir.name=View File in Directory diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java index e6b937d2f4..a2a2cf4de9 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DataSourceFilterPanel.java @@ -190,7 +190,7 @@ final class DataSourceFilterPanel extends AbstractDiscoveryFilterPanel { if (dataSourceCheckbox.isSelected() && dataSourceList.getSelectedValuesList().isEmpty()) { return "At least one size must be selected"; } - return null; + return ""; } @Override diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form index 743a25fc1c..d19a7dda96 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.form @@ -211,10 +211,8 @@ - - - - + + @@ -229,10 +227,7 @@ - - - - + @@ -257,20 +252,6 @@ - - - - - - - - - - - - - - diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java index 0a29ca9524..948dbd4bee 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryDialog.java @@ -216,7 +216,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { javax.swing.JPanel displaySettingsPanel = new javax.swing.JPanel(); searchButton = new javax.swing.JButton(); errorLabel = new javax.swing.JLabel(); - javax.swing.JButton cancelButton = new javax.swing.JButton(); javax.swing.JPanel sortingPanel = new javax.swing.JPanel(); groupByCombobox = new javax.swing.JComboBox<>(); orderByCombobox = new javax.swing.JComboBox<>(); @@ -316,13 +315,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { errorLabel.setForeground(new java.awt.Color(255, 0, 0)); - org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.cancelButton.text")); // NOI18N - cancelButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - cancelButtonActionPerformed(evt); - } - }); - sortingPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DiscoveryDialog.class, "DiscoveryDialog.sortingPanel.border.title"))); // NOI18N sortingPanel.setPreferredSize(new java.awt.Dimension(345, 112)); @@ -377,10 +369,8 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addComponent(sortingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE) .addGroup(displaySettingsPanelLayout.createSequentialGroup() .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 575, Short.MAX_VALUE) - .addGap(18, 18, 18) - .addComponent(cancelButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(searchButton))) + .addGap(65, 65, 65) + .addComponent(searchButton, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(8, 8, 8)) ); displaySettingsPanelLayout.setVerticalGroup( @@ -391,9 +381,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { .addGap(8, 8, 8) .addGroup(displaySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(errorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(displaySettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(cancelButton) - .addComponent(searchButton))) + .addComponent(searchButton)) .addGap(8, 8, 8)) ); @@ -528,10 +516,6 @@ final class DiscoveryDialog extends javax.swing.JDialog { setVisible(false); } - private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed - this.setVisible(false); - }//GEN-LAST:event_cancelButtonActionPerformed - /** * Cancel the searchWorker if it exists. */ @@ -545,7 +529,7 @@ final class DiscoveryDialog extends javax.swing.JDialog { * The adjust the controls to reflect whether the settings are valid based * on the error. * - * @param error The error message to display, null if there is no error. + * @param error The error message to display, empty string if there is no error. */ private void setValid(String error) { if (StringUtils.isBlank(error)) { diff --git a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java index 478c7c7fc4..eaad0f06f2 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/HashSetFilterPanel.java @@ -152,7 +152,7 @@ final class HashSetFilterPanel extends AbstractDiscoveryFilterPanel { if (hashSetCheckbox.isSelected() && hashSetList.getSelectedValuesList().isEmpty()) { return "At least one hash set name must be selected"; } - return null; + return ""; } @Override diff --git a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java index cc2dbb9009..a073d6b928 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/InterestingItemsFilterPanel.java @@ -147,7 +147,7 @@ final class InterestingItemsFilterPanel extends AbstractDiscoveryFilterPanel { if (interestingItemsCheckbox.isSelected() && interestingItemsList.getSelectedValuesList().isEmpty()) { return "At least one interesting file set name must be selected"; } - return null; + return ""; } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java index aa212dcd01..335ca8af43 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ObjectDetectedFilterPanel.java @@ -158,7 +158,7 @@ final class ObjectDetectedFilterPanel extends AbstractDiscoveryFilterPanel { if (objectsCheckbox.isSelected() && objectsList.getSelectedValuesList().isEmpty()) { return "At least one object type name must be selected"; } - return null; + return ""; } @Override diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index 98df249c77..00d59e0233 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -277,7 +277,7 @@ final class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { if (parentCheckbox.isSelected() && getParentPaths().isEmpty()) { return "At least one parent path must be entered"; } - return null; + return ""; } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java index 3c730f533f..f80bfbfad5 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/PastOccurrencesFilterPanel.java @@ -145,7 +145,7 @@ final class PastOccurrencesFilterPanel extends AbstractDiscoveryFilterPanel { if (pastOccurrencesCheckbox.isSelected() && crFrequencyList.getSelectedValuesList().isEmpty()) { return "At least one value in the past occurrence filter must be selected"; } - return null; + return ""; } @Override diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index 530cc24963..021a71d4f4 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -168,7 +168,7 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { if (sizeCheckbox.isSelected() && sizeList.getSelectedValuesList().isEmpty()) { return "At least one size must be selected"; } - return null; + return ""; } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java index 5ee4a2e5c0..6c0ca9d67a 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/UserCreatedFilterPanel.java @@ -85,7 +85,7 @@ final class UserCreatedFilterPanel extends AbstractDiscoveryFilterPanel { @Override String checkForError() { //this filter currently has no errors it generates - return null; + return ""; } // Variables declaration - do not modify//GEN-BEGIN:variables From 8c8749a17ad32ee810b95c746039a39eef2804b7 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 10 Jun 2020 08:11:12 -0400 Subject: [PATCH 39/51] updates based on comments from github issue --- .../actionhelpers/Bundle.properties | 1 - .../actionhelpers/Bundle.properties-MERGED | 1 - .../actionhelpers/ExtractActionHelper.java | 37 +++++++++++-------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties index 310cf0a475..291cf91df5 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties @@ -3,6 +3,5 @@ ExtractActionHelper.confDlg.destFileExist.msg=Destination file {0} already exist ExtractActionHelper.confDlg.destFileExist.title=File Exists ExtractActionHelper.msgDlg.cantOverwriteFile.msg=Could not overwrite existing file {0} ExtractActionHelper.notifyDlg.noFileToExtr.msg=No file(s) to extract. -ExtractActionHelper.progress.extracting=Extracting ExtractActionHelper.progress.cancellingExtraction={0} (Cancelling...) ExtractActionHelper.done.notifyMsg.fileExtr.text=File(s) extracted. diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties-MERGED index f86fa5612d..80b5c12893 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties-MERGED @@ -4,6 +4,5 @@ ExtractActionHelper.confDlg.destFileExist.title=File Exists ExtractActionHelper.msgDlg.cantOverwriteFile.msg=Could not overwrite existing file {0} ExtractActionHelper.noOpenCase.errMsg=No open case available. ExtractActionHelper.notifyDlg.noFileToExtr.msg=No file(s) to extract. -ExtractActionHelper.progress.extracting=Extracting ExtractActionHelper.progress.cancellingExtraction={0} (Cancelling...) ExtractActionHelper.done.notifyMsg.fileExtr.text=File(s) extracted. diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java index 339a58142d..5c2eb95250 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java @@ -35,6 +35,7 @@ import javax.swing.SwingWorker; import org.netbeans.api.progress.ProgressHandle; import org.openide.util.Cancellable; import org.openide.util.NbBundle; +import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.FileUtil; @@ -97,7 +98,7 @@ public class ExtractActionHelper { ArrayList fileExtractionTasks = new ArrayList<>(); fileExtractionTasks.add(new FileExtractionTask(selectedFile, fileChooser.getSelectedFile())); - runExtractionTasks(event, fileExtractionTasks); + runExtractionTasks(event, fileExtractionTasks, fileChooser.getSelectedFile().getName()); } } @@ -147,7 +148,7 @@ public class ExtractActionHelper { // If there is an attribute name, change the ":". Otherwise the extracted file will be hidden fileExtractionTasks.add(new FileExtractionTask(source, new File(destinationFolder, source.getId() + "-" + FileUtil.escapeFileName(source.getName())))); } - runExtractionTasks(event, fileExtractionTasks); + runExtractionTasks(event, fileExtractionTasks, destinationFolder.getName()); } } @@ -196,8 +197,9 @@ public class ExtractActionHelper { * @param event ActionEvent whose source will be used for * centering popup dialogs. * @param fileExtractionTasks List of file extraction tasks. + * @param destName Name of the destination used for progress messages. */ - private void runExtractionTasks(ActionEvent event, List fileExtractionTasks) { + private void runExtractionTasks(ActionEvent event, List fileExtractionTasks, String destName) { // verify all of the sources and destinations are OK for (Iterator it = fileExtractionTasks.iterator(); it.hasNext();) { @@ -231,7 +233,7 @@ public class ExtractActionHelper { // launch a thread to do the work if (!fileExtractionTasks.isEmpty()) { try { - FileExtracter extracter = new FileExtracter(fileExtractionTasks); + FileExtracter extracter = new FileExtracter(fileExtractionTasks, destName); extracter.execute(); } catch (Exception ex) { logger.log(Level.WARNING, "Unable to start background file extraction thread", ex); //NON-NLS @@ -268,6 +270,7 @@ public class ExtractActionHelper { private class FileExtracter extends SwingWorker { private final Logger logger = Logger.getLogger(FileExtracter.class.getName()); + private final String destName; private ProgressHandle progress; private final List extractionTasks; @@ -275,19 +278,27 @@ public class ExtractActionHelper { * Create an instance of the FileExtracter. * * @param extractionTasks List of file extraction tasks. + * @param destName Name of the destination used for progress messages. */ - FileExtracter(List extractionTasks) { + FileExtracter(List extractionTasks, String destName) { this.extractionTasks = extractionTasks; + this.destName = destName; } @Override + @Messages({ + "# {0} - outputFolderName", + "ExtractActionHelper.progress.extracting=Extracting=Extracting to {0}", + "# {0} - fileName", + "ExtractActionHelper.progress.fileExtracting=Extracting=Extracting file: {0}" + }) protected Object doInBackground() throws Exception { if (extractionTasks.isEmpty()) { return null; } // Setup progress bar. - final String displayName = NbBundle.getMessage(this.getClass(), "ExtractActionHelper.progress.extracting"); + final String displayName = Bundle.ExtractActionHelper_progress_extracting(destName); progress = ProgressHandle.createHandle(displayName, new Cancellable() { @Override public boolean cancel() { @@ -301,18 +312,14 @@ public class ExtractActionHelper { progress.start(); progress.switchToIndeterminate(); - /* - * @@@ Add back in -> Causes exceptions int workUnits = 0; for - * (FileExtractionTask task : extractionTasks) { workUnits += - * calculateProgressBarWorkUnits(task.source); } - * progress.switchToDeterminate(workUnits); - */ // Do the extraction tasks. - for (FileExtractionTask task : this.extractionTasks) { - // @@@ Note, we are no longer passing in progress + for (int i = 0; i < this.extractionTasks.size(); i++) { + FileExtractionTask task = this.extractionTasks.get(i); + progress.progress(Bundle.ExtractActionHelper_progress_fileExtracting(task.destination.getName())); + ContentUtils.ExtractFscContentVisitor.extract(task.source, task.destination, null, this); } - + return null; } From 677f4007413168deec00a9500a210ca00cdc2c26 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 10 Jun 2020 10:53:54 -0400 Subject: [PATCH 40/51] updated messages --- .../directorytree/actionhelpers/Bundle.properties-MERGED | 4 ++++ .../directorytree/actionhelpers/ExtractActionHelper.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties-MERGED index 80b5c12893..ec1a9bc5cc 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/Bundle.properties-MERGED @@ -6,3 +6,7 @@ ExtractActionHelper.noOpenCase.errMsg=No open case available. ExtractActionHelper.notifyDlg.noFileToExtr.msg=No file(s) to extract. ExtractActionHelper.progress.cancellingExtraction={0} (Cancelling...) ExtractActionHelper.done.notifyMsg.fileExtr.text=File(s) extracted. +# {0} - outputFolderName +ExtractActionHelper.progress.extracting=Extracting to {0} +# {0} - fileName +ExtractActionHelper.progress.fileExtracting=Extracting file: {0} diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java index 5c2eb95250..b9de08d20b 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java @@ -288,9 +288,9 @@ public class ExtractActionHelper { @Override @Messages({ "# {0} - outputFolderName", - "ExtractActionHelper.progress.extracting=Extracting=Extracting to {0}", + "ExtractActionHelper.progress.extracting=Extracting to {0}", "# {0} - fileName", - "ExtractActionHelper.progress.fileExtracting=Extracting=Extracting file: {0}" + "ExtractActionHelper.progress.fileExtracting=Extracting file: {0}" }) protected Object doInBackground() throws Exception { if (extractionTasks.isEmpty()) { From c6e33cfb83cedcf0f6ca073adb984d6fadb2a879 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 10 Jun 2020 10:55:05 -0400 Subject: [PATCH 41/51] formatting --- .../actionhelpers/ExtractActionHelper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java index b9de08d20b..fa63908246 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java @@ -197,7 +197,8 @@ public class ExtractActionHelper { * @param event ActionEvent whose source will be used for * centering popup dialogs. * @param fileExtractionTasks List of file extraction tasks. - * @param destName Name of the destination used for progress messages. + * @param destName Name of the destination used for progress + * messages. */ private void runExtractionTasks(ActionEvent event, List fileExtractionTasks, String destName) { @@ -278,7 +279,8 @@ public class ExtractActionHelper { * Create an instance of the FileExtracter. * * @param extractionTasks List of file extraction tasks. - * @param destName Name of the destination used for progress messages. + * @param destName Name of the destination used for progress + * messages. */ FileExtracter(List extractionTasks, String destName) { this.extractionTasks = extractionTasks; @@ -316,10 +318,10 @@ public class ExtractActionHelper { for (int i = 0; i < this.extractionTasks.size(); i++) { FileExtractionTask task = this.extractionTasks.get(i); progress.progress(Bundle.ExtractActionHelper_progress_fileExtracting(task.destination.getName())); - + ContentUtils.ExtractFscContentVisitor.extract(task.source, task.destination, null, this); } - + return null; } From 510ed81d606b39b28728211f38d82673479dbcde Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Wed, 10 Jun 2020 11:31:06 -0400 Subject: [PATCH 42/51] small code revert --- .../directorytree/actionhelpers/ExtractActionHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java index fa63908246..5bdec7daa6 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/actionhelpers/ExtractActionHelper.java @@ -315,8 +315,7 @@ public class ExtractActionHelper { progress.switchToIndeterminate(); // Do the extraction tasks. - for (int i = 0; i < this.extractionTasks.size(); i++) { - FileExtractionTask task = this.extractionTasks.get(i); + for (FileExtractionTask task : this.extractionTasks) { progress.progress(Bundle.ExtractActionHelper_progress_fileExtracting(task.destination.getName())); ContentUtils.ExtractFscContentVisitor.extract(task.source, task.destination, null, this); From 7dc55a7289596b23fd930b14cd24b4aac2633be4 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 17 Jun 2020 11:02:30 -0400 Subject: [PATCH 43/51] 6305 address Jira comments --- .../sleuthkit/autopsy/discovery/DiscoveryEventUtils.java | 2 -- .../org/sleuthkit/autopsy/discovery/FileSearchData.java | 7 ++++--- .../autopsy/discovery/ParentFolderFilterPanel.java | 2 -- .../org/sleuthkit/autopsy/discovery/SizeFilterPanel.java | 6 +++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java index aca3519b49..ea5fca6676 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/DiscoveryEventUtils.java @@ -100,7 +100,6 @@ final class DiscoveryEventUtils { */ PopulateInstancesListEvent(List files) { instances = files; - //no arg constructor } /** @@ -389,7 +388,6 @@ final class DiscoveryEventUtils { */ DetailsVisibleEvent(boolean isVisible) { showDetailsArea = isVisible; - //no arg constructor } /** diff --git a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java index 7ef5e1188f..40df3ee905 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/FileSearchData.java @@ -250,11 +250,12 @@ final class FileSearchData { } /** - * Get the list of enums that are valid for image sizes. + * Get the list of enums that are valid for most file sizes. * - * @return enums that can be used to filter images by size. + * @return Enums that can be used to filter most file including images + * by size. */ - static List getOptionsForImages() { + static List getDefaultSizeOptions() { return Arrays.asList(XXLARGE_IMAGE, XLARGE_IMAGE, LARGE_IMAGE, MEDIUM_IMAGE, SMALL_IMAGE, XSMALL_IMAGE); } diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java index 00d59e0233..3ecb095868 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ParentFolderFilterPanel.java @@ -204,7 +204,6 @@ final class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { if (index >= 0) { parentListModel.remove(index); } -// validateFields(); }//GEN-LAST:event_deleteButtonActionPerformed private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed @@ -212,7 +211,6 @@ final class ParentFolderFilterPanel extends AbstractDiscoveryFilterPanel { ParentSearchTerm searchTerm; searchTerm = new ParentSearchTerm(parentTextField.getText(), fullRadioButton.isSelected(), includeRadioButton.isSelected()); parentListModel.add(parentListModel.size(), searchTerm); -// validateFields(); parentTextField.setText(""); } }//GEN-LAST:event_addButtonActionPerformed diff --git a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java index 021a71d4f4..1e78b9a079 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/SizeFilterPanel.java @@ -34,7 +34,7 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { private static final long serialVersionUID = 1L; /** - * Creates new form SizeFilterPanel= + * Creates new form SizeFilterPanel. * * @param type The type of result being searched for. */ @@ -148,10 +148,10 @@ final class SizeFilterPanel extends AbstractDiscoveryFilterPanel { sizes = FileSize.getOptionsForVideos(); break; case IMAGE: - sizes = FileSize.getOptionsForImages(); + sizes = FileSize.getDefaultSizeOptions(); break; case DOCUMENTS: - sizes = FileSize.getOptionsForImages(); + sizes = FileSize.getDefaultSizeOptions(); break; default: sizes = new ArrayList<>(); From 25e6795dd2e375e51821a5180a7f197be4c21c83 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Wed, 17 Jun 2020 11:05:03 -0400 Subject: [PATCH 44/51] Added Accounts tab to MessageArtifactViewer --- .../autopsy/contentviewers/Bundle.properties | 1 + .../contentviewers/Bundle.properties-MERGED | 21 +- .../contentviewers/MessageAccountPanel.java | 407 ++++++++++++++++++ .../contentviewers/MessageArtifactViewer.form | 24 ++ .../contentviewers/MessageArtifactViewer.java | 26 +- 5 files changed, 474 insertions(+), 5 deletions(-) create mode 100755 Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties index edb4c70bc2..ee162286ef 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties @@ -980,3 +980,4 @@ CallLogArtifactViewer.localAccountPersonaLabel.text=Persona: CallLogArtifactViewer.localAccountPersonaNameLabel.text=jLabel1 CallLogArtifactViewer.localAccountPersonaButton.text=jButton1 ContactArtifactViewer.personasLabel.text=Personas +MessageArtifactViewer.accountsTab.TabConstraints.tabTitle=Accounts diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED index 4383f2c3d1..da4eda2fac 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED @@ -37,11 +37,18 @@ ApplicationContentViewer.title=Application ApplicationContentViewer.toolTip=Displays file contents. CallLogArtifactViewer_number_from=From CallLogArtifactViewer_number_to=To -CallLogArtifactViewer_persona_button_new=New +CallLogArtifactViewer_persona_button_new=Create CallLogArtifactViewer_persona_button_view=View -CallLogArtifactViewer_persona_label=\ Persona: -CallLogArtifactViewer_persona_searching=\ Searching... -CallLogArtifactViewer_persona_text_none=No Persona +CallLogArtifactViewer_persona_label=\ Persona +CallLogArtifactViewer_persona_searching=Searching... +CallLogArtifactViewer_persona_text_none=None Found +ContactArtifactViewer_missing_account_label=Missing Account: +ContactArtifactViewer_persona_account_justification=Account found in Contact artifact +ContactArtifactViewer_persona_button_new=Create +ContactArtifactViewer_persona_button_view=View +ContactArtifactViewer_persona_label=Persona +ContactArtifactViewer_persona_searching=\ Searching... +ContactArtifactViewer_persona_text_none=None found DataContentViewerArtifact.failedToGetAttributes.message=Failed to get some or all attributes from case database DataContentViewerArtifact.failedToGetSourcePath.message=Failed to get source file path from case database DefaultArtifactContentViewer.attrsTableHeader.sources=Source(s) @@ -97,6 +104,10 @@ MediaViewVideoPanel.progressLabel.text=00:00 MediaViewVideoPanel.infoLabel.text=info MediaViewImagePanel.imgFileTooLarge.msg=Could not load image file (too large): {0} +MessageAccountPanel_button_create_label=Create +MessageAccountPanel_button_view_label=View +MessageAccountPanel_persona_label=Persona: +MessageAccountPanel_unknown_label=Unknown MessageArtifactViewer.AttachmentPanel.title=Attachments Metadata.nodeText.none=None Metadata.nodeText.truncated=(results truncated) @@ -1080,3 +1091,5 @@ MessageArtifactViewer.htmlPane.TabConstraints.tabTitle=HTML CallLogArtifactViewer.localAccountPersonaLabel.text=Persona: CallLogArtifactViewer.localAccountPersonaNameLabel.text=jLabel1 CallLogArtifactViewer.localAccountPersonaButton.text=jButton1 +ContactArtifactViewer.personasLabel.text=Personas +MessageArtifactViewer.accountsTab.TabConstraints.tabTitle=Accounts diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java new file mode 100755 index 0000000000..52aadb8af1 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java @@ -0,0 +1,407 @@ +/* + * 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.contentviewers; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import javax.swing.GroupLayout; +import javax.swing.GroupLayout.Alignment; +import javax.swing.GroupLayout.ParallelGroup; +import javax.swing.GroupLayout.SequentialGroup; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.LayoutStyle.ComponentPlacement; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import org.openide.util.Exceptions; +import org.openide.util.NbBundle.Messages; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.centralrepository.datamodel.Persona; +import org.sleuthkit.autopsy.centralrepository.datamodel.PersonaAccount; +import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialog; +import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialogCallback; +import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsMode; +import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsPanel; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.Account; +import org.sleuthkit.datamodel.BlackboardArtifact; +import org.sleuthkit.datamodel.CommunicationsManager; +import org.sleuthkit.datamodel.TskCoreException; + +/** + * Panel for displaying accounts and their persona information. + * + */ +final class MessageAccountPanel extends JPanel { + + private static final long serialVersionUID = 1L; + private final static Logger logger = Logger.getLogger(MessageAccountPanel.class.getName()); + + private AccountFetcher currentFetcher = null; + + /** + * Set the new artifact for the panel. + * + * @param artifact + * + * @throws TskCoreException + */ + void setArtifact(BlackboardArtifact artifact) { + this.removeAll(); + repaint(); + + if (artifact == null) { + return; + } + + if (currentFetcher != null && !currentFetcher.isDone()) { + currentFetcher.cancel(true); + } + + currentFetcher = new AccountFetcher(artifact); + currentFetcher.execute(); + } + + /** + * Swingworker that fetches the accounts for a given artifact + */ + class AccountFetcher extends SwingWorker, Void> { + + private final BlackboardArtifact artifact; + + /** + * Construct a new AccountFetcher. + * + * @param artifact The artifact to get accounts for. + */ + AccountFetcher(BlackboardArtifact artifact) { + this.artifact = artifact; + } + + @Override + protected List doInBackground() throws Exception { + List dataList = new ArrayList<>(); + + CommunicationsManager commManager = Case.getCurrentCase().getSleuthkitCase().getCommunicationsManager(); + List accountList = commManager.getAccountsRelatedToArtifact(artifact); + for (Account account : accountList) { + if (isCancelled()) { + return new ArrayList<>(); + } + + Collection personAccounts = PersonaAccount.getPersonaAccountsForAccount(account); + if (personAccounts != null && !personAccounts.isEmpty()) { + for (PersonaAccount personaAccount : PersonaAccount.getPersonaAccountsForAccount(account)) { + dataList.add(new AccountContainer(account, personaAccount)); + } + } else { + dataList.add(new AccountContainer(account, null)); + } + } + + return dataList; + } + + @Override + protected void done() { + try { + List dataList = get(); + + dataList.forEach(container -> { + container.initalizeSwingControls(); + }); + + GroupLayout layout = new GroupLayout(MessageAccountPanel.this); + layout.setHorizontalGroup( + layout.createParallelGroup(Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(getMainHorizontalGroup(layout, dataList)) + .addContainerGap(158, Short.MAX_VALUE))); + + layout.setVerticalGroup(getMainVerticalGroup(layout, dataList)); + setLayout(layout); + repaint(); + } catch (CancellationException e) { + + } catch (InterruptedException | ExecutionException ex) { + Exceptions.printStackTrace(ex); + } + } + + /** + * Create the main horizontal ParalleGroup the encompasses all of the + * controls. + * + * @return A ParallelGroup object + */ + private ParallelGroup getMainHorizontalGroup(GroupLayout layout, List data) { + ParallelGroup group = layout.createParallelGroup(Alignment.LEADING); + for (AccountContainer o : data) { + group.addComponent(o.getAccountLabel()); + } + group.addGroup(getPersonaHorizontalGroup(layout, data)); + return group; + } + + /** + * Creates the main Vertical Group for the account controls. + * + * @return The vertical group object + */ + private ParallelGroup getMainVerticalGroup(GroupLayout layout, List data) { + SequentialGroup group = layout.createSequentialGroup(); + for (AccountContainer o : data) { + group.addGap(5) + .addComponent(o.getAccountLabel()) + .addGroup(o.getPersonLineVerticalGroup(layout)); + } + + group.addContainerGap(83, Short.MAX_VALUE); + + return layout.createParallelGroup().addGroup(group); + + } + + /** + * To line up the Persona buttons they need to be in their own + * ParalletGroup. + * + * @return + */ + private ParallelGroup getButtonGroup(GroupLayout layout, List data) { + ParallelGroup group = layout.createParallelGroup(Alignment.LEADING); + for (AccountContainer o : data) { + group.addComponent(o.getButton()); + } + + return group; + } + + /** + * Creates the group with just the persona header and the person value. + * + * @return + */ + private SequentialGroup getPersonaHorizontalGroup(GroupLayout layout, List data) { + SequentialGroup group = layout.createSequentialGroup(); + ParallelGroup pgroup = layout.createParallelGroup(Alignment.LEADING); + group.addGap(10); + for (AccountContainer o : data) { + pgroup.addGroup(o.getPersonaSequentialGroup(layout)); + } + group.addGap(10) + .addGroup(pgroup) + .addPreferredGap(ComponentPlacement.RELATED) + .addGroup(getButtonGroup(layout, data)); + + return group; + } + + } + + /** + * Container for each account entry in the panel. This class holds both the + * account objects and the ui components. + */ + private class AccountContainer { + + private final Account account; + private Persona persona = null; + + private JLabel accountLabel; + private JLabel personaHeader; + private JLabel personaDisplayName; + private JButton button; + + /** + * Construct a new AccountContainer + * + * @param account + * @param personaAccount + */ + AccountContainer(Account account, PersonaAccount personaAccount) { + this.account = account; + this.persona = personaAccount != null ? personaAccount.getPersona() : null; + } + + @Messages({ + "MessageAccountPanel_persona_label=Persona:", + "MessageAccountPanel_unknown_label=Unknown", + "MessageAccountPanel_button_view_label=View", + "MessageAccountPanel_button_create_label=Create" + }) + /** + * Swing components will not be initialized until this method is called. + */ + private void initalizeSwingControls() { + accountLabel = new JLabel(); + personaHeader = new JLabel(Bundle.MessageAccountPanel_persona_label()); + personaDisplayName = new JLabel(); + button = new JButton(); + button.addActionListener(new PersonaButtonListener(this)); + + accountLabel.setText(account.getTypeSpecificID()); + + personaDisplayName.setText(persona != null ? persona.getName() : Bundle.MessageAccountPanel_unknown_label()); + button.setText(persona != null ? Bundle.MessageAccountPanel_button_view_label() : Bundle.MessageAccountPanel_button_create_label()); + } + + /** + * Sets a new persona for this object and update the controls. + * + * @param persona + */ + private void setPersona(Persona persona) { + this.persona = persona; + + // Make sure this runs in EDT + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + personaDisplayName.setText(persona != null ? persona.getName() : Bundle.MessageAccountPanel_unknown_label()); + button.setText(persona != null ? Bundle.MessageAccountPanel_button_view_label() : Bundle.MessageAccountPanel_button_create_label()); + revalidate(); + repaint(); + } + }); + } + + /** + * Return the account object for this container. + * + * @return Account object. + */ + private Account getAccount() { + return account; + } + + /** + * Returns the PersonaAccount object for this container. Maybe null; + * + * @return PersonaAccount object or null if one was not set. + */ + private Persona getPersona() { + return persona; + } + + /** + * Returns the JLabel for that contains the Account type specific id. + * + * @return JLabel object + */ + private JLabel getAccountLabel() { + return accountLabel; + } + + /** + * Returns the Persona Buttons for this container. + * + * @return The persona button. + */ + private JButton getButton() { + return button; + } + + /** + * Generates the horizontal layout code for the person line. + * + * @param layout Instance of GroupLayout to update. + * + * @return A group for the personal controls. + */ + private SequentialGroup getPersonaSequentialGroup(GroupLayout layout) { + SequentialGroup group = layout.createSequentialGroup(); + + group + .addComponent(personaHeader) + .addPreferredGap(ComponentPlacement.RELATED) + .addComponent(personaDisplayName); + + return group; + } + + /** + * Generates the vertical layout code for the persona line. + * + * @param layout Instance of GroupLayout to update. + * + * @return A group for the personal controls. + */ + private ParallelGroup getPersonLineVerticalGroup(GroupLayout layout) { + return layout.createParallelGroup(Alignment.BASELINE) + .addComponent(personaHeader) + .addComponent(personaDisplayName) + .addComponent(button); + } + } + + /** + * ActionListner for the persona buttons. + */ + private class PersonaButtonListener implements ActionListener { + + private final AccountContainer accountContainer; + + /** + * Constructs the listener. + * + * @param accountContainer The account that does with list Listner. + */ + PersonaButtonListener(AccountContainer accountContainer) { + this.accountContainer = accountContainer; + } + + @Override + public void actionPerformed(ActionEvent e) { + Persona persona = accountContainer.getPersona(); + if (persona == null) { + PersonaDetailsDialog createPersonaDialog = new PersonaDetailsDialog( + MessageAccountPanel.this, + PersonaDetailsMode.CREATE, + null, + new PersonaDialogCallbackImpl(accountContainer), + false); + + // Pre populate the persona name and accounts if we have them. + PersonaDetailsPanel personaPanel = createPersonaDialog.getDetailsPanel(); + + personaPanel.setPersonaName(accountContainer.getAccount().getTypeSpecificID()); + + // display the dialog now + createPersonaDialog.display(); + } else { + new PersonaDetailsDialog(MessageAccountPanel.this, + PersonaDetailsMode.VIEW, persona, new PersonaDialogCallbackImpl(accountContainer)); + } + } + + } + + /** + * Call back for use by the PersonaDetailsDialog. + */ + private class PersonaDialogCallbackImpl implements PersonaDetailsDialogCallback { + + private final AccountContainer accountContainer; + + PersonaDialogCallbackImpl(AccountContainer accountContainer) { + this.accountContainer = accountContainer; + } + + @Override + public void callback(Persona persona) { + accountContainer.setPersona(persona); + } + + } +} diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.form b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.form index b529e85146..f1a6ce5d4d 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.form +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.form @@ -320,6 +320,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.java index 6b86505b25..949e5ea123 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.java @@ -38,8 +38,10 @@ import org.openide.explorer.ExplorerManager; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Node; +import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.lookup.ServiceProvider; +import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; import org.sleuthkit.autopsy.contentviewers.TranslatablePanel.TranslatablePanelException; import org.sleuthkit.autopsy.corecomponents.AutoWrappingJTextPane; import org.sleuthkit.autopsy.corecomponents.DataResultPanel; @@ -125,6 +127,7 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac private static final int HTML_TAB_INDEX = 2; private static final int RTF_TAB_INDEX = 3; private static final int ATTM_TAB_INDEX = 4; + private static final int ACCT_TAB_INDEX = 5; private final List textAreas; private final org.sleuthkit.autopsy.contentviewers.HtmlPanel htmlPanel = new org.sleuthkit.autopsy.contentviewers.HtmlPanel(); @@ -135,6 +138,13 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac private BlackboardArtifact artifact; private final DataResultPanel drp; private ExplorerManager drpExplorerManager; + + private MessageAccountPanel accountsPanel; + + public MessageArtifactViewer(List textAreas, DataResultPanel drp) { + this.textAreas = textAreas; + this.drp = drp; + } /** * Creates new MessageContentViewer @@ -142,6 +152,8 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac @NbBundle.Messages("MessageArtifactViewer.AttachmentPanel.title=Attachments") public MessageArtifactViewer() { initComponents(); + accountsPanel = new MessageAccountPanel(); + htmlPane.add(htmlPanel); envelopePanel.setBackground(new Color(0, 0, 0, 38)); drp = DataResultPanel.createInstanceUninitialized(Bundle.MessageArtifactViewer_AttachmentPanel_title(), "", new TableFilterNode(Node.EMPTY, false), 0, null); @@ -154,6 +166,7 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac TEXT_TAB_INDEX); msgbodyTabbedPane.setEnabledAt(ATTM_TAB_INDEX, true); + accountScrollPane.setViewportView(accountsPanel); /* * HTML tab uses the HtmlPanel instead of an internal text pane, so we @@ -205,6 +218,8 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac attachmentsPanel = new javax.swing.JPanel(); viewInNewWindowButton = new javax.swing.JButton(); attachmentsScrollPane = new javax.swing.JScrollPane(); + accountsTab = new javax.swing.JPanel(); + accountScrollPane = new javax.swing.JScrollPane(); envelopePanel.setBackground(new java.awt.Color(204, 204, 204)); @@ -342,6 +357,11 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac msgbodyTabbedPane.addTab(org.openide.util.NbBundle.getMessage(MessageArtifactViewer.class, "MessageArtifactViewer.attachmentsPanel.TabConstraints.tabTitle"), attachmentsPanel); // NOI18N + accountsTab.setLayout(new java.awt.BorderLayout()); + accountsTab.add(accountScrollPane, java.awt.BorderLayout.CENTER); + + msgbodyTabbedPane.addTab(org.openide.util.NbBundle.getMessage(MessageArtifactViewer.class, "MessageArtifactViewer.accountsTab.TabConstraints.tabTitle"), accountsTab); // NOI18N + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -370,6 +390,8 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JScrollPane accountScrollPane; + private javax.swing.JPanel accountsTab; private javax.swing.JPanel attachmentsPanel; private javax.swing.JScrollPane attachmentsScrollPane; private javax.swing.JLabel ccLabel; @@ -421,6 +443,8 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac } else { resetComponent(); } + + accountsPanel.setArtifact(artifact); } /** @@ -655,7 +679,7 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac return doc.html(); } - + /** * Creates child nodes for message attachments. */ From 73e202905f7b7e3522bca7d4768a00aa5e1b2da0 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Wed, 17 Jun 2020 11:37:07 -0400 Subject: [PATCH 45/51] Fixed codacy issues --- .../autopsy/contentviewers/Bundle.properties-MERGED | 2 +- .../autopsy/contentviewers/MessageAccountPanel.java | 7 ++++--- .../autopsy/contentviewers/MessageArtifactViewer.java | 8 ++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED index 65796a961e..0aa57ce92b 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED @@ -1096,4 +1096,4 @@ CallLogArtifactViewer.localAccountPersonaNameLabel.text=jLabel1 CallLogArtifactViewer.localAccountPersonaButton.text=jButton1 ContactArtifactViewer.personasLabel.text=Personas MessageArtifactViewer.accountsTab.TabConstraints.tabTitle=Accounts -ContactArtifactViewer.contactImage.text= \ No newline at end of file +ContactArtifactViewer.contactImage.text= diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java index 52aadb8af1..8035a59d4e 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java @@ -12,6 +12,7 @@ import java.util.Collection; import java.util.List; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; +import java.util.logging.Level; import javax.swing.GroupLayout; import javax.swing.GroupLayout.Alignment; import javax.swing.GroupLayout.ParallelGroup; @@ -131,10 +132,10 @@ final class MessageAccountPanel extends JPanel { layout.setVerticalGroup(getMainVerticalGroup(layout, dataList)); setLayout(layout); repaint(); - } catch (CancellationException e) { - + } catch (CancellationException ex) { + logger.log(Level.INFO, "MessageAccoutPanel thread cancelled", ex); } catch (InterruptedException | ExecutionException ex) { - Exceptions.printStackTrace(ex); + logger.log(Level.WARNING, "Failed to get account list for MessageAccountPanel", ex); } } diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.java index 949e5ea123..33a2518747 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageArtifactViewer.java @@ -38,7 +38,6 @@ import org.openide.explorer.ExplorerManager; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Node; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.openide.util.lookup.ServiceProvider; import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository; @@ -166,7 +165,9 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac TEXT_TAB_INDEX); msgbodyTabbedPane.setEnabledAt(ATTM_TAB_INDEX, true); + accountScrollPane.setViewportView(accountsPanel); + msgbodyTabbedPane.setEnabledAt(ACCT_TAB_INDEX, CentralRepository.isEnabled()); /* * HTML tab uses the HtmlPanel instead of an internal text pane, so we @@ -444,7 +445,10 @@ public class MessageArtifactViewer extends javax.swing.JPanel implements Artifac resetComponent(); } - accountsPanel.setArtifact(artifact); + msgbodyTabbedPane.setEnabledAt(ACCT_TAB_INDEX, CentralRepository.isEnabled()); + if(CentralRepository.isEnabled()) { + accountsPanel.setArtifact(artifact); + } } /** From aea5e12505dcb3a33fe23bcba9bc7bf567048534 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 17 Jun 2020 12:56:31 -0400 Subject: [PATCH 46/51] 6305 fix wait cursor --- .../autopsy/discovery/ResultsPanel.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 23e457a300..728da20621 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -152,7 +152,6 @@ final class ResultsPanel extends javax.swing.JPanel { @Subscribe void handlePageRetrievedEvent(DiscoveryEventUtils.PageRetrievedEvent pageRetrievedEvent) { SwingUtilities.invokeLater(() -> { - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); //send populateMesage DiscoveryEventUtils.getDiscoveryEventBus().post(new DiscoveryEventUtils.PopulateInstancesListEvent(getInstancesForSelected())); @@ -277,7 +276,6 @@ final class ResultsPanel extends javax.swing.JPanel { @Subscribe void handleNoResultsEvent(DiscoveryEventUtils.NoResultsEvent noResultsEvent) { SwingUtilities.invokeLater(() -> { - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); groupSize = 0; currentPage = 0; updateControls(); @@ -289,6 +287,18 @@ final class ResultsPanel extends javax.swing.JPanel { }); } + /** + * Subscribe to and update cursor in response to SearchCompleteEvents. + * + * @param searchCompleteEvent The SearchCompleteEvent which was received. + */ + @Subscribe + void handleSearchCompleteEvent(DiscoveryEventUtils.SearchCompleteEvent searchCompleteEvent) { + SwingUtilities.invokeLater(() -> { + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }); + } + /** * Set the page number and retrieve its contents. * @@ -296,7 +306,8 @@ final class ResultsPanel extends javax.swing.JPanel { * in this page. */ @Subscribe - private synchronized void setPage(int startingEntry) { + private synchronized void setPage(int startingEntry + ) { int pageSize = pageSizeComboBox.getItemAt(pageSizeComboBox.getSelectedIndex()); synchronized (this) { if (pageWorker != null && !pageWorker.isDone()) { From 16ef4b3b3e3136f8fa634f9ea37910df073b9053 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 17 Jun 2020 13:56:10 -0400 Subject: [PATCH 47/51] 6305 don't setpage when group is empty after page size change --- Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 728da20621..19c05d9f3c 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -322,8 +322,10 @@ final class ResultsPanel extends javax.swing.JPanel { logger.log(Level.SEVERE, "Error loading central repository database, no central repository options will be available for Discovery", ex); } } - pageWorker = new PageWorker(searchFilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupKey, startingEntry, pageSize, resultType, centralRepo); - pageWorker.execute(); + if (groupSize != 0) { + pageWorker = new PageWorker(searchFilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupKey, startingEntry, pageSize, resultType, centralRepo); + pageWorker.execute(); + } } } From d8fe3109a93f6e413536f3f02df54a53548fb8c3 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Wed, 17 Jun 2020 13:59:26 -0400 Subject: [PATCH 48/51] 6305 re-enable page size combo box when no results --- Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java index 19c05d9f3c..7082b0d835 100644 --- a/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/discovery/ResultsPanel.java @@ -325,6 +325,10 @@ final class ResultsPanel extends javax.swing.JPanel { if (groupSize != 0) { pageWorker = new PageWorker(searchFilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupKey, startingEntry, pageSize, resultType, centralRepo); pageWorker.execute(); + } else { + SwingUtilities.invokeLater(() -> { + pageSizeComboBox.setEnabled(true); + }); } } } From 912c5ecb501d5cf429db9a296cdb1fa547febbe3 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Wed, 17 Jun 2020 14:39:24 -0400 Subject: [PATCH 49/51] Added header to MessageAccountPanel --- .../contentviewers/MessageAccountPanel.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java index 8035a59d4e..69b6b0ab15 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java @@ -1,8 +1,22 @@ /* - * 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 2020 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.contentviewers; import java.awt.event.ActionEvent; @@ -23,7 +37,6 @@ import javax.swing.JPanel; import javax.swing.LayoutStyle.ComponentPlacement; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; -import org.openide.util.Exceptions; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.centralrepository.datamodel.Persona; From 9ef26fd1e883d7b107dafd3ba3b6247f15ef4450 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Wed, 17 Jun 2020 15:48:52 -0400 Subject: [PATCH 50/51] Fixed repaint issue --- .../sleuthkit/autopsy/contentviewers/MessageAccountPanel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java index 69b6b0ab15..027fe2f7bc 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageAccountPanel.java @@ -70,7 +70,8 @@ final class MessageAccountPanel extends JPanel { * @throws TskCoreException */ void setArtifact(BlackboardArtifact artifact) { - this.removeAll(); + removeAll(); + setLayout(null); repaint(); if (artifact == null) { From 7c7cf7594c047989699253409f1c2e2c2d8b46b5 Mon Sep 17 00:00:00 2001 From: Raman Arora Date: Wed, 17 Jun 2020 15:49:35 -0400 Subject: [PATCH 51/51] Addressed review comments. --- .../autopsy/contentviewers/CallLogArtifactViewer.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/CallLogArtifactViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/CallLogArtifactViewer.java index 737da734cd..99b662f52a 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/CallLogArtifactViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/CallLogArtifactViewer.java @@ -70,7 +70,7 @@ public class CallLogArtifactViewer extends javax.swing.JPanel implements Artifac private final List personaSearchtasks = new ArrayList<>(); /** - * Creates new form CallLogArtifactViewerNew + * Creates new form CallLogArtifactViewer. */ public CallLogArtifactViewer() { initComponents(); @@ -402,13 +402,12 @@ public class CallLogArtifactViewer extends javax.swing.JPanel implements Artifac * * @return Account string to display. */ - @NbBundle.Messages({ - "CallLogArtifactViewer_suffix_local=(Local)", - }) + @NbBundle.Messages({ + "CallLogArtifactViewer_suffix_local=(Local)",}) private String getAccountDisplayString(String accountIdentifier, CallLogViewData callLogViewDataNew) { String accountDisplayValue = accountIdentifier; if (callLogViewDataNew.getLocalAccountId() != null && callLogViewDataNew.getLocalAccountId().equalsIgnoreCase(accountIdentifier)) { - accountDisplayValue += " " + Bundle.CallLogArtifactViewer_suffix_local() ; + accountDisplayValue += " " + Bundle.CallLogArtifactViewer_suffix_local(); } return accountDisplayValue; }