mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Initial commit.
This commit is contained in:
parent
93b340624d
commit
d2daaca060
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
* Copyright 2011-2018 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -19,6 +19,10 @@
|
|||||||
package org.sleuthkit.autopsy.casemodule;
|
package org.sleuthkit.autopsy.casemodule;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
import java.awt.DisplayMode;
|
||||||
|
import java.awt.Frame;
|
||||||
|
import java.awt.GraphicsDevice;
|
||||||
|
import java.awt.GraphicsEnvironment;
|
||||||
import java.awt.Toolkit;
|
import java.awt.Toolkit;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
@ -52,7 +56,8 @@ final class CasePropertiesAction extends CallableSystemAction {
|
|||||||
public void performAction() {
|
public void performAction() {
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
String title = NbBundle.getMessage(this.getClass(), "CasePropertiesAction.window.title");
|
String title = NbBundle.getMessage(this.getClass(), "CasePropertiesAction.window.title");
|
||||||
casePropertiesDialog = new JDialog(WindowManager.getDefault().getMainWindow(), title, true);
|
Frame mainWindow = WindowManager.getDefault().getMainWindow();
|
||||||
|
casePropertiesDialog = new JDialog(mainWindow, title, true);
|
||||||
CaseInformationPanel caseInformationPanel = new CaseInformationPanel();
|
CaseInformationPanel caseInformationPanel = new CaseInformationPanel();
|
||||||
caseInformationPanel.addCloseButtonAction((ActionEvent e) -> {
|
caseInformationPanel.addCloseButtonAction((ActionEvent e) -> {
|
||||||
casePropertiesDialog.setVisible(false);
|
casePropertiesDialog.setVisible(false);
|
||||||
@ -61,10 +66,11 @@ final class CasePropertiesAction extends CallableSystemAction {
|
|||||||
casePropertiesDialog.setResizable(true);
|
casePropertiesDialog.setResizable(true);
|
||||||
casePropertiesDialog.pack();
|
casePropertiesDialog.pack();
|
||||||
|
|
||||||
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
|
int posX = (int) ((mainWindow.getX() + ((mainWindow.getWidth() - casePropertiesDialog.getSize().getWidth()) / 2)));
|
||||||
double w = casePropertiesDialog.getSize().getWidth();
|
int posY = (int) ((mainWindow.getY() + ((mainWindow.getHeight() - casePropertiesDialog.getSize().getHeight()) / 2)));
|
||||||
double h = casePropertiesDialog.getSize().getHeight();
|
casePropertiesDialog.setLocation(posX, posY);
|
||||||
casePropertiesDialog.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
|
|
||||||
|
casePropertiesDialog.setLocation(posX, posY);
|
||||||
casePropertiesDialog.setVisible(true);
|
casePropertiesDialog.setVisible(true);
|
||||||
casePropertiesDialog.toFront();
|
casePropertiesDialog.toFront();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user