20 package org.sleuthkit.autopsy.casemodule;
23 import java.awt.Dialog;
24 import java.awt.Dimension;
25 import java.awt.Toolkit;
26 import java.awt.event.ActionEvent;
27 import java.awt.event.ActionListener;
28 import javax.swing.ImageIcon;
29 import javax.swing.JDialog;
30 import javax.swing.JFrame;
31 import javax.swing.JPanel;
32 import org.openide.util.Lookup;
33 import org.openide.util.NbBundle;
40 final private static String
title = NbBundle.getMessage(
CueBannerPanel.class,
"CueBannerPanel.title.text");
41 final private static JFrame
frame =
new JFrame(title);
42 final static JDialog recentCasesWindow =
new JDialog(frame, title,
true);
45 private static JPanel
caller =
new JPanel();
46 private String
className = this.getClass().toString();
55 ClassLoader cl = Lookup.getDefault().lookup(ClassLoader.class);
57 ImageIcon icon =
new ImageIcon(cl.getResource(welcomeLogo));
67 @SuppressWarnings(
"unchecked")
82 autopsyLogo.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/welcome_logo.png")));
85 newCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_create_new_case.png")));
90 newCaseButton.setPreferredSize(
new java.awt.Dimension(64, 64));
91 newCaseButton.addActionListener(
new java.awt.event.ActionListener() {
92 public void actionPerformed(java.awt.event.ActionEvent evt) {
97 openRecentButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_open_recent.png")));
104 public void actionPerformed(java.awt.event.ActionEvent evt) {
115 openCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_open_existing.png")));
122 openCaseButton.addActionListener(
new java.awt.event.ActionListener() {
123 public void actionPerformed(java.awt.event.ActionEvent evt) {
128 openLabel.setFont(
new java.awt.Font(
"Tahoma", 0, 13));
133 jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
135 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
136 this.setLayout(layout);
137 layout.setHorizontalGroup(
138 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
139 .addGroup(layout.createSequentialGroup()
142 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
143 .addComponent(
jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)
144 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
145 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
146 .addComponent(
newCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
147 .addComponent(
openRecentButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
148 .addComponent(
openCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
149 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
150 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
151 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
155 .addComponent(
closeButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
158 layout.setVerticalGroup(
159 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
160 .addGroup(layout.createSequentialGroup()
162 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
163 .addGroup(layout.createSequentialGroup()
164 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
165 .addComponent(
newCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
167 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
168 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
169 .addComponent(
openRecentButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
171 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
172 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
173 .addComponent(
openCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
175 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
178 .addComponent(
autopsyLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
184 if (RecentCases.getInstance().getTotalRecentCases() == 0) {
197 Lookup.getDefault().lookup(
CaseOpenAction.class).actionPerformed(evt);
203 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
206 recentCasesWindow.setSize(750, 400);
208 int w = recentCasesWindow.getSize().width;
209 int h = recentCasesWindow.getSize().height;
212 recentCasesWindow.setLocation((screenDimension.width - w)/2, (screenDimension.height - h)/2);
214 OpenRecentCasePanel welcomeWindow = OpenRecentCasePanel.getInstance();
217 welcomeWindow.setCloseButtonActionListener(
new ActionListener(){
219 public void actionPerformed(ActionEvent e){
220 recentCasesWindow.dispose();
224 recentCasesWindow.add(welcomeWindow);
225 recentCasesWindow.pack();
226 recentCasesWindow.setResizable(
false);
227 recentCasesWindow.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
228 recentCasesWindow.setVisible(
true);
267 recentCasesWindow.dispose();
final static String title
javax.swing.JButton closeButton
void setCloseButtonActionListener(ActionListener e)
javax.swing.JLabel autopsyLogo
javax.swing.JLabel openLabel
javax.swing.JButton newCaseButton
static void closeOpenRecentCasesWindow()
void openRecentButtonActionPerformed(java.awt.event.ActionEvent evt)
void newCaseButtonActionPerformed(java.awt.event.ActionEvent evt)
void setCloseButtonText(String text)
javax.swing.JLabel openRecentLabel
javax.swing.JLabel createNewLabel
final static JFrame frame
CueBannerPanel(String welcomeLogo)
void openCaseButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JSeparator jSeparator1
javax.swing.JButton openRecentButton
javax.swing.JButton openCaseButton