19 package org.sleuthkit.autopsy.datasourcesummary.ui;
21 import java.util.Arrays;
22 import java.util.List;
23 import java.util.function.Function;
24 import org.apache.commons.lang3.tuple.Pair;
25 import org.openide.util.NbBundle.Messages;
39 "AnalysisPanel_keyColumn_title=Name",
40 "AnalysisPanel_countColumn_title=Count",
41 "AnalysisPanel_keywordSearchModuleName=Keyword Search",
42 "AnalysisPanel_hashsetHits_tabName=Hashset Hits",
43 "AnalysisPanel_keywordHits_tabName=Keyword Hits",
44 "AnalysisPanel_interestingItemHits_tabName=Interesting Item Hits",})
47 private static final long serialVersionUID = 1L;
50 private static final List<ColumnModel<Pair<String, Long>,
DefaultCellModel<?>>> DEFAULT_COLUMNS = Arrays.asList(
52 Bundle.AnalysisPanel_keyColumn_title(),
57 Bundle.AnalysisPanel_countColumn_title(),
64 private static final Function<Pair<String, Long>, String> DEFAULT_KEY_PROVIDER = (pair) -> pair.getKey();
72 .setKeyFunction(DEFAULT_KEY_PROVIDER);
76 .setKeyFunction(DEFAULT_KEY_PROVIDER);
80 .setKeyFunction(DEFAULT_KEY_PROVIDER);
82 private final List<JTablePanel<?>> tables = Arrays.asList(
106 hashsetsFetcher = (dataSource) -> analysisData.
getHashsetCounts(dataSource);
107 keywordsFetcher = (dataSource) -> analysisData.
getKeywordCounts(dataSource);
111 dataFetchComponents = Arrays.asList(
115 (result) -> hashsetHitsTable.showDataFetchResult(result)),
119 (result) -> keywordHitsTable.showDataFetchResult(result)),
122 interestingItemsFetcher,
123 (result) -> interestingItemsTable.showDataFetchResult(result))
137 fetchInformation(dataFetchComponents, dataSource);
142 onNewDataSource(dataFetchComponents, tables, dataSource);
150 @SuppressWarnings(
"unchecked")
152 private
void initComponents() {
154 javax.swing.JScrollPane mainScrollPane =
new javax.swing.JScrollPane();
155 javax.swing.JPanel mainContentPanel =
new javax.swing.JPanel();
156 javax.swing.JPanel ingestRunningPanel = ingestRunningLabel;
157 javax.swing.JLabel hashsetHitsLabel =
new javax.swing.JLabel();
158 javax.swing.Box.Filler filler1 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2),
new java.awt.Dimension(32767, 2));
159 javax.swing.JPanel hashSetHitsPanel = hashsetHitsTable;
160 javax.swing.Box.Filler filler2 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 20),
new java.awt.Dimension(0, 20),
new java.awt.Dimension(32767, 20));
161 javax.swing.JLabel keywordHitsLabel =
new javax.swing.JLabel();
162 javax.swing.Box.Filler filler4 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2),
new java.awt.Dimension(32767, 2));
163 javax.swing.JPanel keywordHitsPanel = keywordHitsTable;
164 javax.swing.Box.Filler filler5 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 20),
new java.awt.Dimension(0, 20),
new java.awt.Dimension(32767, 20));
165 javax.swing.JLabel interestingItemLabel =
new javax.swing.JLabel();
166 javax.swing.Box.Filler filler6 =
new javax.swing.Box.Filler(
new java.awt.Dimension(0, 2),
new java.awt.Dimension(0, 2),
new java.awt.Dimension(32767, 2));
167 javax.swing.JPanel interestingItemPanel = interestingItemsTable;
168 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(0, 32767));
170 mainContentPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
171 mainContentPanel.setMaximumSize(
new java.awt.Dimension(32767, 452));
172 mainContentPanel.setMinimumSize(
new java.awt.Dimension(200, 452));
173 mainContentPanel.setLayout(
new javax.swing.BoxLayout(mainContentPanel, javax.swing.BoxLayout.PAGE_AXIS));
175 ingestRunningPanel.setAlignmentX(0.0F);
176 ingestRunningPanel.setMaximumSize(
new java.awt.Dimension(32767, 25));
177 ingestRunningPanel.setMinimumSize(
new java.awt.Dimension(10, 25));
178 ingestRunningPanel.setPreferredSize(
new java.awt.Dimension(10, 25));
179 mainContentPanel.add(ingestRunningPanel);
181 org.openide.awt.Mnemonics.setLocalizedText(hashsetHitsLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.hashsetHitsLabel.text"));
182 mainContentPanel.add(hashsetHitsLabel);
183 mainContentPanel.add(filler1);
185 hashSetHitsPanel.setAlignmentX(0.0F);
186 hashSetHitsPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
187 hashSetHitsPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
188 hashSetHitsPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
189 mainContentPanel.add(hashSetHitsPanel);
190 mainContentPanel.add(filler2);
192 org.openide.awt.Mnemonics.setLocalizedText(keywordHitsLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.keywordHitsLabel.text"));
193 mainContentPanel.add(keywordHitsLabel);
194 mainContentPanel.add(filler4);
196 keywordHitsPanel.setAlignmentX(0.0F);
197 keywordHitsPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
198 keywordHitsPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
199 keywordHitsPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
200 mainContentPanel.add(keywordHitsPanel);
201 mainContentPanel.add(filler5);
203 org.openide.awt.Mnemonics.setLocalizedText(interestingItemLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.interestingItemLabel.text"));
204 mainContentPanel.add(interestingItemLabel);
205 mainContentPanel.add(filler6);
207 interestingItemPanel.setAlignmentX(0.0F);
208 interestingItemPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
209 interestingItemPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
210 interestingItemPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
211 mainContentPanel.add(interestingItemPanel);
212 mainContentPanel.add(filler3);
214 mainScrollPane.setViewportView(mainContentPanel);
216 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
217 this.setLayout(layout);
218 layout.setHorizontalGroup(
219 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
220 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 756, Short.MAX_VALUE)
222 layout.setVerticalGroup(
223 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
224 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
void fetchInformation(DataSource dataSource)
AnalysisPanel(AnalysisSummaryGetter analysisData)
final DataFetcher< DataSource, List< Pair< String, Long > > > interestingItemsFetcher
List< Pair< String, Long > > getHashsetCounts(DataSource dataSource)
final DataFetcher< DataSource, List< Pair< String, Long > > > keywordsFetcher
final DataFetcher< DataSource, List< Pair< String, Long > > > hashsetsFetcher
static< T, CextendsGuiCellModel > JTablePanel< T > getJTablePanel(List< ColumnModel< T, C >> columns)
void onNewDataSource(DataSource dataSource)
List< Pair< String, Long > > getInterestingItemCounts(DataSource dataSource)
final List< DataFetchWorker.DataFetchComponents< DataSource,?> > dataFetchComponents
List< Pair< String, Long > > getKeywordCounts(DataSource dataSource)