Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
DocumentFilterPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy
3  *
4  * Copyright 2020 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.discovery.ui;
20 
21 import java.util.ArrayList;
22 import java.util.Arrays;
23 import java.util.List;
27 
31 final class DocumentFilterPanel extends AbstractFiltersPanel {
32 
33  private static final long serialVersionUID = 1L;
34  private static final SearchData.Type TYPE = SearchData.Type.DOCUMENT;
35 
39  @ThreadConfined(type = ThreadConfined.ThreadType.AWT)
40  DocumentFilterPanel() {
41  super();
42  initComponents();
43  SizeFilterPanel sizeFilterPanel = new SizeFilterPanel(TYPE);
44  List<SearchData.FileSize> defaultSizes = new ArrayList<>();
45  defaultSizes.add(SearchData.FileSize.LARGE_IMAGE);
46  defaultSizes.add(SearchData.FileSize.XLARGE_IMAGE);
47  defaultSizes.add(SearchData.FileSize.XXLARGE_IMAGE);
48  addFilter(sizeFilterPanel, true, defaultSizes, 0);
49  addFilter(new DataSourceFilterPanel(), false, null, 0);
50  List<SearchData.Frequency> defaultFrequencies = new ArrayList<>();
51  if (!CentralRepository.isEnabled()) {
52  defaultFrequencies.add(SearchData.Frequency.UNKNOWN);
53  } else {
54  defaultFrequencies.add(SearchData.Frequency.RARE);
55  defaultFrequencies.add(SearchData.Frequency.UNIQUE);
56  defaultFrequencies.add(SearchData.Frequency.COMMON);
57  }
58  addFilter(new PastOccurrencesFilterPanel(TYPE), true, defaultFrequencies, 0);
59  addFilter(new HashSetFilterPanel(), false, null, 1);
60  addFilter(new InterestingItemsFilterPanel(), false, null, 1);
61  addFilter(new ParentFolderFilterPanel(), false, null, 1);
62  addPanelsToScrollPane(documentsFiltersSplitPane);
63  }
64 
70  @SuppressWarnings("unchecked")
71  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
72  private void initComponents() {
73 
74  javax.swing.JScrollPane documentFiltersScrollPane = new javax.swing.JScrollPane();
75  javax.swing.JPanel documentFiltersPanel = new javax.swing.JPanel();
76  documentsFiltersSplitPane = new javax.swing.JSplitPane();
77 
78  setLayout(new java.awt.BorderLayout());
79 
80  documentsFiltersSplitPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(DocumentFilterPanel.class, "DocumentFilterPanel.documentsFiltersSplitPane.border.title"))); // NOI18N
81  documentsFiltersSplitPane.setResizeWeight(0.5);
82 
83  javax.swing.GroupLayout documentFiltersPanelLayout = new javax.swing.GroupLayout(documentFiltersPanel);
84  documentFiltersPanel.setLayout(documentFiltersPanelLayout);
85  documentFiltersPanelLayout.setHorizontalGroup(
86  documentFiltersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
87  .addGroup(documentFiltersPanelLayout.createSequentialGroup()
88  .addGap(8, 8, 8)
89  .addComponent(documentsFiltersSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
90  .addGap(8, 8, 8))
91  );
92  documentFiltersPanelLayout.setVerticalGroup(
93  documentFiltersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
94  .addGroup(documentFiltersPanelLayout.createSequentialGroup()
95  .addGap(8, 8, 8)
96  .addComponent(documentsFiltersSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE)
97  .addGap(8, 8, 8))
98  );
99 
100  documentFiltersScrollPane.setViewportView(documentFiltersPanel);
101 
102  add(documentFiltersScrollPane, java.awt.BorderLayout.CENTER);
103  }// </editor-fold>//GEN-END:initComponents
104  @Override
105  SearchData.Type getType() {
106  return TYPE;
107  }
108  // Variables declaration - do not modify//GEN-BEGIN:variables
109  private javax.swing.JSplitPane documentsFiltersSplitPane;
110  // End of variables declaration//GEN-END:variables
111 
112 }
Type(int value, String displayName, Collection< String > mediaTypes, Collection< BlackboardArtifact.ARTIFACT_TYPE > artifactTypes)

Copyright © 2012-2022 Basis Technology. Generated on: Mon Dec 5 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.