19 package org.sleuthkit.autopsy.modules.hashdatabase;
21 import java.awt.Dimension;
22 import java.awt.Toolkit;
23 import java.awt.event.ActionEvent;
24 import java.awt.event.ActionListener;
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.regex.Pattern;
28 import javax.swing.JFrame;
29 import javax.swing.JMenuItem;
30 import javax.swing.JPopupMenu;
31 import javax.swing.SwingUtilities;
32 import org.openide.util.NbBundle;
43 Pattern md5Pattern = Pattern.compile(
"^[a-fA-F0-9]{32}$");
44 List<HashEntry> hashes =
new ArrayList<>();
45 List<String> invalidHashes =
new ArrayList<>();
61 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
62 setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
72 void enableAddHashValuesToDatabaseDialog(
boolean enable) {
74 setDefaultCloseOperation(2);
76 setDefaultCloseOperation(0);
88 @SuppressWarnings(
"unchecked")
99 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
107 public void mouseClicked(java.awt.event.MouseEvent evt) {
115 public void actionPerformed(java.awt.event.ActionEvent evt) {
122 public void actionPerformed(java.awt.event.ActionEvent evt) {
128 cancelButton.addActionListener(
new java.awt.event.ActionListener() {
129 public void actionPerformed(java.awt.event.ActionEvent evt) {
134 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(getContentPane());
135 getContentPane().setLayout(layout);
136 layout.setHorizontalGroup(
137 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
138 .addGroup(layout.createSequentialGroup()
140 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
141 .addGroup(layout.createSequentialGroup()
142 .addComponent(
instructionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
143 .addGap(0, 41, Short.MAX_VALUE))
146 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
148 .addComponent(
cancelButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
149 .addComponent(
pasteFromClipboardButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE))
152 layout.setVerticalGroup(
153 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
154 .addGroup(layout.createSequentialGroup()
157 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
158 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
159 .addGroup(layout.createSequentialGroup()
161 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
163 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
165 .addComponent(
jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE))
183 if (SwingUtilities.isRightMouseButton(evt)) {
184 JPopupMenu popup =
new JPopupMenu();
186 JMenuItem cutMenu =
new JMenuItem(
"Cut");
187 cutMenu.addActionListener(
new ActionListener() {
189 public void actionPerformed(ActionEvent e) {
194 JMenuItem copyMenu =
new JMenuItem(
"Copy");
195 copyMenu.addActionListener(
new ActionListener() {
197 public void actionPerformed(ActionEvent e) {
202 JMenuItem pasteMenu =
new JMenuItem(
"Paste");
203 pasteMenu.addActionListener(
new ActionListener() {
205 public void actionPerformed(ActionEvent e) {
213 popup.add(pasteMenu);
220 progressDialog.addHashValuesToDatabase();
void cancelButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JButton pasteFromClipboardButton
void hashValuesTextAreaMouseClicked(java.awt.event.MouseEvent evt)
void pasteFromClipboardButtonActionPerformed(java.awt.event.ActionEvent evt)
void AddValuesToHashDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JTextArea hashValuesTextArea
javax.swing.JButton AddValuesToHashDatabaseButton
javax.swing.JLabel instructionLabel
javax.swing.JScrollPane jScrollPane1
javax.swing.JButton cancelButton