20 package org.sleuthkit.autopsy.commonpropertiessearch;
23 import java.util.Collections;
24 import java.util.HashMap;
25 import java.util.List;
27 import java.util.Map.Entry;
28 import java.util.Observable;
29 import java.util.Observer;
30 import java.util.logging.Level;
31 import javax.swing.ComboBoxModel;
45 static final int NO_CASE_SELECTED = -1;
49 private final Map<Integer, String>
caseMap;
58 this.caseMap =
new HashMap<>();
59 fileTypeFilterObservable =
new Observable() {
61 public void notifyObservers() {
65 super.notifyObservers();
76 void addObserver(Observer observer) {
77 fileTypeFilterObservable.addObserver(observer);
87 boolean fileCategoriesButtonIsSelected() {
98 boolean pictureVideoCheckboxIsSelected() {
109 boolean documentsCheckboxIsSelected() {
117 void setupCorrelationTypeFilter() {
120 List<CorrelationAttributeInstance.Type> types = CorrelationAttributeInstance.getDefaultCorrelationTypes();
121 for (CorrelationAttributeInstance.Type type : types) {
125 }
catch (EamDbException ex) {
126 logger.log(Level.WARNING,
"Error getting correlation types", ex);
136 @SuppressWarnings(
"unchecked")
159 public void actionPerformed(java.awt.event.ActionEvent evt) {
173 public void actionPerformed(java.awt.event.ActionEvent evt) {
184 public void actionPerformed(java.awt.event.ActionEvent evt) {
193 public void actionPerformed(java.awt.event.ActionEvent evt) {
202 public void actionPerformed(java.awt.event.ActionEvent evt) {
209 public void actionPerformed(java.awt.event.ActionEvent evt) {
214 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
215 this.setLayout(layout);
216 layout.setHorizontalGroup(
217 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
219 .addGroup(layout.createSequentialGroup()
221 .addGap(0, 0, Short.MAX_VALUE))
222 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
223 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
224 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
225 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
227 .addGroup(layout.createSequentialGroup()
229 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
232 .addGroup(layout.createSequentialGroup()
234 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
237 .addGap(0, 0, Short.MAX_VALUE))
238 .addGroup(layout.createSequentialGroup()
240 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
241 .addComponent(
caseComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
245 layout.setVerticalGroup(
246 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
247 .addGroup(layout.createSequentialGroup()
250 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
251 .addComponent(
caseComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
252 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
254 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
255 .addComponent(
correlationTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
256 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
258 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
260 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
262 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
264 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
276 fileTypeFilterObservable.notifyObservers();
284 fileTypeFilterObservable.notifyObservers();
308 fileTypeFilterObservable.notifyObservers();
313 fileTypeFilterObservable.notifyObservers();
336 Map<Integer, String> getCaseMap() {
337 return Collections.unmodifiableMap(this.caseMap);
347 this.casesList = dataSourceComboBoxModel;
348 this.caseComboBox.setModel(dataSourceComboBoxModel);
356 void setCaseMap(Map<Integer, String> caseMap) {
357 this.caseMap.clear();
358 this.caseMap.putAll(caseMap);
367 boolean centralRepoHasMultipleCases() {
368 return this.caseMap.size() >= 2;
377 Integer getSelectedCaseId() {
379 for (Entry<Integer, String> entry : this.caseMap.entrySet()) {
380 if (entry.getValue().equals(this.caseComboBox.getSelectedItem())) {
381 return entry.getKey();
394 CorrelationAttributeInstance.Type getSelectedCorrelationType() {
javax.swing.JComboBox< String > correlationTypeComboBox
void documentsCheckboxActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JComboBox< String > caseComboBox
void allFileCategoriesRadioButtonActionPerformed(java.awt.event.ActionEvent evt)
Map< String, CorrelationAttributeInstance.Type > correlationTypeFilters
void pictureVideoCheckboxActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel correlationComboBoxLabel
final Observable fileTypeFilterObservable
javax.swing.JCheckBox documentsCheckbox
javax.swing.JCheckBox pictureVideoCheckbox
javax.swing.JRadioButton selectedFileCategoriesButton
static final long serialVersionUID
void specificCentralRepoCaseCheckboxActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JLabel categoriesLabel
void selectedFileCategoriesButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.ButtonGroup buttonGroup
void correlationTypeComboBoxActionPerformed(java.awt.event.ActionEvent evt)
ComboBoxModel< String > casesList
final Map< Integer, String > caseMap
javax.swing.JCheckBox specificCentralRepoCaseCheckbox
synchronized static Logger getLogger(String name)
javax.swing.JRadioButton allFileCategoriesRadioButton
static final Logger logger