20 package org.sleuthkit.autopsy.commonpropertiessearch;
23 import java.util.Collections;
24 import java.util.HashMap;
26 import java.util.Map.Entry;
27 import java.util.Observable;
28 import java.util.Observer;
29 import javax.swing.ComboBoxModel;
40 static final long NO_DATA_SOURCE_SELECTED = -1;
50 this.dataSourceMap =
new HashMap<>();
52 fileTypeFilterObservable =
new Observable() {
54 public void notifyObservers() {
58 super.notifyObservers();
69 void addObserver(Observer observer) {
70 fileTypeFilterObservable.addObserver(observer);
79 Map<Long, String> getDataSourceMap() {
80 return Collections.unmodifiableMap(this.dataSourceMap);
89 Long getSelectedDataSourceId() {
91 for (Entry<Long, String> entry : this.dataSourceMap.entrySet()) {
93 return entry.getKey();
106 boolean fileCategoriesButtonIsSelected() {
117 boolean pictureVideoCheckboxIsSelected() {
128 boolean documentsCheckboxIsSelected() {
137 @SuppressWarnings(
"unchecked")
161 public void actionPerformed(java.awt.event.ActionEvent evt) {
169 public void actionPerformed(java.awt.event.ActionEvent evt) {
177 public void actionPerformed(java.awt.event.ActionEvent evt) {
186 public void actionPerformed(java.awt.event.ActionEvent evt) {
196 public void actionPerformed(java.awt.event.ActionEvent evt) {
201 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
202 this.setLayout(layout);
203 layout.setHorizontalGroup(
204 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
205 .addGroup(layout.createSequentialGroup()
206 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
207 .addGroup(layout.createSequentialGroup()
210 .addGroup(layout.createSequentialGroup()
211 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
213 .addGroup(layout.createSequentialGroup()
215 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
218 .addGroup(layout.createSequentialGroup()
220 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
223 .addGap(0, 0, Short.MAX_VALUE)))
227 layout.setVerticalGroup(
228 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
229 .addGroup(layout.createSequentialGroup()
231 .addComponent(
onlySpecificDataSourceCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
232 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
233 .addComponent(
selectDataSourceComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
234 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
236 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
238 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
240 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
242 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
253 fileTypeFilterObservable.notifyObservers();
262 fileTypeFilterObservable.notifyObservers();
275 fileTypeFilterObservable.notifyObservers();
280 fileTypeFilterObservable.notifyObservers();
301 this.dataSourcesList = dataSourceComboBoxModel;
302 this.selectDataSourceComboBox.setModel(dataSourcesList);
311 void setDataSourceMap(Map<Long, String> dataSourceMap) {
312 this.dataSourceMap.clear();
313 this.dataSourceMap.putAll(dataSourceMap);
final Map< Long, String > dataSourceMap
void pictureVideoCheckboxActionPerformed(java.awt.event.ActionEvent evt)
static final long serialVersionUID
ComboBoxModel< String > dataSourcesList
void onlySpecificDataSourceCheckboxActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JCheckBox documentsCheckbox
javax.swing.JLabel categoriesLabel
javax.swing.JRadioButton allFileCategoriesRadioButton
void selectedFileCategoriesButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JComboBox< String > selectDataSourceComboBox
final Observable fileTypeFilterObservable
javax.swing.JRadioButton selectedFileCategoriesButton
javax.swing.JCheckBox pictureVideoCheckbox
javax.swing.JCheckBox onlySpecificDataSourceCheckbox
javax.swing.ButtonGroup buttonGroup
void documentsCheckboxActionPerformed(java.awt.event.ActionEvent evt)
void allFileCategoriesRadioButtonActionPerformed(java.awt.event.ActionEvent evt)