19 package org.sleuthkit.autopsy.casemodule.datasourcesummary;
21 import java.awt.Frame;
23 import java.util.Observable;
24 import java.util.Observer;
25 import java.util.logging.Logger;
26 import javax.swing.event.ListSelectionEvent;
27 import org.openide.util.NbBundle.Messages;
34 final class DataSourceSummaryDialog
extends javax.swing.JDialog implements Observer {
36 private static final long serialVersionUID = 1L;
37 private final DataSourceSummaryCountsPanel countsPanel;
38 private final DataSourceSummaryDetailsPanel detailsPanel;
39 private final DataSourceBrowser dataSourcesPanel;
40 private final IngestJobInfoPanel ingestHistoryPanel;
41 private static final Logger logger = Logger.getLogger(DataSourceSummaryDialog.class.getName());
49 "DataSourceSummaryDialog.window.title=Data Sources Summary",
50 "DataSourceSummaryDialog.countsTab.title=Counts",
51 "DataSourceSummaryDialog.detailsTab.title=Details",
52 "DataSourceSummaryDialog.ingestHistoryTab.title=Ingest History"
54 DataSourceSummaryDialog(Frame owner) {
55 super(owner, Bundle.DataSourceSummaryDialog_window_title(),
true);
56 Map<Long, String> usageMap = DataSourceInfoUtilities.getDataSourceTypes();
57 Map<Long, Long> fileCountsMap = DataSourceInfoUtilities.getCountsOfFiles();
58 countsPanel =
new DataSourceSummaryCountsPanel(fileCountsMap);
59 detailsPanel =
new DataSourceSummaryDetailsPanel(usageMap);
60 dataSourcesPanel =
new DataSourceBrowser(usageMap, fileCountsMap);
61 ingestHistoryPanel =
new IngestJobInfoPanel();
63 dataSourceSummarySplitPane.setLeftComponent(dataSourcesPanel);
64 dataSourceTabbedPane.addTab(Bundle.DataSourceSummaryDialog_detailsTab_title(), detailsPanel);
65 dataSourceTabbedPane.addTab(Bundle.DataSourceSummaryDialog_countsTab_title(), countsPanel);
66 dataSourceTabbedPane.addTab(Bundle.DataSourceSummaryDialog_ingestHistoryTab_title(), ingestHistoryPanel);
67 dataSourcesPanel.addListSelectionListener((ListSelectionEvent e) -> {
68 if (!e.getValueIsAdjusting()) {
69 DataSource selectedDataSource = dataSourcesPanel.getSelectedDataSource();
70 countsPanel.updateCountsTableData(selectedDataSource);
71 detailsPanel.updateDetailsPanelData(selectedDataSource);
72 ingestHistoryPanel.updateIngestHistoryData(selectedDataSource);
82 void enableObserver() {
83 dataSourcesPanel.addObserver(
this);
87 public void update(Observable o, Object arg) {
96 @SuppressWarnings(
"unchecked")
98 private
void initComponents() {
100 closeButton =
new javax.swing.JButton();
101 dataSourceSummarySplitPane =
new javax.swing.JSplitPane();
102 dataSourceTabbedPane =
new javax.swing.JTabbedPane();
104 org.openide.awt.Mnemonics.setLocalizedText(closeButton,
org.openide.util.NbBundle.getMessage(DataSourceSummaryDialog.class,
"DataSourceSummaryDialog.closeButton.text"));
105 closeButton.addActionListener(
new java.awt.event.ActionListener() {
106 public void actionPerformed(java.awt.event.ActionEvent evt) {
107 closeButtonActionPerformed(evt);
111 dataSourceSummarySplitPane.setDividerLocation(130);
112 dataSourceSummarySplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
113 dataSourceSummarySplitPane.setRightComponent(dataSourceTabbedPane);
115 dataSourceSummarySplitPane.setLeftComponent(dataSourcesPanel);
117 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(getContentPane());
118 getContentPane().setLayout(layout);
119 layout.setHorizontalGroup(
120 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
121 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
123 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
124 .addComponent(dataSourceSummarySplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 668, Short.MAX_VALUE)
125 .addGroup(layout.createSequentialGroup()
126 .addGap(0, 0, Short.MAX_VALUE)
127 .addComponent(closeButton)))
130 layout.setVerticalGroup(
131 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132 .addGroup(layout.createSequentialGroup()
134 .addComponent(dataSourceSummarySplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE)
135 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
136 .addComponent(closeButton)
141 private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {
152 void selectDataSource(Long dataSourceId) {
153 dataSourcesPanel.selectDataSource(dataSourceId);
157 private javax.swing.JButton closeButton;
158 private javax.swing.JSplitPane dataSourceSummarySplitPane;
159 private javax.swing.JTabbedPane dataSourceTabbedPane;