Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
StartupWindow.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.casemodule;
20 
21 import java.awt.Dimension;
22 import java.awt.Toolkit;
23 import java.awt.event.ActionEvent;
24 import java.awt.event.ActionListener;
25 import javax.swing.JDialog;
26 import javax.swing.JFrame;
27 
28 import org.openide.util.NbBundle;
29 import org.openide.util.lookup.ServiceProvider;
30 import org.openide.windows.WindowManager;
31 
35 @ServiceProvider(service = StartupWindowInterface.class)
36 public final class StartupWindow extends JDialog implements StartupWindowInterface {
37 
38  private static StartupWindow instance;
39  private static final String TITLE = NbBundle.getMessage(StartupWindow.class, "StartupWindow.title.text");
40  private static Dimension DIMENSIONS = new Dimension(750, 400);
41  private static CueBannerPanel welcomeWindow;
42 
43  public StartupWindow() {
44  super(WindowManager.getDefault().getMainWindow(), TITLE, true);
45  init();
46  }
47 
51  private void init() {
52 
53  Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
54 
55  // set the popUp window / JFrame
56  setSize(DIMENSIONS);
57  int w = this.getSize().width;
58  int h = this.getSize().height;
59 
60  // set the location of the popUp Window on the center of the screen
61  setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
62  setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
63 
64  welcomeWindow = new CueBannerPanel();
65 
66  // add the command to close the window to the button on the Volume Detail Panel
67  welcomeWindow.setCloseButtonActionListener(new ActionListener() {
68 
69  @Override
70  public void actionPerformed(ActionEvent e) {
71  close();
72  }
73  });
74 
75  add(welcomeWindow);
76  pack();
77  setResizable(false);
78 
79  }
80 
81  @Override
82  public void open() {
83  welcomeWindow.refresh();
84  setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
85  setVisible(true);
86  }
87 
91  @Override
92  public void close() {
93  this.setVisible(false);
94  }
95 }

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