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"
45 private static final long serialVersionUID = 1L;
50 private static final List<ColumnModel<Pair<String, Long>>> DEFAULT_COLUMNS = Arrays.asList(
52 Bundle.AnalysisPanel_keyColumn_title(),
57 Bundle.AnalysisPanel_countColumn_title(),
63 private static final Function<Pair<String, Long>, String> DEFAULT_KEY_PROVIDER = (pair) -> pair.getKey();
67 .setKeyFunction(DEFAULT_KEY_PROVIDER);
71 .setKeyFunction(DEFAULT_KEY_PROVIDER);
75 .setKeyFunction(DEFAULT_KEY_PROVIDER);
77 private final List<JTablePanel<?>> tables = Arrays.asList(
102 dataFetchComponents = Arrays.asList(
106 (result) -> hashsetHitsTable.showDataFetchResult(result)),
110 (result) -> keywordHitsTable.showDataFetchResult(result)),
114 (result) -> interestingItemsTable.showDataFetchResult(result))
128 fetchInformation(dataFetchComponents, dataSource);
133 onNewDataSource(dataFetchComponents, tables, dataSource);
141 @SuppressWarnings(
"unchecked")
143 private
void initComponents() {
145 javax.swing.JScrollPane mainScrollPane =
new javax.swing.JScrollPane();
146 javax.swing.JPanel mainContentPanel =
new javax.swing.JPanel();
147 javax.swing.JPanel ingestRunningPanel = ingestRunningLabel;
148 javax.swing.JLabel hashsetHitsLabel =
new javax.swing.JLabel();
149 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));
150 javax.swing.JPanel hashSetHitsPanel = hashsetHitsTable;
151 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));
152 javax.swing.JLabel keywordHitsLabel =
new javax.swing.JLabel();
153 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));
154 javax.swing.JPanel keywordHitsPanel = keywordHitsTable;
155 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));
156 javax.swing.JLabel interestingItemLabel =
new javax.swing.JLabel();
157 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));
158 javax.swing.JPanel interestingItemPanel = interestingItemsTable;
159 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));
161 mainContentPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
162 mainContentPanel.setMaximumSize(
new java.awt.Dimension(32767, 452));
163 mainContentPanel.setMinimumSize(
new java.awt.Dimension(200, 452));
164 mainContentPanel.setLayout(
new javax.swing.BoxLayout(mainContentPanel, javax.swing.BoxLayout.PAGE_AXIS));
166 ingestRunningPanel.setAlignmentX(0.0F);
167 ingestRunningPanel.setMaximumSize(
new java.awt.Dimension(32767, 25));
168 ingestRunningPanel.setMinimumSize(
new java.awt.Dimension(10, 25));
169 ingestRunningPanel.setPreferredSize(
new java.awt.Dimension(10, 25));
170 mainContentPanel.add(ingestRunningPanel);
172 org.openide.awt.Mnemonics.setLocalizedText(hashsetHitsLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.hashsetHitsLabel.text"));
173 mainContentPanel.add(hashsetHitsLabel);
174 mainContentPanel.add(filler1);
176 hashSetHitsPanel.setAlignmentX(0.0F);
177 hashSetHitsPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
178 hashSetHitsPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
179 hashSetHitsPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
180 mainContentPanel.add(hashSetHitsPanel);
181 mainContentPanel.add(filler2);
183 org.openide.awt.Mnemonics.setLocalizedText(keywordHitsLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.keywordHitsLabel.text"));
184 mainContentPanel.add(keywordHitsLabel);
185 mainContentPanel.add(filler4);
187 keywordHitsPanel.setAlignmentX(0.0F);
188 keywordHitsPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
189 keywordHitsPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
190 keywordHitsPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
191 mainContentPanel.add(keywordHitsPanel);
192 mainContentPanel.add(filler5);
194 org.openide.awt.Mnemonics.setLocalizedText(interestingItemLabel,
org.openide.util.NbBundle.getMessage(
AnalysisPanel.class,
"AnalysisPanel.interestingItemLabel.text"));
195 mainContentPanel.add(interestingItemLabel);
196 mainContentPanel.add(filler6);
198 interestingItemPanel.setAlignmentX(0.0F);
199 interestingItemPanel.setMaximumSize(
new java.awt.Dimension(32767, 106));
200 interestingItemPanel.setMinimumSize(
new java.awt.Dimension(10, 106));
201 interestingItemPanel.setPreferredSize(
new java.awt.Dimension(10, 106));
202 mainContentPanel.add(interestingItemPanel);
203 mainContentPanel.add(filler3);
205 mainScrollPane.setViewportView(mainContentPanel);
207 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
208 this.setLayout(layout);
209 layout.setHorizontalGroup(
210 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
211 .addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 756, Short.MAX_VALUE)
213 layout.setVerticalGroup(
214 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
215 .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)