Autopsy  4.10.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DataSourceSummaryDialog.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2019 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.casemodule.datasourcesummary;
20 
21 import java.awt.Frame;
22 import java.util.Map;
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;
29 import org.sleuthkit.datamodel.DataSource;
30 
34 final class DataSourceSummaryDialog extends javax.swing.JDialog implements Observer {
35 
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());
42 
48  @Messages({
49  "DataSourceSummaryDialog.window.title=Data Sources Summary",
50  "DataSourceSummaryDialog.countsTab.title=Counts",
51  "DataSourceSummaryDialog.detailsTab.title=Details",
52  "DataSourceSummaryDialog.ingestHistoryTab.title=Ingest History"
53  })
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();
62  initComponents();
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);
73  this.repaint();
74  }
75  });
76  this.pack();
77  }
78 
82  void enableObserver() {
83  dataSourcesPanel.addObserver(this);
84  }
85 
86  @Override
87  public void update(Observable o, Object arg) {
88  this.dispose();
89  }
90 
96  @SuppressWarnings("unchecked")
97  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
98  private void initComponents() {
99 
100  closeButton = new javax.swing.JButton();
101  dataSourceSummarySplitPane = new javax.swing.JSplitPane();
102  dataSourceTabbedPane = new javax.swing.JTabbedPane();
103 
104  org.openide.awt.Mnemonics.setLocalizedText(closeButton, org.openide.util.NbBundle.getMessage(DataSourceSummaryDialog.class, "DataSourceSummaryDialog.closeButton.text")); // NOI18N
105  closeButton.addActionListener(new java.awt.event.ActionListener() {
106  public void actionPerformed(java.awt.event.ActionEvent evt) {
107  closeButtonActionPerformed(evt);
108  }
109  });
110 
111  dataSourceSummarySplitPane.setDividerLocation(130);
112  dataSourceSummarySplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
113  dataSourceSummarySplitPane.setRightComponent(dataSourceTabbedPane);
114 
115  dataSourceSummarySplitPane.setLeftComponent(dataSourcesPanel);
116 
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()
122  .addContainerGap()
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)))
128  .addContainerGap())
129  );
130  layout.setVerticalGroup(
131  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132  .addGroup(layout.createSequentialGroup()
133  .addContainerGap()
134  .addComponent(dataSourceSummarySplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE)
135  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
136  .addComponent(closeButton)
137  .addContainerGap())
138  );
139  }// </editor-fold>//GEN-END:initComponents
140 
141  private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
142  this.dispose();
143  }//GEN-LAST:event_closeButtonActionPerformed
144 
152  void selectDataSource(Long dataSourceId) {
153  dataSourcesPanel.selectDataSource(dataSourceId);
154  }
155 
156  // Variables declaration - do not modify//GEN-BEGIN:variables
157  private javax.swing.JButton closeButton;
158  private javax.swing.JSplitPane dataSourceSummarySplitPane;
159  private javax.swing.JTabbedPane dataSourceTabbedPane;
160  // End of variables declaration//GEN-END:variables
161 }

Copyright © 2012-2018 Basis Technology. Generated on: Fri Mar 22 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.