diff --git a/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties b/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties index 652aad9e92..47f47b8724 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties @@ -15,18 +15,16 @@ FileSearchDialog.orderAttrRadioButton.text=Attribute FileSearchDialog.orderSizeRadioButton.text=Group Size FileSearchDialog.jLabel5.text=Order files by: FileSearchDialog.parentCheckBox.text=Parent -FileSearchPanel.sortingPanel.border.title=Sorting +FileSearchPanel.sortingPanel.border.title=Grouping FileSearchPanel.searchButton.text=Show FileSearchPanel.addButton.text=Add FileSearchPanel.substringRadioButton.text=Substring FileSearchPanel.fullRadioButton.text=Full -FileSearchPanel.parentCheckbox.text=Parent: +FileSearchPanel.parentCheckbox.text=Parent Folder: FileSearchPanel.keywordCheckbox.text=Keyword: FileSearchPanel.crFrequencyCheckbox.text=Past Occurrences: FileSearchPanel.dataSourceCheckbox.text=Data Source: -FileSearchPanel.groupSizeRadioButton.text=Group Size FileSearchPanel.sizeCheckbox.text=File Size: -FileSearchPanel.attributeRadioButton.text=Group Name FileSearchPanel.orderGroupsByLabel.text=Order Groups By: FileSearchPanel.filtersScrollPane.border.title=Filters FileSearchPanel.parentLabel.text=(All will be used) @@ -43,16 +41,16 @@ 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=Tags: -FileSearchPanel.interestingItemsCheckbox.text=Interesting Items: +FileSearchPanel.tagsCheckbox.text=Tag: +FileSearchPanel.interestingItemsCheckbox.text=Interesting Item: FileSearchPanel.scoreCheckbox.text=Has Score: FileSearchPanel.exifCheckbox.text=Must contain EXIF data FileSearchPanel.notableCheckbox.text=Must have been tagged as notable -FileSearchPanel.objectsCheckbox.text=Objects: +FileSearchPanel.objectsCheckbox.text=Object Detected: ResultsPanel.currentPageLabel.text=Page: - ResultsPanel.pageControlsLabel.text=Pages: ResultsPanel.gotoPageLabel.text=Go to Page: -ResultsPanel.pageSizeLabel.text=Page size: +ResultsPanel.pageSizeLabel.text=Page Size: ResultsPanel.instancesList.border.title=Instances DiscoveryExtractAction.title.extractFiles.text=Extract File FileSearchPanel.includeRadioButton.text=Include diff --git a/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED index fadcdb1c6a..ddaea59c02 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/filequery/Bundle.properties-MERGED @@ -1,5 +1,7 @@ CTL_OpenFileDiscoveryAction=File discovery DiscoveryTopComponent.name=\ File Discovery +FileGroup.groupSortingAlgorithm.groupName.text=Group name +FileGroup.groupSortingAlgorithm.groupSize.text=Group size # {0} - Data source name # {1} - Data source ID FileSearch.DataSourceGroupKey.datasourceAndID={0}(ID: {1}) @@ -112,7 +114,7 @@ FileSearchFiltering.SizeFilter.range=({0} to {1}) FileSearchFiltering.TagsFilter.desc=Files that have been tagged {0} FileSearchFiltering.TagsFilter.or=\ or FileSearchPanel.dialogTitle.text=Test file search -FileSearchPanel.sortingPanel.border.title=Sorting +FileSearchPanel.sortingPanel.border.title=Grouping FileSearchPanel.searchButton.text=Show FileSearchPanel.addButton.text=Add FileSearchPanel.substringRadioButton.text=Substring @@ -121,9 +123,7 @@ FileSearchPanel.parentCheckbox.text=Parent: FileSearchPanel.keywordCheckbox.text=Keyword: FileSearchPanel.crFrequencyCheckbox.text=Past Occurrences: FileSearchPanel.dataSourceCheckbox.text=Data Source: -FileSearchPanel.groupSizeRadioButton.text=Group Size FileSearchPanel.sizeCheckbox.text=File Size: -FileSearchPanel.attributeRadioButton.text=Group Name FileSearchPanel.orderGroupsByLabel.text=Order Groups By: FileSearchPanel.filtersScrollPane.border.title=Filters FileSearchPanel.parentLabel.text=(All will be used) @@ -173,7 +173,7 @@ ResultsPanel.invalidPageNumber.title=Invalid Page Number ResultsPanel.openInExternalViewer.name=Open in External Viewer ResultsPanel.pageControlsLabel.text=Pages: ResultsPanel.gotoPageLabel.text=Go to Page: -ResultsPanel.pageSizeLabel.text=Page size: +ResultsPanel.pageSizeLabel.text=Page Size: ResultsPanel.instancesList.border.title=Instances DiscoveryExtractAction.title.extractFiles.text=Extract File FileSearchPanel.includeRadioButton.text=Include diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileGroup.java b/Core/src/org/sleuthkit/autopsy/filequery/FileGroup.java index c80dcc35c7..3c69c4c8f3 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileGroup.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/FileGroup.java @@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.filequery; 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; /** @@ -100,7 +101,7 @@ class FileGroup implements Comparable { switch (groupSortingType) { case BY_GROUP_SIZE: return compareGroupsBySize(this, otherGroup); - case BY_GROUP_KEY: + case BY_GROUP_NAME: default: return compareGroupsByGroupKey(this, otherGroup); } @@ -131,7 +132,7 @@ class FileGroup implements Comparable { if (group1.getFiles().size() != group2.getFiles().size()) { return -1 * Long.compare(group1.getFiles().size(), group2.getFiles().size()); // High to low } else { - // If the groups have the same size, fall through to the BY_GROUP_KEY sorting + // If the groups have the same size, fall through to the BY_GROUP_NAME sorting return compareGroupsByGroupKey(group1, group2); } } @@ -139,9 +140,28 @@ class FileGroup implements Comparable { /** * Enum to specify how to sort the group. */ + @Messages({"FileGroup.groupSortingAlgorithm.groupSize.text=Group Size", + "FileGroup.groupSortingAlgorithm.groupName.text=Group Name"}) enum GroupSortingAlgorithm { - BY_GROUP_SIZE, // Sort from largest to smallest group - BY_GROUP_KEY // Sort using the group key (for example, if grouping by size sort from largest to smallest value) + BY_GROUP_NAME(Bundle.FileGroup_groupSortingAlgorithm_groupName_text()), // Sort using the group key (for example, if grouping by size sort from largest to smallest value) + BY_GROUP_SIZE(Bundle.FileGroup_groupSortingAlgorithm_groupSize_text()); // Sort from largest to smallest group + + private final String displayName; + + /** + * Construct a GroupSortingAlgorithm enum value. + * + * @param name The name to display to the user for the enum value. + */ + GroupSortingAlgorithm(String name) { + displayName = name; + } + + @Override + public String toString() { + return displayName; + } + } /** diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearch.java b/Core/src/org/sleuthkit/autopsy/filequery/FileSearch.java index c90fb8f2f4..350892d9e7 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearch.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/FileSearch.java @@ -1806,16 +1806,16 @@ class FileSearch { * Enum for the attribute types that can be used for grouping. */ @NbBundle.Messages({ - "FileSearch.GroupingAttributeType.fileType.displayName=File type", - "FileSearch.GroupingAttributeType.frequency.displayName=Past occurrences", - "FileSearch.GroupingAttributeType.keywordList.displayName=Keyword list names", + "FileSearch.GroupingAttributeType.fileType.displayName=File Type", + "FileSearch.GroupingAttributeType.frequency.displayName=Past Occurrences", + "FileSearch.GroupingAttributeType.keywordList.displayName=Keyword", "FileSearch.GroupingAttributeType.size.displayName=File Size", - "FileSearch.GroupingAttributeType.datasource.displayName=Data source", - "FileSearch.GroupingAttributeType.parent.displayName=Parent folder", - "FileSearch.GroupingAttributeType.hash.displayName=Hash set", - "FileSearch.GroupingAttributeType.interestingItem.displayName=Interesting item set", - "FileSearch.GroupingAttributeType.tag.displayName=File tag", - "FileSearch.GroupingAttributeType.object.displayName=Object detected", + "FileSearch.GroupingAttributeType.datasource.displayName=Data Source", + "FileSearch.GroupingAttributeType.parent.displayName=Parent Folder", + "FileSearch.GroupingAttributeType.hash.displayName=Hash Set", + "FileSearch.GroupingAttributeType.interestingItem.displayName=Interesting Item", + "FileSearch.GroupingAttributeType.tag.displayName=Tag", + "FileSearch.GroupingAttributeType.object.displayName=Object Detected", "FileSearch.GroupingAttributeType.none.displayName=None"}) enum GroupingAttributeType { FILE_SIZE(new FileSizeAttribute(), Bundle.FileSearch_GroupingAttributeType_size_displayName()), diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.form b/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.form index 43da439068..5ce168a55a 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.form +++ b/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.form @@ -8,8 +8,6 @@ - - @@ -67,7 +65,7 @@ - + @@ -712,7 +710,7 @@ - + @@ -725,32 +723,24 @@ - - - + + + + - + - - - - - - - + + - - - - - - - - - + + + + + + - @@ -760,17 +750,16 @@ - + - - - - - + + + + @@ -809,27 +798,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -844,6 +812,11 @@ + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.java index af88a5c8d1..40aeb1faa1 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/FileSearchPanel.java @@ -39,6 +39,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException; 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; @@ -58,7 +59,7 @@ import org.sleuthkit.datamodel.TagName; 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"}; + 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; @@ -70,6 +71,9 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener @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)); @@ -79,15 +83,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener /** * 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 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. + * selected, null to indicate leaving selected items + * unchanged. */ private void dataSourceFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { dataSourceCheckbox.setVisible(visible); @@ -110,15 +114,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener /** * 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 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. + * selected, null to indicate leaving selected items + * unchanged. */ private void sizeFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { sizeCheckbox.setVisible(visible); @@ -141,15 +145,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener /** * 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 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. + * selected, null to indicate leaving selected items + * unchanged. */ private void crFrequencyFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { crFrequencyCheckbox.setVisible(visible); @@ -172,15 +176,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener /** * 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 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. + * selected, null to indicate leaving selected items + * unchanged. */ private void objectsFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { objectsCheckbox.setVisible(visible); @@ -203,15 +207,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener /** * 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 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. + * selected, null to indicate leaving selected items + * unchanged. */ private void hashSetFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { hashSetCheckbox.setVisible(visible); @@ -234,15 +238,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener /** * 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 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. + * selected, null to indicate leaving selected items + * unchanged. */ private void interestingItemsFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { interestingItemsCheckbox.setVisible(visible); @@ -265,15 +269,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener /** * 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 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. + * selected, null to indicate leaving selected items + * unchanged. */ private void scoreFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { scoreCheckbox.setVisible(visible); @@ -296,15 +300,15 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener /** * 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 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. + * selected, null to indicate leaving selected items + * unchanged. */ private void parentFilterSettings(boolean visible, boolean enabled, boolean selected, int[] indicesSelected) { parentCheckbox.setVisible(visible); @@ -519,10 +523,10 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener validateFields(); } - FileType getSelectedType(){ + FileType getSelectedType() { return fileType; } - + /** * Reset the panel to its initial configuration. */ @@ -556,6 +560,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener orderByCombobox.addItem(method); } } + + groupSortingComboBox.setSelectedIndex(0); setSelectedType(FileType.IMAGE); validateFields(); } @@ -921,8 +927,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener * @return the grouping attribute */ FileSearch.AttributeType getGroupingAttribute() { - FileSearch.GroupingAttributeType groupingAttrType = (FileSearch.GroupingAttributeType) groupByCombobox.getSelectedItem(); - return groupingAttrType.getAttributeType(); + return groupByCombobox.getItemAt(groupByCombobox.getSelectedIndex()).getAttributeType(); } /** @@ -931,10 +936,8 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener * @return the selected sorting method */ FileGroup.GroupSortingAlgorithm getGroupSortingMethod() { - if (attributeRadioButton.isSelected()) { - return FileGroup.GroupSortingAlgorithm.BY_GROUP_KEY; - } - return FileGroup.GroupSortingAlgorithm.BY_GROUP_SIZE; + return groupSortingComboBox.getItemAt(groupSortingComboBox.getSelectedIndex()); + } /** @@ -1064,7 +1067,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener java.awt.GridBagConstraints gridBagConstraints; javax.swing.ButtonGroup parentPathButtonGroup = new javax.swing.ButtonGroup(); - orderGroupsByButtonGroup = new javax.swing.ButtonGroup(); javax.swing.ButtonGroup parentIncludeButtonGroup = new javax.swing.ButtonGroup(); filtersScrollPane = new javax.swing.JScrollPane(); filtersPanel = new javax.swing.JPanel(); @@ -1114,10 +1116,9 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener groupByCombobox = new javax.swing.JComboBox<>(); orderByCombobox = new javax.swing.JComboBox<>(); orderGroupsByLabel = new javax.swing.JLabel(); - attributeRadioButton = new javax.swing.JRadioButton(); - groupSizeRadioButton = new javax.swing.JRadioButton(); orderByLabel = new javax.swing.JLabel(); groupByLabel = new javax.swing.JLabel(); + groupSortingComboBox = new javax.swing.JComboBox<>(); errorLabel = new javax.swing.JLabel(); cancelButton = new javax.swing.JButton(); @@ -1561,13 +1562,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener org.openide.awt.Mnemonics.setLocalizedText(orderGroupsByLabel, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.orderGroupsByLabel.text")); // NOI18N - orderGroupsByButtonGroup.add(attributeRadioButton); - attributeRadioButton.setSelected(true); - org.openide.awt.Mnemonics.setLocalizedText(attributeRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.attributeRadioButton.text")); // NOI18N - - orderGroupsByButtonGroup.add(groupSizeRadioButton); - org.openide.awt.Mnemonics.setLocalizedText(groupSizeRadioButton, org.openide.util.NbBundle.getMessage(FileSearchPanel.class, "FileSearchPanel.groupSizeRadioButton.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 @@ -1579,44 +1573,36 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener .addGroup(sortingPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sortingPanelLayout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) + .addGroup(sortingPanelLayout.createSequentialGroup() + .addComponent(groupByLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(groupByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(sortingPanelLayout.createSequentialGroup() .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(sortingPanelLayout.createSequentialGroup() - .addGap(37, 37, 37) - .addComponent(attributeRadioButton)) - .addComponent(groupByLabel) - .addGroup(sortingPanelLayout.createSequentialGroup() - .addGap(17, 17, 17) - .addComponent(orderGroupsByLabel)) - .addGroup(sortingPanelLayout.createSequentialGroup() - .addGap(37, 37, 37) - .addComponent(groupSizeRadioButton)) - .addGroup(sortingPanelLayout.createSequentialGroup() - .addComponent(orderByLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(orderByCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(0, 0, Short.MAX_VALUE))) + .addComponent(orderGroupsByLabel) + .addGap(0, 0, Short.MAX_VALUE)) + .addComponent(orderByLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(groupSortingComboBox, javax.swing.GroupLayout.Alignment.TRAILING, 0, 253, Short.MAX_VALUE) + .addComponent(orderByCombobox, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap()) ); - sortingPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {groupByCombobox, orderByCombobox}); + sortingPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {groupByCombobox, groupSortingComboBox, orderByCombobox}); sortingPanelLayout.setVerticalGroup( sortingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(sortingPanelLayout.createSequentialGroup() - .addGap(8, 8, 8) + .addGap(20, 20, 20) .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) - .addComponent(orderGroupsByLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(attributeRadioButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(groupSizeRadioButton) + .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) @@ -1662,7 +1648,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(6, 6, 6) - .addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 331, Short.MAX_VALUE) + .addComponent(filtersScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE) .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) @@ -1722,8 +1708,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener cancelButton.setEnabled(!enabled); orderByCombobox.setEnabled(enabled); groupByCombobox.setEnabled(enabled); - attributeRadioButton.setEnabled(enabled); - groupSizeRadioButton.setEnabled(enabled); + groupSortingComboBox.setEnabled(enabled); } /** @@ -1832,7 +1817,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.JRadioButton attributeRadioButton; private javax.swing.JButton cancelButton; private javax.swing.JCheckBox crFrequencyCheckbox; private javax.swing.JList crFrequencyList; @@ -1849,7 +1833,7 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener private javax.swing.JRadioButton fullRadioButton; private javax.swing.JComboBox groupByCombobox; private javax.swing.JLabel groupByLabel; - private javax.swing.JRadioButton groupSizeRadioButton; + private javax.swing.JComboBox groupSortingComboBox; private javax.swing.JCheckBox hashSetCheckbox; private javax.swing.JList hashSetList; private javax.swing.JScrollPane hashSetScrollPane; @@ -1867,7 +1851,6 @@ final class FileSearchPanel extends javax.swing.JPanel implements ActionListener private javax.swing.JScrollPane objectsScrollPane; private javax.swing.JComboBox orderByCombobox; private javax.swing.JLabel orderByLabel; - private javax.swing.ButtonGroup orderGroupsByButtonGroup; private javax.swing.JLabel orderGroupsByLabel; private javax.swing.JCheckBox parentCheckbox; private javax.swing.JLabel parentLabel; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/FileSorter.java b/Core/src/org/sleuthkit/autopsy/filequery/FileSorter.java index 7556846c72..6d73c20b01 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/FileSorter.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/FileSorter.java @@ -240,13 +240,13 @@ class FileSorter implements Comparator { * Enum for selecting the primary method for sorting result files. */ @NbBundle.Messages({ - "FileSorter.SortingMethod.datasource.displayName=Data source", - "FileSorter.SortingMethod.filename.displayName=File name", - "FileSorter.SortingMethod.filesize.displayName=File size", - "FileSorter.SortingMethod.filetype.displayName=File type", - "FileSorter.SortingMethod.frequency.displayName=Central repo frequency", - "FileSorter.SortingMethod.keywordlist.displayName=Keyword list names", - "FileSorter.SortingMethod.fullPath.displayName=Full path"}) + "FileSorter.SortingMethod.datasource.displayName=Data Source", + "FileSorter.SortingMethod.filename.displayName=File Name", + "FileSorter.SortingMethod.filesize.displayName=File Size", + "FileSorter.SortingMethod.filetype.displayName=File Type", + "FileSorter.SortingMethod.frequency.displayName=Central Repo Frequency", + "FileSorter.SortingMethod.keywordlist.displayName=Keyword List Names", + "FileSorter.SortingMethod.fullPath.displayName=Full Path"}) enum SortingMethod { BY_FILE_NAME(new ArrayList<>(), Bundle.FileSorter_SortingMethod_filename_displayName()), // Sort alphabetically by file name diff --git a/Core/src/org/sleuthkit/autopsy/filequery/SearchResults.java b/Core/src/org/sleuthkit/autopsy/filequery/SearchResults.java index 90c26322ba..d260cd5aa4 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/SearchResults.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/SearchResults.java @@ -59,7 +59,7 @@ class SearchResults { * Create an dummy SearchResults object that can be used in the UI before the search is finished. */ SearchResults() { - this.groupSortingType = FileGroup.GroupSortingAlgorithm.BY_GROUP_KEY; + this.groupSortingType = FileGroup.GroupSortingAlgorithm.BY_GROUP_NAME; this.attrType = new FileSearch.FileSizeAttribute(); this.fileSorter = new FileSorter(FileSorter.SortingMethod.BY_FILE_NAME); }