Autopsy  4.14.0
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 
74  jSeparator1 = new javax.swing.JSeparator();
75  filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4));
76  jPanel1 = new javax.swing.JPanel();
77  applyButton = new javax.swing.JButton();
78  cancelButton = new javax.swing.JButton();
79  filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4));
80 
81  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
82  getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.PAGE_AXIS));
83  getContentPane().add(jSeparator1);
84  getContentPane().add(filler1);
85 
86  jPanel1.setMaximumSize(new java.awt.Dimension(4000, 27));
87  jPanel1.setMinimumSize(new java.awt.Dimension(100, 27));
88  jPanel1.setPreferredSize(new java.awt.Dimension(400, 27));
89 
90  applyButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.applyButton.text")); // NOI18N
91 
92  cancelButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.cancelButton.text")); // NOI18N
93  cancelButton.addActionListener(new java.awt.event.ActionListener() {
94  public void actionPerformed(java.awt.event.ActionEvent evt) {
95  cancelButtonActionPerformed(evt);
96  }
97  });
98 
99  javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
100  jPanel1.setLayout(jPanel1Layout);
101  jPanel1Layout.setHorizontalGroup(
102  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
103  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
104  .addContainerGap(242, Short.MAX_VALUE)
105  .addComponent(applyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
106  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
107  .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
108  .addGap(12, 12, 12))
109  );
110  jPanel1Layout.setVerticalGroup(
111  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
112  .addGroup(jPanel1Layout.createSequentialGroup()
113  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
114  .addComponent(applyButton)
115  .addComponent(cancelButton))
116  .addGap(0, 4, Short.MAX_VALUE))
117  );
118 
119  getContentPane().add(jPanel1);
120  getContentPane().add(filler2);
121 
122  pack();
123  }// </editor-fold>//GEN-END:initComponents
124 
125  private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
126  close();
127  }//GEN-LAST:event_cancelButtonActionPerformed
128 
129  // Variables declaration - do not modify//GEN-BEGIN:variables
130  private javax.swing.JButton applyButton;
131  private javax.swing.JButton cancelButton;
132  private javax.swing.Box.Filler filler1;
133  private javax.swing.Box.Filler filler2;
134  private javax.swing.JPanel jPanel1;
135  private javax.swing.JSeparator jSeparator1;
136  // End of variables declaration//GEN-END:variables
137 
138  public void addApplyButtonListener(ActionListener l) {
139  this.applyButton.addActionListener(l);
140  }
141 
142  public void close() {
143  dispose();
144  }
145 }

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