Autopsy  4.15.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DataSourceIntegrityIngestSettingsPanel.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2018-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.modules.dataSourceIntegrity;
20 
23 
27 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
28 final class DataSourceIntegrityIngestSettingsPanel extends IngestModuleIngestJobSettingsPanel {
29 
33  DataSourceIntegrityIngestSettingsPanel(DataSourceIntegrityIngestSettings settings) {
34  initComponents();
35  customizeComponents(settings);
36  }
37 
43  private void customizeComponents(DataSourceIntegrityIngestSettings settings) {
44  computeHashesCheckbox.setSelected(settings.shouldComputeHashes());
45  verifyHashesCheckbox.setSelected(settings.shouldVerifyHashes());
46  }
47 
48  @Override
49  public IngestModuleIngestJobSettings getSettings() {
50  return new DataSourceIntegrityIngestSettings(computeHashesCheckbox.isSelected(), verifyHashesCheckbox.isSelected());
51  }
52 
58  @SuppressWarnings("unchecked")
59  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
60  private void initComponents() {
61  java.awt.GridBagConstraints gridBagConstraints;
62 
63  verifyHashesCheckbox = new javax.swing.JCheckBox();
64  ingestSettingsLabel = new javax.swing.JLabel();
65  noteLabel = new javax.swing.JLabel();
66  computeHashesPanel = new javax.swing.JPanel();
67  computeHashesCheckbox = new javax.swing.JCheckBox();
68  computeHashesTextArea = new javax.swing.JTextArea();
69 
70  setPreferredSize(new java.awt.Dimension(300, 155));
71 
72  org.openide.awt.Mnemonics.setLocalizedText(verifyHashesCheckbox, org.openide.util.NbBundle.getMessage(DataSourceIntegrityIngestSettingsPanel.class, "DataSourceIntegrityIngestSettingsPanel.verifyHashesCheckbox.text")); // NOI18N
73  verifyHashesCheckbox.setFocusable(false);
74 
75  ingestSettingsLabel.setFont(ingestSettingsLabel.getFont().deriveFont(ingestSettingsLabel.getFont().getStyle() | java.awt.Font.BOLD));
76  org.openide.awt.Mnemonics.setLocalizedText(ingestSettingsLabel, org.openide.util.NbBundle.getMessage(DataSourceIntegrityIngestSettingsPanel.class, "DataSourceIntegrityIngestSettingsPanel.ingestSettingsLabel.text")); // NOI18N
77 
78  org.openide.awt.Mnemonics.setLocalizedText(noteLabel, org.openide.util.NbBundle.getMessage(DataSourceIntegrityIngestSettingsPanel.class, "DataSourceIntegrityIngestSettingsPanel.noteLabel.text")); // NOI18N
79 
80  computeHashesPanel.setLayout(new java.awt.GridBagLayout());
81  gridBagConstraints = new java.awt.GridBagConstraints();
82  gridBagConstraints.gridx = 0;
83  gridBagConstraints.gridy = 0;
84  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
85  computeHashesPanel.add(computeHashesCheckbox, gridBagConstraints);
86 
87  computeHashesTextArea.setEditable(false);
88  computeHashesTextArea.setBackground(new java.awt.Color(240, 240, 240));
89  computeHashesTextArea.setColumns(20);
90  computeHashesTextArea.setLineWrap(true);
91  computeHashesTextArea.setRows(2);
92  computeHashesTextArea.setText(org.openide.util.NbBundle.getMessage(DataSourceIntegrityIngestSettingsPanel.class, "DataSourceIntegrityIngestSettingsPanel.computeHashesCheckbox.text")); // NOI18N
93  computeHashesTextArea.setWrapStyleWord(true);
94  computeHashesTextArea.setBorder(null);
95  computeHashesTextArea.setFocusable(false);
96  computeHashesTextArea.setOpaque(false);
97  computeHashesTextArea.setRequestFocusEnabled(false);
98  computeHashesTextArea.addMouseListener(new java.awt.event.MouseAdapter() {
99  public void mouseClicked(java.awt.event.MouseEvent evt) {
100  computeHashesTextAreaMouseClicked(evt);
101  }
102  });
103  gridBagConstraints = new java.awt.GridBagConstraints();
104  gridBagConstraints.gridx = 1;
105  gridBagConstraints.gridy = 0;
106  gridBagConstraints.gridwidth = 3;
107  gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
108  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
109  gridBagConstraints.weightx = 1.0;
110  gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0);
111  computeHashesPanel.add(computeHashesTextArea, gridBagConstraints);
112 
113  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
114  this.setLayout(layout);
115  layout.setHorizontalGroup(
116  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
117  .addGroup(layout.createSequentialGroup()
118  .addContainerGap()
119  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
120  .addComponent(noteLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
121  .addComponent(verifyHashesCheckbox)
122  .addComponent(ingestSettingsLabel)
123  .addComponent(computeHashesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
124  .addContainerGap(13, Short.MAX_VALUE))
125  );
126  layout.setVerticalGroup(
127  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
128  .addGroup(layout.createSequentialGroup()
129  .addContainerGap()
130  .addComponent(ingestSettingsLabel)
131  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
132  .addComponent(computeHashesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
133  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
134  .addComponent(verifyHashesCheckbox)
135  .addGap(18, 18, 18)
136  .addComponent(noteLabel)
137  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
138  );
139  }// </editor-fold>//GEN-END:initComponents
140 
141  private void computeHashesTextAreaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_computeHashesTextAreaMouseClicked
142  computeHashesCheckbox.doClick();
143  }//GEN-LAST:event_computeHashesTextAreaMouseClicked
144 
145  // Variables declaration - do not modify//GEN-BEGIN:variables
146  private javax.swing.JCheckBox computeHashesCheckbox;
147  private javax.swing.JPanel computeHashesPanel;
148  private javax.swing.JTextArea computeHashesTextArea;
149  private javax.swing.JLabel ingestSettingsLabel;
150  private javax.swing.JLabel noteLabel;
151  private javax.swing.JCheckBox verifyHashesCheckbox;
152  // End of variables declaration//GEN-END:variables
153 
154 }

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