Autopsy  4.8.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ShowCasesDialog.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2015-2018 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.centralrepository.optionspanel;
20 
21 import java.util.List;
22 import java.util.logging.Level;
23 import javax.swing.JDialog;
24 import javax.swing.JFrame;
25 import org.openide.util.NbBundle.Messages;
26 import org.openide.windows.WindowManager;
31 
35 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
36 final class ShowCasesDialog extends JDialog {
37 
38  private static final long serialVersionUID = 1L;
39 
40  private final static Logger logger = Logger.getLogger(ShowCasesDialog.class.getName());
41 
42  private final ShowCasesTableModel tableModel;
43  @Messages({"ShowCasesDialog.title_text=All Cases Details"})
47  ShowCasesDialog() {
48  super((JFrame) WindowManager.getDefault().getMainWindow(),
49  Bundle.ShowCasesDialog_title_text(),
50  true);
51  tableModel = new ShowCasesTableModel();
52  initComponents();
53  try {
54  EamDb dbManager = EamDb.getInstance();
55  List<CorrelationCase> eamCases = dbManager.getCases();
56  for(CorrelationCase eamCase : eamCases) {
57  tableModel.addEamCase(eamCase);
58  }
59  } catch (EamDbException ex) {
60  logger.log(Level.SEVERE, "Error getting list of cases from database.", ex); // NON-NLS
61  }
62  display();
63  }
64 
65  private void display() {
66  this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
67  setVisible(true);
68  }
69 
70 
71 
77  @SuppressWarnings("unchecked")
78  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
79  private void initComponents() {
80 
81  showCasesPanel = new javax.swing.JPanel();
82  showCasesScrollPane = new javax.swing.JScrollPane();
83  outCasesPane = new javax.swing.JPanel();
84  innerCaseScrollPane = new javax.swing.JScrollPane();
85  caseDetailsTable = new javax.swing.JTable();
86  closeButton = new javax.swing.JButton();
87 
88  setTitle(org.openide.util.NbBundle.getMessage(ShowCasesDialog.class, "ShowCasesDialog.title")); // NOI18N
89  setMinimumSize(new java.awt.Dimension(545, 415));
90 
91  showCasesPanel.setPreferredSize(new java.awt.Dimension(527, 407));
92 
93  showCasesScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
94  showCasesScrollPane.setPreferredSize(new java.awt.Dimension(535, 415));
95 
96  innerCaseScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
97 
98  caseDetailsTable.setAutoCreateRowSorter(true);
99  caseDetailsTable.setModel(tableModel);
100  caseDetailsTable.setToolTipText(org.openide.util.NbBundle.getMessage(ShowCasesDialog.class, "ShowCasesDialog.caseDetailsTable.toolTipText")); // NOI18N
101  caseDetailsTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
102  caseDetailsTable.getTableHeader().setReorderingAllowed(false);
103  innerCaseScrollPane.setViewportView(caseDetailsTable);
104  caseDetailsTable.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ShowCasesDialog.class, "ShowCasesDialog.caseDetailsTable.AccessibleContext.accessibleDescription")); // NOI18N
105 
106  javax.swing.GroupLayout outCasesPaneLayout = new javax.swing.GroupLayout(outCasesPane);
107  outCasesPane.setLayout(outCasesPaneLayout);
108  outCasesPaneLayout.setHorizontalGroup(
109  outCasesPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
110  .addGap(0, 1423, Short.MAX_VALUE)
111  .addGroup(outCasesPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
112  .addComponent(innerCaseScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 1423, Short.MAX_VALUE))
113  );
114  outCasesPaneLayout.setVerticalGroup(
115  outCasesPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
116  .addGap(0, 500, Short.MAX_VALUE)
117  .addGroup(outCasesPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
118  .addComponent(innerCaseScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE))
119  );
120 
121  showCasesScrollPane.setViewportView(outCasesPane);
122 
123  javax.swing.GroupLayout showCasesPanelLayout = new javax.swing.GroupLayout(showCasesPanel);
124  showCasesPanel.setLayout(showCasesPanelLayout);
125  showCasesPanelLayout.setHorizontalGroup(
126  showCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
127  .addGap(0, 1188, Short.MAX_VALUE)
128  .addGroup(showCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
129  .addComponent(showCasesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 527, Short.MAX_VALUE))
130  );
131  showCasesPanelLayout.setVerticalGroup(
132  showCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
133  .addGap(0, 473, Short.MAX_VALUE)
134  .addGroup(showCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
135  .addComponent(showCasesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 407, Short.MAX_VALUE))
136  );
137 
138  org.openide.awt.Mnemonics.setLocalizedText(closeButton, org.openide.util.NbBundle.getMessage(ShowCasesDialog.class, "ShowCasesDialog.closeButton.text")); // NOI18N
139  closeButton.setActionCommand(org.openide.util.NbBundle.getMessage(ShowCasesDialog.class, "ShowCasesDialog.closeButton.actionCommand")); // NOI18N
140  closeButton.addActionListener(new java.awt.event.ActionListener() {
141  public void actionPerformed(java.awt.event.ActionEvent evt) {
142  closeButtonActionPerformed(evt);
143  }
144  });
145 
146  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
147  getContentPane().setLayout(layout);
148  layout.setHorizontalGroup(
149  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
150  .addGroup(layout.createSequentialGroup()
151  .addGap(6, 6, 6)
152  .addComponent(showCasesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1188, Short.MAX_VALUE)
153  .addGap(6, 6, 6))
154  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
155  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
156  .addComponent(closeButton)
157  .addContainerGap())
158  );
159  layout.setVerticalGroup(
160  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
161  .addGroup(layout.createSequentialGroup()
162  .addGap(6, 6, 6)
163  .addComponent(showCasesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 473, Short.MAX_VALUE)
164  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
165  .addComponent(closeButton)
166  .addContainerGap())
167  );
168 
169  closeButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ShowCasesDialog.class, "ShowCasesDialog.closeButton.AccessibleContext.accessibleName")); // NOI18N
170 
171  pack();
172  }// </editor-fold>//GEN-END:initComponents
173 
174  private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
175  dispose();
176  }//GEN-LAST:event_closeButtonActionPerformed
177 
178 
179  // Variables declaration - do not modify//GEN-BEGIN:variables
180  private javax.swing.JTable caseDetailsTable;
181  private javax.swing.JButton closeButton;
182  private javax.swing.JScrollPane innerCaseScrollPane;
183  private javax.swing.JPanel outCasesPane;
184  private javax.swing.JPanel showCasesPanel;
185  private javax.swing.JScrollPane showCasesScrollPane;
186  // End of variables declaration//GEN-END:variables
187 
188 
189 
190 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2018 Basis Technology. Generated on: Thu Oct 4 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.