From 5bff0a3288bd2b5e1f1030c6e47430735cd09463 Mon Sep 17 00:00:00 2001 From: clemenso Date: Thu, 9 Jul 2009 16:34:07 +0000 Subject: [#393] loading of default background fails git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@407 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUApplet.java | 4 +-- .../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 2 +- .../main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java | 31 +++++---------------- .../resources/images/BackgroundChipperling.png | Bin 2041 -> 0 bytes .../src/main/resources/images/BackgroundMocca.png | Bin 1287 -> 0 bytes .../main/resources/images/ChipperlingCutoff.png | Bin 0 -> 1522 bytes .../src/main/resources/images/help_orig.png | Bin 303 -> 0 bytes BKUOnline/src/main/webapp/applet.jsp | 4 ++- .../src/main/webapp/img/ChipperlingCutoff.png | Bin 0 -> 1522 bytes 9 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png delete mode 100644 BKUCommonGUI/src/main/resources/images/BackgroundMocca.png create mode 100644 BKUCommonGUI/src/main/resources/images/ChipperlingCutoff.png delete mode 100644 BKUCommonGUI/src/main/resources/images/help_orig.png create mode 100644 BKUOnline/src/main/webapp/img/ChipperlingCutoff.png diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java index 43bc2dae..95ac3553 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java @@ -116,7 +116,7 @@ public class BKUApplet extends JApplet { backgroundImgURL = getURLParameter(BACKGROUND_IMG, null); log.debug("setting background: " + backgroundImgURL); } catch (MalformedURLException ex) { - log.warn("failed to load applet background image: " + ex.getMessage() + ", using default"); + log.warn("cannot load applet background image: " + ex.getMessage()); } AbstractHelpListener helpListener = null; @@ -236,7 +236,7 @@ public class BKUApplet extends JApplet { protected URL getURLParameter(String paramKey, String sessionId) throws MalformedURLException { String urlParam = getParameter(paramKey); - if (urlParam != null) { + if (urlParam != null && !"".equals(urlParam)) { URL codebase = getCodeBase(); try { URL url; diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java index 79fbfd6c..06aad45f 100644 --- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java @@ -42,7 +42,7 @@ public interface BKUGUIFacade { public static final String ERR_CONFIG = "error.config"; public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages"; - public static final String DEFAULT_BACKGROUND = "/images/BackgroundChipperling.png"; + public static final String DEFAULT_BACKGROUND = "/images/ChipperlingCutoff.png"; public static final String DEFAULT_ICON = "/images/ChipperlingLogo.png"; public static final String HELP_IMG = "/images/help.png"; public static final String HASHDATA_FONT = "Monospaced"; diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java index 4cab29e0..16297218 100644 --- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java @@ -28,25 +28,15 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.text.MessageFormat; -import java.util.Collections; import java.util.List; import java.util.Locale; -import java.util.MissingResourceException; import java.util.ResourceBundle; import javax.swing.GroupLayout; import javax.swing.ImageIcon; import javax.swing.JButton; -import javax.swing.JFileChooser; import javax.swing.JLabel; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JScrollPane; @@ -153,10 +143,7 @@ public class BKUGUIImpl implements BKUGUIFacade { initIconPanel(background); initContentPanel(null); } else { - initContentPanel((background == null) ? - getClass().getResource(DEFAULT_BACKGROUND) : - background - ); + initContentPanel(background); } GroupLayout layout = new GroupLayout(contentPane); @@ -220,20 +207,16 @@ public class BKUGUIImpl implements BKUGUIFacade { protected void initContentPanel(URL background) { -// if (background == null) { -// background = getClass().getResource(DEFAULT_BACKGROUND); -// } if (background == null) { log.debug("no background image set"); +// contentPanel = new ImagePanel(getClass().getResource(DEFAULT_BACKGROUND)); + contentPanel = new JPanel(); + } else if ("file".equals(background.getProtocol())) { + log.warn("file:// background images not permitted: " + background); contentPanel = new JPanel(); } else { - if ("file".equals(background.getProtocol())) { - log.warn("file:// background images not permitted: " + background + - ", loading default background"); - background = getClass().getResource(DEFAULT_BACKGROUND); - } - log.debug("loading background " + background); - contentPanel = new ImagePanel(background); + log.debug("loading background " + background); + contentPanel = new ImagePanel(background); } mainPanel = new JPanel(); mainPanel.setOpaque(false); diff --git a/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png b/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png deleted file mode 100644 index 5097aa6b..00000000 Binary files a/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png and /dev/null differ diff --git a/BKUCommonGUI/src/main/resources/images/BackgroundMocca.png b/BKUCommonGUI/src/main/resources/images/BackgroundMocca.png deleted file mode 100644 index 349d9ff0..00000000 Binary files a/BKUCommonGUI/src/main/resources/images/BackgroundMocca.png and /dev/null differ diff --git a/BKUCommonGUI/src/main/resources/images/ChipperlingCutoff.png b/BKUCommonGUI/src/main/resources/images/ChipperlingCutoff.png new file mode 100644 index 00000000..337b144b Binary files /dev/null and b/BKUCommonGUI/src/main/resources/images/ChipperlingCutoff.png differ diff --git a/BKUCommonGUI/src/main/resources/images/help_orig.png b/BKUCommonGUI/src/main/resources/images/help_orig.png deleted file mode 100644 index 5d6da3bf..00000000 Binary files a/BKUCommonGUI/src/main/resources/images/help_orig.png and /dev/null differ diff --git a/BKUOnline/src/main/webapp/applet.jsp b/BKUOnline/src/main/webapp/applet.jsp index 0d8dc8b8..5564df2e 100644 --- a/BKUOnline/src/main/webapp/applet.jsp +++ b/BKUOnline/src/main/webapp/applet.jsp @@ -36,7 +36,9 @@ : (Integer) session.getAttribute("appletWidth"); int height = session.getAttribute("appletHeight") == null ? 130 : (Integer) session.getAttribute("appletHeight"); - String backgroundImg = (String) session.getAttribute("appletBackground"); + String backgroundImg = session.getAttribute("appletBackground") == null + ? "../img/ChipperlingCutoff.png" + : (String) session.getAttribute("appletBackground"); String guiStyle = (String) session.getAttribute("appletGuiStyle"); String locale = (String) session.getAttribute("locale"); String extension = (String) session.getAttribute("extension"); diff --git a/BKUOnline/src/main/webapp/img/ChipperlingCutoff.png b/BKUOnline/src/main/webapp/img/ChipperlingCutoff.png new file mode 100644 index 00000000..337b144b Binary files /dev/null and b/BKUOnline/src/main/webapp/img/ChipperlingCutoff.png differ -- cgit v1.2.3