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.Window;
26 import java.awt.event.KeyEvent;
27 import java.awt.event.WindowAdapter;
28 import java.awt.event.WindowEvent;
29 import javax.swing.JComponent;
30 import javax.swing.JDialog;
31 import javax.swing.KeyStroke;
32 import org.openide.util.NbBundle;
33 import org.openide.windows.WindowManager;
41 private static final Dimension
DIMENSIONS =
new Dimension(500, 300);
47 this((Window) WindowManager.getDefault().getMainWindow(),
false);
48 setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
59 super((Window) owner, TITLE, ModalityType.MODELESS);
60 if (shouldBeModal && owner instanceof JDialog) {
61 final JDialog pseudoOwner = (JDialog) owner;
62 final ModalityType originalModality = pseudoOwner.getModalityType();
63 addWindowListener(
new WindowAdapter() {
65 public void windowClosed(WindowEvent e) {
66 pseudoOwner.setVisible(
false);
67 pseudoOwner.setModalityType(originalModality);
68 pseudoOwner.toFront();
69 pseudoOwner.setVisible(
true);
72 pseudoOwner.setVisible(
false);
73 pseudoOwner.setModalityType(Dialog.ModalityType.MODELESS);
74 pseudoOwner.toFront();
75 pseudoOwner.repaint();
76 pseudoOwner.setVisible(
true);
79 setLayout(
new BorderLayout());
81 setLocationRelativeTo(owner);
82 this.getRootPane().registerKeyboardAction(e -> {
84 }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
static final Dimension DIMENSIONS
static final String TITLE
IngestProgressSnapshotDialog(Container owner, Boolean shouldBeModal)
IngestProgressSnapshotDialog()