19 package org.sleuthkit.autopsy.casemodule;
21 import java.awt.Cursor;
22 import java.awt.Dialog;
23 import java.awt.Dimension;
24 import java.awt.event.ActionEvent;
25 import java.awt.event.ActionListener;
26 import java.awt.event.KeyEvent;
27 import javax.swing.ImageIcon;
28 import javax.swing.JComponent;
29 import javax.swing.JDialog;
30 import javax.swing.KeyStroke;
31 import org.openide.util.Lookup;
32 import org.openide.util.NbBundle;
33 import org.openide.windows.WindowManager;
48 if (null != recentCasesWindow) {
49 recentCasesWindow.setVisible(
false);
61 ClassLoader cl = Lookup.getDefault().lookup(ClassLoader.class);
63 ImageIcon icon =
new ImageIcon(cl.getResource(welcomeLogo));
83 recentCasesWindow =
new JDialog(
84 WindowManager.getDefault().getMainWindow(),
85 NbBundle.getMessage(
CueBannerPanel.class,
"CueBannerPanel.title.text"),
86 Dialog.ModalityType.APPLICATION_MODAL);
87 recentCasesWindow.setSize(
new Dimension(750, 400));
88 recentCasesWindow.getRootPane().registerKeyboardAction(
90 recentCasesWindow.setVisible(
false);
92 KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
93 OpenRecentCasePanel recentCasesPanel = OpenRecentCasePanel.getInstance();
94 recentCasesPanel.setCloseButtonActionListener(
new ActionListener() {
96 public void actionPerformed(ActionEvent e) {
97 recentCasesWindow.setVisible(
false);
100 recentCasesWindow.add(recentCasesPanel);
101 recentCasesWindow.pack();
102 recentCasesWindow.setResizable(
false);
106 boolean enableOpenRecentCaseButton = (RecentCases.getInstance().getTotalRecentCases() > 0);
116 @SuppressWarnings(
"unchecked")
131 autopsyLogo.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/welcome_logo.png")));
134 newCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_create_new_case.png")));
139 newCaseButton.setPreferredSize(
new java.awt.Dimension(64, 64));
140 newCaseButton.addActionListener(
new java.awt.event.ActionListener() {
141 public void actionPerformed(java.awt.event.ActionEvent evt) {
146 openRecentCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_open_recent.png")));
153 public void actionPerformed(java.awt.event.ActionEvent evt) {
164 openCaseButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/casemodule/btn_icon_open_existing.png")));
171 openCaseButton.addActionListener(
new java.awt.event.ActionListener() {
172 public void actionPerformed(java.awt.event.ActionEvent evt) {
183 jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
185 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
186 this.setLayout(layout);
187 layout.setHorizontalGroup(
188 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
189 .addGroup(layout.createSequentialGroup()
192 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
193 .addComponent(
jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)
194 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
195 .addGroup(layout.createSequentialGroup()
196 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
197 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
198 .addComponent(
newCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
199 .addComponent(
openRecentCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
200 .addComponent(
openCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
201 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
202 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
207 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
208 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 139, Short.MAX_VALUE)
209 .addComponent(
closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
210 .addContainerGap())))
212 layout.setVerticalGroup(
213 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
214 .addGroup(layout.createSequentialGroup()
216 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
217 .addComponent(
autopsyLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)
218 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
219 .addGroup(layout.createSequentialGroup()
220 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
221 .addComponent(
newCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
223 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
224 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
225 .addComponent(
openRecentCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
227 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
228 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
229 .addComponent(
openCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
231 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
233 .addComponent(
jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)))
234 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
243 setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
244 Lookup.getDefault().lookup(
CaseOpenAction.class).actionPerformed(evt);
249 recentCasesWindow.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
250 OpenRecentCasePanel.getInstance();
251 recentCasesWindow.setVisible(
true);
javax.swing.JButton closeButton
void openRecentCaseButtonActionPerformed(java.awt.event.ActionEvent evt)
void setCloseButtonActionListener(ActionListener e)
javax.swing.JButton openRecentCaseButton
javax.swing.JLabel newCaseLabel
javax.swing.JLabel autopsyLogo
javax.swing.JButton newCaseButton
static void closeOpenRecentCasesWindow()
javax.swing.JLabel openRecentCaseLabel
void newCaseButtonActionPerformed(java.awt.event.ActionEvent evt)
void setCloseButtonText(String text)
static JDialog recentCasesWindow
void initRecentCasesWindow()
javax.swing.JLabel openCaseLabel
CueBannerPanel(String welcomeLogo)
void openCaseButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JSeparator jSeparator1
static final long serialVersionUID
javax.swing.JButton openCaseButton