From 17fb03228f2fee0369a03b82d9bec86e80e71bf5 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 30 Nov 2005 15:07:09 +0000 Subject: [PATCH] Parse id before showing uniprot link --- src/jalview/appletgui/APopupMenu.java | 6 +++++- src/jalview/appletgui/IdPanel.java | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 0435d25..8488dd8 100755 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -97,8 +97,12 @@ public class APopupMenu link = links.elementAt(i).toString(); final String target = link.substring(0, link.indexOf("|")); item = new MenuItem(target); + String id = seq.getName(); + if(id.indexOf("|")>-1) + id = id.substring(id.lastIndexOf("|")+1); + final String url = link.substring(link.indexOf("|")+1, link.indexOf("$SEQUENCE_ID$")) - + seq.getName() + + + id + link.substring(link.indexOf("$SEQUENCE_ID$") + 13); item.addActionListener(new java.awt.event.ActionListener() diff --git a/src/jalview/appletgui/IdPanel.java b/src/jalview/appletgui/IdPanel.java index 82fc507..d159a4c 100755 --- a/src/jalview/appletgui/IdPanel.java +++ b/src/jalview/appletgui/IdPanel.java @@ -116,6 +116,8 @@ public class IdPanel //DEFAULT LINK IS FIRST IN THE LINK LIST int seq = av.getIndex(y); String id = av.getAlignment().getSequenceAt(seq).getName(); + if (id.indexOf("|") > -1) + id = id.substring(id.lastIndexOf("|") + 1); String target = links.elementAt(0).toString(); target = target.substring(0, target.indexOf("|")); -- 1.7.10.2