From 7b418369bddc2241a4e9067fb50ed63c20a0cadb Mon Sep 17 00:00:00 2001 From: "Samuel H. Kenyon" Date: Fri, 23 Aug 2013 16:39:59 -0400 Subject: [PATCH] CueBannerPanel (the startup panel) now takes an image path in its constructor, which is useful for NB modules that want to change the logo. --- .../autopsy/casemodule/CueBannerPanel.java | 16 +++++++++++++--- .../autopsy/casemodule/StartupWindow.java | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java index 501b1f488e..d28c040669 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java @@ -24,6 +24,7 @@ import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import javax.swing.ImageIcon; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JPanel; @@ -45,9 +46,18 @@ public class CueBannerPanel extends javax.swing.JPanel { private static JPanel caller = new JPanel(); private String className = this.getClass().toString(); - /** Creates new form CueBannerPanel */ - public CueBannerPanel() { + /** Creates new form CueBannerPanel + * + * @param welcomeLogo Java-centric path to an image file, e.g. "/org/sleuthkit/autopsy/casemodule/welcome_logo.png". + */ + public CueBannerPanel(String welcomeLogo) { initComponents(); + ImageIcon icon = null; + ClassLoader cl = Lookup.getDefault().lookup(ClassLoader.class); + if (cl != null) { + icon = new ImageIcon(cl.getResource(welcomeLogo)); + } + autopsyLogo.setIcon(icon); //if null then no icon will be shown } /** This method is called from within the constructor to @@ -254,7 +264,7 @@ public class CueBannerPanel extends javax.swing.JPanel { */ public void setCloseButtonText(String text) { closeButton.setText(text); - } + } /** * Close the open recent cases window. diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java index 8d477b18fa..f6f9f540bd 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java @@ -58,8 +58,8 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa // set the location of the popUp Window on the center of the screen setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); - - CueBannerPanel welcomeWindow = new CueBannerPanel(); + + CueBannerPanel welcomeWindow = new CueBannerPanel("/org/sleuthkit/autopsy/casemodule/welcome_logo.png"); // add the command to close the window to the button on the Volume Detail Panel welcomeWindow.setCloseButtonActionListener(new ActionListener() {