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;
41 "AnalysisPanel_keyColumn_title=Name",
42 "AnalysisPanel_countColumn_title=Count",
43 "AnalysisPanel_keywordSearchModuleName=Keyword Search"
47 private static final long serialVersionUID = 1L;
49 private static final String KEYWORD_SEARCH_MODULE_NAME = Bundle.AnalysisPanel_keywordSearchModuleName();
50 private static final String KEYWORD_SEARCH_FACTORY =
"org.sleuthkit.autopsy.keywordsearch.KeywordSearchModuleFactory";
61 private static final List<ColumnModel<Pair<String, Long>>> DEFAULT_COLUMNS = Arrays.asList(
63 Bundle.AnalysisPanel_keyColumn_title(),
68 Bundle.AnalysisPanel_countColumn_title(),
74 private static final Function<Pair<String, Long>, String> DEFAULT_KEY_PROVIDER = (pair) -> pair.getKey();
78 .setKeyFunction(DEFAULT_KEY_PROVIDER);
82 .setKeyFunction(DEFAULT_KEY_PROVIDER);
86 .setKeyFunction(DEFAULT_KEY_PROVIDER);
88 private final List<JTablePanel<?>> tables = Arrays.asList(
114 dataFetchComponents = Arrays.asList(
118 (result) -> showResultWithModuleCheck(hashsetHitsTable, result, HASHSET_FACTORY, HASHSET_MODULE_NAME)),
122 (result) -> showResultWithModuleCheck(keywordHitsTable, result, KEYWORD_SEARCH_FACTORY, KEYWORD_SEARCH_MODULE_NAME)),
126 (result) -> showResultWithModuleCheck(interestingItemsTable, result, INTERESTING_ITEM_FACTORY, INTERESTING_ITEM_MODULE_NAME))
142 fetchInformation(dataFetchComponents, dataSource);
147 onNewDataSource(dataFetchComponents, tables, dataSource);
155 @SuppressWarnings(
"unchecked")
157 private
void initComponents() {
159 javax.swing.JScrollPane mainScrollPane =
new javax.swing.JScrollPane();
160 javax.swing.JPanel mainContentPanel =
new javax.swing.JPanel();
161 javax.swing.JPanel ingestRunningPanel = ingestRunningLabel;
162 javax.swing.JLabel hashsetHitsLabel =
new javax.swing.JLabel();
163 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));
164 javax.swing.JPanel hashSetHitsPanel = hashsetHitsTable;
165 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));
166 javax.swing.JLabel keywordHitsLabel =
new javax.swing.JLabel();
167 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));
168 javax.swing.JPanel keywordHitsPanel = keywordHitsTable;
169 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));
170 javax.swing.JLabel interestingItemLabel =
new javax.swing.JLabel();
171 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));
172 javax.swing.JPanel interestingItemPanel = interestingItemsTable;
173 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));
175 mainContentPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
176 mainContentPanel.setMaximumSize(
new java.awt.Dimension(32767, 452));
177 mainContentPanel.setMinimumSize(
new java.awt.Dimension(200, 452));
178 mainContentPanel.setLayout(
new javax.swing.BoxLayout(mainContentPanel, javax.swing.BoxLayout.PAGE_AXIS));
180 ingestRunningPanel.setAlignmentX(0.0F);
181 ingestRunningPanel.setMaximumSize(
new java.awt.Dimension(32767, 25));
182 ingestRunningPanel.setMinimumSize(
new java.awt.Dimension(10, 25));
183 ingestRunningPanel.setPreferredSize(
new java.awt.Dimension(10, 25));
184 mainContentPanel.add(ingestRunningPanel);
186 org.openide.awt.Mnemonics.setLocalizedText(hashsetHitsLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.hashsetHitsLabel.text"));
187 mainContentPanel.add(hashsetHitsLabel);
188 mainContentPanel.add(filler1);
190 hashSetHitsPanel.setAlignmentX(0.0F);
191 hashSetHitsPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
192 hashSetHitsPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
193 hashSetHitsPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
194 mainContentPanel.add(hashSetHitsPanel);
195 mainContentPanel.add(filler2);
197 org.openide.awt.Mnemonics.setLocalizedText(keywordHitsLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.keywordHitsLabel.text"));
198 mainContentPanel.add(keywordHitsLabel);
199 mainContentPanel.add(filler4);
201 keywordHitsPanel.setAlignmentX(0.0F);
202 keywordHitsPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
203 keywordHitsPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
204 keywordHitsPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
205 mainContentPanel.add(keywordHitsPanel);
206 mainContentPanel.add(filler5);
208 org.openide.awt.Mnemonics.setLocalizedText(interestingItemLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.interestingItemLabel.text"));
209 mainContentPanel.add(interestingItemLabel);
210 mainContentPanel.add(filler6);
212 interestingItemPanel.setAlignmentX(0.0F);
213 interestingItemPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
214 interestingItemPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
215 interestingItemPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
216 mainContentPanel.add(interestingItemPanel);
217 mainContentPanel.add(filler3);
219 mainScrollPane.setViewportView(mainContentPanel);
221 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
222 this.setLayout(layout);
223 layout.setHorizontalGroup(
224 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
225 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 756, Short.MAX_VALUE)
227 layout.setVerticalGroup(
228 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
229 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
void fetchInformation(DataSource dataSource)
List< Pair< String, Long > > getInterestingItemCounts(DataSource dataSource)
List< Pair< String, Long > > getHashsetCounts(DataSource dataSource)
static< T > JTablePanel< T > getJTablePanel(List< ColumnModel< T >> columns)
void onNewDataSource(DataSource dataSource)
List< Pair< String, Long > > getKeywordCounts(DataSource dataSource)
final List< DataFetchWorker.DataFetchComponents< DataSource,?> > dataFetchComponents
AnalysisPanel(AnalysisSummary analysisData)
static String getModuleName()
String getModuleDisplayName()