Autopsy  4.6.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 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 
20 /*
21  * AdvancedConfigurationDialog.java
22  *
23  * Created on Feb 28, 2012, 4:47:31 PM
24  */
25 package org.sleuthkit.autopsy.corecomponents;
26 
27 import java.awt.Component;
28 import java.awt.Dimension;
29 import java.awt.Toolkit;
30 import java.awt.event.ActionListener;
31 import javax.swing.JFrame;
32 import javax.swing.JPanel;
33 import org.openide.windows.WindowManager;
34 
39 public class AdvancedConfigurationDialog extends javax.swing.JDialog {
40 
45  this(false);
46  }
47 
51  public AdvancedConfigurationDialog(boolean resizable) {
52  super((JFrame) WindowManager.getDefault().getMainWindow(), true);
53  setResizable(resizable);
54  if (resizable) {
55  this.setIconImage(null);
56  }
58  }
59 
60  public void display(JPanel panel) {
61  this.setTitle(panel.getName());
62 
63  panel.setAlignmentX(Component.CENTER_ALIGNMENT);
64  //applyButton.setAlignmentX(Component.CENTER_ALIGNMENT);
65  this.add(panel, 0);
66  this.pack();
67  this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
68  this.setVisible(true);
69  }
70 
76  @SuppressWarnings("unchecked")
77  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
78  private void initComponents() {
79 
80  jSeparator1 = new javax.swing.JSeparator();
81  filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4));
82  jPanel1 = new javax.swing.JPanel();
83  applyButton = new javax.swing.JButton();
84  cancelButton = new javax.swing.JButton();
85  filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4));
86 
87  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
88  getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.PAGE_AXIS));
89  getContentPane().add(jSeparator1);
90  getContentPane().add(filler1);
91 
92  jPanel1.setMaximumSize(new java.awt.Dimension(4000, 27));
93  jPanel1.setMinimumSize(new java.awt.Dimension(100, 27));
94  jPanel1.setPreferredSize(new java.awt.Dimension(400, 27));
95 
96  applyButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.applyButton.text")); // NOI18N
97 
98  cancelButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.cancelButton.text")); // NOI18N
99  cancelButton.addActionListener(new java.awt.event.ActionListener() {
100  public void actionPerformed(java.awt.event.ActionEvent evt) {
102  }
103  });
104 
105  javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
106  jPanel1.setLayout(jPanel1Layout);
107  jPanel1Layout.setHorizontalGroup(
108  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
109  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
110  .addContainerGap(242, Short.MAX_VALUE)
111  .addComponent(applyButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
112  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
113  .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
114  .addGap(12, 12, 12))
115  );
116  jPanel1Layout.setVerticalGroup(
117  jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
118  .addGroup(jPanel1Layout.createSequentialGroup()
119  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
120  .addComponent(applyButton)
121  .addComponent(cancelButton))
122  .addGap(0, 4, Short.MAX_VALUE))
123  );
124 
125  getContentPane().add(jPanel1);
126  getContentPane().add(filler2);
127 
128  pack();
129  }// </editor-fold>//GEN-END:initComponents
130 
131  private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
132  close();
133  }//GEN-LAST:event_cancelButtonActionPerformed
134 
135  // Variables declaration - do not modify//GEN-BEGIN:variables
136  private javax.swing.JButton applyButton;
137  private javax.swing.JButton cancelButton;
138  private javax.swing.Box.Filler filler1;
139  private javax.swing.Box.Filler filler2;
140  private javax.swing.JPanel jPanel1;
141  private javax.swing.JSeparator jSeparator1;
142  // End of variables declaration//GEN-END:variables
143 
144  public void addApplyButtonListener(ActionListener l) {
145  this.applyButton.addActionListener(l);
146  }
147 
148  public void close() {
149  dispose();
150  }
151 }

Copyright © 2012-2016 Basis Technology. Generated on: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.