From: amwaterhouse Date: Wed, 30 Nov 2005 15:07:09 +0000 (+0000) Subject: Parse id before showing uniprot link X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=17fb03228f2fee0369a03b82d9bec86e80e71bf5;p=jalview.git Parse id before showing uniprot link --- 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("|"));