Autopsy  3.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 
20 
21 package org.sleuthkit.autopsy.casemodule;
22 
23 import java.awt.Dimension;
24 import java.awt.Toolkit;
25 import java.awt.event.ActionEvent;
26 import java.awt.event.ActionListener;
27 import javax.swing.JDialog;
28 import javax.swing.JFrame;
29 
30 import org.openide.util.NbBundle;
31 import org.openide.util.lookup.ServiceProvider;
32 import org.openide.windows.WindowManager;
33 
37 @ServiceProvider(service=StartupWindowInterface.class)
38 public final class StartupWindow extends JDialog implements StartupWindowInterface {
39 
40  private static StartupWindow instance;
41  private static final String TITLE = NbBundle.getMessage(StartupWindow.class, "StartupWindow.title.text");
42  private static Dimension DIMENSIONS = new Dimension(750, 400);
43  private static CueBannerPanel welcomeWindow;
44 
45  public StartupWindow() {
46  super(WindowManager.getDefault().getMainWindow(), TITLE, true);
47  init();
48  }
49 
50 
54  private void init() {
55 
56  Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
57 
58  // set the popUp window / JFrame
59  setSize(DIMENSIONS);
60  int w = this.getSize().width;
61  int h = this.getSize().height;
62 
63  // set the location of the popUp Window on the center of the screen
64  setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
65 
66  welcomeWindow = new CueBannerPanel();
67 
68  // add the command to close the window to the button on the Volume Detail Panel
69  welcomeWindow.setCloseButtonActionListener(new ActionListener() {
70 
71  @Override
72  public void actionPerformed(ActionEvent e) {
73  close();
74  }
75  });
76 
77  add(welcomeWindow);
78  pack();
79  setResizable(false);
80 
81  }
82 
83  @Override
84  public void open() {
85  welcomeWindow.refresh();
86  setVisible(true);
87  }
88 
92  @Override
93  public void close() {
94  this.setVisible(false);
95  }
96 }

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.