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;
38 @SuppressWarnings(
"PMD.SingularField")
42 private static final Dimension DIMENSIONS =
new Dimension(500, 300);
48 this((Window) WindowManager.getDefault().getMainWindow(),
false);
49 setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
62 super((Window) owner, TITLE, ModalityType.MODELESS);
63 if (shouldBeModal && owner instanceof JDialog) {
64 final JDialog pseudoOwner = (JDialog) owner;
65 final ModalityType originalModality = pseudoOwner.getModalityType();
66 addWindowListener(
new WindowAdapter() {
68 public void windowClosed(WindowEvent e) {
69 pseudoOwner.setVisible(
false);
70 pseudoOwner.setModalityType(originalModality);
71 pseudoOwner.toFront();
72 pseudoOwner.setVisible(
true);
75 pseudoOwner.setVisible(
false);
76 pseudoOwner.setModalityType(Dialog.ModalityType.MODELESS);
77 pseudoOwner.toFront();
78 pseudoOwner.repaint();
79 pseudoOwner.setVisible(
true);
82 setLayout(
new BorderLayout());
84 setLocationRelativeTo(owner);
85 this.getRootPane().registerKeyboardAction(e -> {
87 }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
88 add(
new IngestProgressSnapshotPanel(
this, provider));
static synchronized IngestManager getInstance()
IngestProgressSnapshotDialog(Container owner, Boolean shouldBeModal, IngestProgressSnapshotProvider provider)
IngestProgressSnapshotDialog(Container owner, Boolean shouldBeModal)
IngestProgressSnapshotDialog()