From 7897c6cb08b496285bcb5fa9ed2d9f7d887d0068 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 4 Sep 2008 12:58:50 +0000 Subject: [PATCH] quickfix for applet when opening relative URLs from feature file : https://mantis.lifesci.dundee.ac.uk/view.php?id=37023 --- src/jalview/appletgui/AlignFrame.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 13c40ef..3e214b8 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -2374,7 +2374,20 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { try { - System.out.println("Show url: " + url); + if (url.indexOf(":")==-1) + { + // TODO: verify (Bas Vroling bug) prepend codebase or server URL to form valid URL + if (url.indexOf("/")==0) + { + String codebase = viewport.applet.getCodeBase().toString(); + url = codebase.substring(0,codebase.length()-viewport.applet.getCodeBase().getFile().length())+url; + } else { + url = viewport.applet.getCodeBase()+url; + } + System.out.println("Show url (prepended codebase): " + url); + } else { + System.out.println("Show url: " + url); + } viewport.applet.getAppletContext().showDocument( new java.net.URL(url), target); } catch (Exception ex) -- 1.7.10.2