19 package org.sleuthkit.autopsy.casemodule;
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
24 import java.awt.event.KeyEvent;
25 import javax.swing.ImageIcon;
26 import javax.swing.JComponent;
27 import javax.swing.JDialog;
28 import javax.swing.JFrame;
29 import javax.swing.JPanel;
30 import javax.swing.KeyStroke;
31 import org.openide.util.Lookup;
32 import org.openide.util.NbBundle;
39 final private static String
title = NbBundle.getMessage(
CueBannerPanel.class,
"CueBannerPanel.title.text");
40 final private static JFrame
frame =
new JFrame(title);
41 final static JDialog recentCasesWindow =
new JDialog(frame, title,
true);
44 private static JPanel
caller =
new JPanel();
53 ClassLoader cl = Lookup.getDefault().lookup(ClassLoader.class);
55 ImageIcon icon =
new ImageIcon(cl.getResource(welcomeLogo));
66 @SuppressWarnings(
"unchecked")
81 autopsyLogo.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/welcome_logo.png")));
84 newCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_create_new_case.png")));
89 newCaseButton.setPreferredSize(
new java.awt.Dimension(64, 64));
90 newCaseButton.addActionListener(
new java.awt.event.ActionListener() {
91 public void actionPerformed(java.awt.event.ActionEvent evt) {
96 openRecentButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_open_recent.png")));
103 public void actionPerformed(java.awt.event.ActionEvent evt) {
114 openCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_open_existing.png")));
121 openCaseButton.addActionListener(
new java.awt.event.ActionListener() {
122 public void actionPerformed(java.awt.event.ActionEvent evt) {
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);
213 recentCasesWindow.setLocationRelativeTo(
this);
214 recentCasesWindow.getRootPane().registerKeyboardAction(e -> {
215 recentCasesWindow.dispose();
216 }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
218 OpenRecentCasePanel welcomeWindow = OpenRecentCasePanel.getInstance();
221 welcomeWindow.setCloseButtonActionListener(
new ActionListener() {
223 public void actionPerformed(ActionEvent e) {
224 recentCasesWindow.dispose();
228 recentCasesWindow.add(welcomeWindow);
229 recentCasesWindow.pack();
230 recentCasesWindow.setResizable(
false);
231 recentCasesWindow.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
232 recentCasesWindow.setVisible(
true);
270 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