From 293c5cb40e8408d90c179cd945cdb83b9a4dfc98 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 8 Aug 2019 11:57:17 -0400 Subject: [PATCH] 5367 re-order arguements for consistancy with API --- .../autopsy/filequery/DiscoveryEvents.java | 18 +++++++++--------- .../autopsy/filequery/GroupListPanel.java | 6 +++--- .../autopsy/filequery/PageWorker.java | 18 +++++++++--------- .../autopsy/filequery/ResultsPanel.java | 8 ++++---- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryEvents.java b/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryEvents.java index ef2027aabd..dc335006b6 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryEvents.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/DiscoveryEvents.java @@ -217,26 +217,26 @@ final class DiscoveryEvents { /** * Construct a new GroupSelectedEvent. * - * @param resultType The type of files which exist in the group. - * @param groupName The name of the group which was selected. - * @param groupSize The number of files in the group which was - * selected. * @param searchfilters The search filters which were used by the * search. * @param groupingAttribute The grouping attribute used by the search. * @param groupSort The sorting algorithm used for groups. * @param fileSortMethod The sorting method used for files. + * @param groupName The name of the group which was selected. + * @param groupSize The number of files in the group which was + * selected. + * @param resultType The type of files which exist in the group. */ - GroupSelectedEvent(FileType resultType, String groupName, int groupSize, List searchfilters, + GroupSelectedEvent(List searchfilters, FileSearch.AttributeType groupingAttribute, FileGroup.GroupSortingAlgorithm groupSort, - FileSorter.SortingMethod fileSortMethod) { - this.resultType = resultType; - this.groupName = groupName; - this.groupSize = groupSize; + FileSorter.SortingMethod fileSortMethod, String groupName, int groupSize, FileType resultType) { this.searchfilters = searchfilters; this.groupingAttribute = groupingAttribute; this.groupSort = groupSort; this.fileSortMethod = fileSortMethod; + this.groupName = groupName; + this.groupSize = groupSize; + this.resultType = resultType; } /** diff --git a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java b/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java index 9c6028692b..8b7bbb1ade 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java @@ -22,6 +22,7 @@ import com.google.common.eventbus.Subscribe; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb; import org.sleuthkit.autopsy.filequery.FileSearchData.FileType; /** @@ -38,7 +39,6 @@ class GroupListPanel extends javax.swing.JPanel { private FileSorter.SortingMethod fileSortMethod; private String selectedGroupName; - /** * Creates new form GroupListPanel */ @@ -126,14 +126,14 @@ class GroupListPanel extends javax.swing.JPanel { for (String groupName : groupMap.keySet()) { if (selectedGroup.startsWith(groupName)) { selectedGroupName = groupName; - DiscoveryEvents.getDiscoveryEventBus().post(new DiscoveryEvents.GroupSelectedEvent(resultType, selectedGroupName, groupMap.get(selectedGroupName), searchfilters,groupingAttribute, groupSort, fileSortMethod)); + DiscoveryEvents.getDiscoveryEventBus().post(new DiscoveryEvents.GroupSelectedEvent( + searchfilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupName, groupMap.get(selectedGroupName), resultType)); } } } }//GEN-LAST:event_groupSelected - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JList groupList; private javax.swing.JScrollPane groupListScrollPane; diff --git a/Core/src/org/sleuthkit/autopsy/filequery/PageWorker.java b/Core/src/org/sleuthkit/autopsy/filequery/PageWorker.java index 48dff7c386..51e3cc8f88 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/PageWorker.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/PageWorker.java @@ -32,8 +32,6 @@ import org.sleuthkit.datamodel.AbstractFile; final class PageWorker extends SwingWorker { private final static Logger logger = Logger.getLogger(PageWorker.class.getName()); - private final FileSearchData.FileType resultType; - private final EamDb centralRepo; private final List searchfilters; private final FileSearch.AttributeType groupingAttribute; private final FileGroup.GroupSortingAlgorithm groupSort; @@ -41,12 +39,12 @@ final class PageWorker extends SwingWorker { private final String groupName; private final int startingEntry; private final int pageSize; + private final FileSearchData.FileType resultType; + private final EamDb centralRepo; /** * Construct a new PageWorker. * - * @param resultType The type of files which exist in the group. - * @param centralRepo The central repository to be used. * @param searchfilters The search filters which were used by the * search. * @param groupingAttribute The grouping attribute used by the search. @@ -56,12 +54,12 @@ final class PageWorker extends SwingWorker { * @param startingEntry The first entry in the group to include in this * page. * @param pageSize The number of files to include in this page. + * @param resultType The type of files which exist in the group. + * @param centralRepo The central repository to be used. */ - PageWorker(FileSearchData.FileType resultType, EamDb centralRepo, List searchfilters, - FileSearch.AttributeType groupingAttribute, FileGroup.GroupSortingAlgorithm groupSort, - FileSorter.SortingMethod fileSortMethod, String groupName, int startingEntry, int pageSize) { - this.resultType = resultType; - this.centralRepo = centralRepo; + PageWorker(List searchfilters, FileSearch.AttributeType groupingAttribute, + FileGroup.GroupSortingAlgorithm groupSort, FileSorter.SortingMethod fileSortMethod, String groupName, + int startingEntry, int pageSize, FileSearchData.FileType resultType, EamDb centralRepo) { this.searchfilters = searchfilters; this.groupingAttribute = groupingAttribute; this.groupSort = groupSort; @@ -69,6 +67,8 @@ final class PageWorker extends SwingWorker { this.groupName = groupName; this.startingEntry = startingEntry; this.pageSize = pageSize; + this.resultType = resultType; + this.centralRepo = centralRepo; } @Override diff --git a/Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.java b/Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.java index 64d0a76867..f350cfc342 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/ResultsPanel.java @@ -42,8 +42,6 @@ public class ResultsPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; private final DataResultViewerThumbnail thumbnailViewer; private final DataResultViewerTable tableViewer; - private final EamDb centralRepo; - private FileSearchData.FileType resultType; private List searchFilters; private FileSearch.AttributeType groupingAttribute; private FileGroup.GroupSortingAlgorithm groupSort; @@ -51,6 +49,8 @@ public class ResultsPanel extends javax.swing.JPanel { private String selectedGroupName; private int currentPage = 0; private int previousPageSize = 10; + private FileSearchData.FileType resultType; + private final EamDb centralRepo; private int groupSize = 0; private PageWorker pageWorker; @@ -106,12 +106,12 @@ public class ResultsPanel extends javax.swing.JPanel { @Subscribe void handlePageChangedEvent(DiscoveryEvents.GroupSelectedEvent groupSelectedEvent) { SwingUtilities.invokeLater(() -> { - resultType = groupSelectedEvent.getResultType(); searchFilters = groupSelectedEvent.getFilters(); groupingAttribute = groupSelectedEvent.getGroupingAttr(); groupSort = groupSelectedEvent.getGroupSort(); fileSortMethod = groupSelectedEvent.getFileSort(); selectedGroupName = groupSelectedEvent.getGroupName(); + resultType = groupSelectedEvent.getResultType(); groupSize = groupSelectedEvent.getGroupSize(); setPage(0); }); @@ -129,7 +129,7 @@ public class ResultsPanel extends javax.swing.JPanel { if (pageWorker != null && !pageWorker.isDone()) { pageWorker.cancel(true); } - pageWorker = new PageWorker(resultType, centralRepo, searchFilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupName, startingEntry, pageSize); + pageWorker = new PageWorker(searchFilters, groupingAttribute, groupSort, fileSortMethod, selectedGroupName, startingEntry, pageSize, resultType, centralRepo); pageWorker.execute(); } }