Autopsy  4.4
Graphical digital forensics platform for The Sleuth Kit and other tools.
AdvancedConfigurationCleanDialog.java
Go to the documentation of this file.
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5 package org.sleuthkit.autopsy.corecomponents;
6 
7 import java.awt.Component;
8 import java.awt.Dimension;
9 import java.awt.Toolkit;
10 import javax.swing.JFrame;
11 import javax.swing.JPanel;
12 import org.openide.windows.WindowManager;
13 
19 public class AdvancedConfigurationCleanDialog extends javax.swing.JDialog {
20 
25  this(false);
26  }
27 
31  public AdvancedConfigurationCleanDialog(boolean resizable) {
32  super((JFrame) WindowManager.getDefault().getMainWindow(), true);
33  setResizable(resizable);
34  if (resizable) {
35  this.setIconImage(null);
36  }
38  }
39 
45  public void display(JPanel panel) {
46  this.setTitle(panel.getName());
47 
48  panel.setAlignmentX(Component.CENTER_ALIGNMENT);
49  this.add(panel, 0);
50  this.pack();
51 
52  Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
53  // set the popUp window / JFrame
54  int w = this.getSize().width;
55  int h = this.getSize().height;
56 
57  // set the location of the popUp Window on the center of the screen
58  setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
59 
60  this.setVisible(true);
61  }
62 
66  public void close() {
67  this.dispose();
68  }
69 
75  @SuppressWarnings("unchecked")
76  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
77  private void initComponents() {
78 
79  setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
80  getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.LINE_AXIS));
81 
82  pack();
83  }// </editor-fold>//GEN-END:initComponents
84 
85  // Variables declaration - do not modify//GEN-BEGIN:variables
86  // End of variables declaration//GEN-END:variables
87 }

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