Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
AdvancedConfigurationDialog.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 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.corecomponents;
20 
21 import java.awt.Component;
22 import java.awt.event.ActionListener;
23 import javax.swing.JFrame;
24 import javax.swing.JPanel;
25 import org.openide.windows.WindowManager;
26 
30 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
31 public class AdvancedConfigurationDialog extends javax.swing.JDialog {
32 
37  this(false);
38  }
39 
45  public AdvancedConfigurationDialog(boolean resizable) {
46  super((JFrame) WindowManager.getDefault().getMainWindow(), true);
47  setResizable(resizable);
48  if (resizable) {
49  this.setIconImage(null);
50  }
51  initComponents();
52  }
53 
54  public void display(JPanel panel) {
55  this.setTitle(panel.getName());
56 
57  panel.setAlignmentX(Component.CENTER_ALIGNMENT);
58  //applyButton.setAlignmentX(Component.CENTER_ALIGNMENT);
59  this.add(panel, 0);
60  this.pack();
61  this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
62  this.setVisible(true);
63  }
64 
70  @SuppressWarnings("unchecked")
71  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
72  private void initComponents() {
73  java.awt.GridBagConstraints gridBagConstraints;
74 
75  jSeparator1 = new javax.swing.JSeparator();
76  filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4));
77  jPanel1 = new javax.swing.JPanel();
78  applyButton = new javax.swing.JButton();
79  cancelButton = new javax.swing.JButton();
80  filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0));
81  filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4));
82 
83  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
84  getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.PAGE_AXIS));
85  getContentPane().add(jSeparator1);
86  getContentPane().add(filler1);
87 
88  jPanel1.setMaximumSize(new java.awt.Dimension(4000, 27));
89  jPanel1.setMinimumSize(new java.awt.Dimension(100, 27));
90  jPanel1.setPreferredSize(new java.awt.Dimension(400, 27));
91  jPanel1.setLayout(new java.awt.GridBagLayout());
92 
93  applyButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.applyButton.text")); // NOI18N
94  applyButton.setMaximumSize(new java.awt.Dimension(150, 25));
95  applyButton.setMinimumSize(new java.awt.Dimension(71, 25));
96  applyButton.setPreferredSize(new java.awt.Dimension(71, 25));
97  gridBagConstraints = new java.awt.GridBagConstraints();
98  gridBagConstraints.gridx = 1;
99  gridBagConstraints.gridy = 0;
100  gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
101  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
102  gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
103  jPanel1.add(applyButton, gridBagConstraints);
104 
105  cancelButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.cancelButton.text")); // NOI18N
106  cancelButton.setMaximumSize(new java.awt.Dimension(150, 25));
107  cancelButton.addActionListener(new java.awt.event.ActionListener() {
108  public void actionPerformed(java.awt.event.ActionEvent evt) {
109  cancelButtonActionPerformed(evt);
110  }
111  });
112  gridBagConstraints = new java.awt.GridBagConstraints();
113  gridBagConstraints.gridx = 2;
114  gridBagConstraints.gridy = 0;
115  gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
116  gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
117  gridBagConstraints.insets = new java.awt.Insets(0, 7, 2, 12);
118  jPanel1.add(cancelButton, gridBagConstraints);
119  gridBagConstraints = new java.awt.GridBagConstraints();
120  gridBagConstraints.gridx = 0;
121  gridBagConstraints.gridy = 0;
122  gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
123  gridBagConstraints.weightx = 1.0;
124  jPanel1.add(filler3, gridBagConstraints);
125 
126  getContentPane().add(jPanel1);
127  getContentPane().add(filler2);
128 
129  pack();
130  }// </editor-fold>//GEN-END:initComponents
131 
132  private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
133  close();
134  }//GEN-LAST:event_cancelButtonActionPerformed
135 
136  // Variables declaration - do not modify//GEN-BEGIN:variables
137  private javax.swing.JButton applyButton;
138  private javax.swing.JButton cancelButton;
139  private javax.swing.Box.Filler filler1;
140  private javax.swing.Box.Filler filler2;
141  private javax.swing.Box.Filler filler3;
142  private javax.swing.JPanel jPanel1;
143  private javax.swing.JSeparator jSeparator1;
144  // End of variables declaration//GEN-END:variables
145 
146  public void addApplyButtonListener(ActionListener l) {
147  this.applyButton.addActionListener(l);
148  }
149 
150  public void close() {
151  dispose();
152  }
153 }

Copyright © 2012-2022 Basis Technology. Generated on: Tue Jun 27 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.