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));
65 @SuppressWarnings(
"unchecked")
80 autopsyLogo.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/welcome_logo.png")));
83 newCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_create_new_case.png")));
88 newCaseButton.setPreferredSize(
new java.awt.Dimension(64, 64));
89 newCaseButton.addActionListener(
new java.awt.event.ActionListener() {
90 public void actionPerformed(java.awt.event.ActionEvent evt) {
95 openRecentButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_open_recent.png")));
102 public void actionPerformed(java.awt.event.ActionEvent evt) {
113 openCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_open_existing.png")));
120 openCaseButton.addActionListener(
new java.awt.event.ActionListener() {
121 public void actionPerformed(java.awt.event.ActionEvent evt) {
132 jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
134 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
135 this.setLayout(layout);
136 layout.setHorizontalGroup(
137 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
138 .addGroup(layout.createSequentialGroup()
141 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
142 .addComponent(
jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)
143 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
144 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
145 .addComponent(
newCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
146 .addComponent(
openRecentButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
147 .addComponent(
openCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
148 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
149 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
150 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
154 .addComponent(
closeButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
157 layout.setVerticalGroup(
158 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
159 .addGroup(layout.createSequentialGroup()
161 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
162 .addGroup(layout.createSequentialGroup()
163 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
164 .addComponent(
newCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
166 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
167 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
168 .addComponent(
openRecentButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
170 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
171 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
172 .addComponent(
openCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
174 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
177 .addComponent(
autopsyLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
183 if (RecentCases.getInstance().getTotalRecentCases() == 0) {
196 Lookup.getDefault().lookup(
CaseOpenAction.class).actionPerformed(evt);
202 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
205 recentCasesWindow.setSize(750, 400);
207 int w = recentCasesWindow.getSize().width;
208 int h = recentCasesWindow.getSize().height;
211 recentCasesWindow.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
212 recentCasesWindow.setLocationRelativeTo(
this);
213 recentCasesWindow.getRootPane().registerKeyboardAction(e -> {
214 recentCasesWindow.dispose();
215 }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
217 OpenRecentCasePanel welcomeWindow = OpenRecentCasePanel.getInstance();
220 welcomeWindow.setCloseButtonActionListener(
new ActionListener() {
222 public void actionPerformed(ActionEvent e) {
223 recentCasesWindow.dispose();
227 recentCasesWindow.add(welcomeWindow);
228 recentCasesWindow.pack();
229 recentCasesWindow.setResizable(
false);
230 recentCasesWindow.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
231 recentCasesWindow.setVisible(
true);
269 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