19 package org.sleuthkit.autopsy.ingest;
21 import java.awt.BorderLayout;
22 import java.awt.Container;
23 import java.awt.Dialog;
24 import java.awt.Dimension;
25 import java.awt.Toolkit;
26 import java.awt.Window;
27 import java.awt.event.WindowAdapter;
28 import java.awt.event.WindowEvent;
29 import javax.swing.JDialog;
30 import org.openide.util.NbBundle;
31 import org.openide.windows.WindowManager;
39 private static final Dimension
DIMENSIONS =
new Dimension(500, 300);
45 this((Window) WindowManager.getDefault().getMainWindow(),
false);
55 super((Window) owner, TITLE, ModalityType.MODELESS);
56 if (shouldBeModal && owner instanceof JDialog) {
57 final JDialog pseudoOwner = (JDialog) owner;
58 addWindowListener(
new WindowAdapter() {
60 public void windowClosed(WindowEvent e) {
61 pseudoOwner.setVisible(
false);
62 pseudoOwner.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
63 pseudoOwner.toFront();
64 pseudoOwner.setVisible(
true);
67 pseudoOwner.setVisible(
false);
68 pseudoOwner.setModalityType(Dialog.ModalityType.MODELESS);
69 pseudoOwner.toFront();
70 pseudoOwner.repaint();
71 pseudoOwner.setVisible(
true);
74 setLayout(
new BorderLayout());
75 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
77 int w = this.getSize().width;
78 int h = this.getSize().height;
79 setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
static final Dimension DIMENSIONS
static final String TITLE
IngestProgressSnapshotDialog(Container owner, Boolean shouldBeModal)
IngestProgressSnapshotDialog()