- if (mouseDown == true) {\r
- if (seq < lastid) {\r
- selectSeqs(lastid-1,seq);\r
- } else if (seq > lastid) {\r
- selectSeqs(lastid+1,seq);\r
+ java.util.Vector links = Preferences.sequenceURLLinks;\r
+ if (links == null || links.size() < 1)\r
+ return;\r
+\r
+ int y = e.getY();\r
+\r
+ if (av.getWrapAlignment())\r
+ {\r
+ y = getWrappedY(y);\r
+ }\r
+\r
+ //DEFAULT LINK IS FIRST IN THE LINK LIST\r
+ int seq = av.getIndex(y);\r
+ if(seq==-1)\r
+ return;\r
+\r
+ String id = av.getAlignment().getSequenceAt(seq).getName();\r
+ if (id.indexOf("|") > -1)\r
+ id = id.substring(id.lastIndexOf("|") + 1);\r
+\r
+\r
+ String url = links.elementAt(0).toString();\r
+ url = url.substring(url.indexOf("|")+1);\r
+\r
+ int index = url.indexOf("$SEQUENCE_ID$");\r
+ url = url.substring(0, index)+ id + url.substring(index+13);\r
+\r
+ try\r
+ {\r
+ jalview.util.BrowserLauncher.openURL(url);\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+ "Unixers: Couldn't find default web browser."\r
+ +"\nAdd the full path to your browser in Preferences.",\r
+ "Web browser not found", JOptionPane.WARNING_MESSAGE );\r
+ ex.printStackTrace();\r