/*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)\r
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
+ * This file is part of Jalview.\r
* \r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
* \r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE. See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.\r
*/\r
package jalview.util;\r
\r
* Jalview 2.4 extension allows regular expressions to be used to parse ID\r
* strings and replace the result in the URL. Regex's operate on the whole ID\r
* string given to the matchURL method, if no regex is supplied, then only\r
- * text following the first pipe symbol will be susbstituted.\r
- * Usage documentation todo.\r
+ * text following the first pipe symbol will be susbstituted. Usage\r
+ * documentation todo.\r
*/\r
private String url_suffix, url_prefix, target, label, regexReplace;\r
\r
\r
/**\r
* Check if URL string was parsed properly.\r
- * @return boolean - if false then <code>getInvalidMessage</code> returns an error message\r
+ * \r
+ * @return boolean - if false then <code>getInvalidMessage</code> returns an\r
+ * error message\r
*/\r
public boolean isValid()\r
{\r
* return one or more URL strings by applying regex to the given idstring\r
* \r
* @param idstring\r
- * @param onlyIfMatches -\r
- * when true url strings are only made if regex is defined and\r
- * matches\r
+ * @param onlyIfMatches\r
+ * - when true url strings are only made if regex is defined and\r
+ * matches\r
* @return String[] { part of idstring substituted, full substituted url , ..\r
* next part, next url..}\r
*/\r
{ rg.stringMatched(),\r
url_prefix + rg.stringMatched() + url_suffix };\r
} /*\r
- * else if (ns==1) { // take only subgroup match return new String[] {\r
- * rg.stringMatched(1), url_prefix+rg.stringMatched(1)+url_suffix }; }\r
+ * else if (ns==1) { // take only subgroup match return new String[]\r
+ * { rg.stringMatched(1), url_prefix+rg.stringMatched(1)+url_suffix\r
+ * }; }\r
*/\r
else\r
{\r
/*\r
* "AlinkT|Target|http://foo.foo.soo/",\r
* "myUrl1|http://$SEQUENCE_ID=/[0-9]+/=$.someserver.org/foo",\r
- * "myUrl2|http://$SEQUENCE_ID=/(([0-9]+).+([A-Za-z]+))/=$.someserver.org/foo",\r
- * "myUrl3|http://$SEQUENCE_ID=/([0-9]+).+([A-Za-z]+)/=$.someserver.org/foo",\r
- * "myUrl4|target|http://$SEQUENCE_ID$.someserver.org/foo|too",\r
- * "PF1|http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID=/(?:PFAM:)?(.+)/=$",\r
- * "PF2|http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID=/(PFAM:)?(.+)/=$",\r
- * "PF3|http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID=/PFAM:(.+)/=$",\r
- * "NOTFER|http://notfer.org/$SEQUENCE_ID=/(?<!\\s)(.+)/=$",\r
+ * "myUrl2|http://$SEQUENCE_ID=/(([0-9]+).+([A-Za-z]+))/=$.someserver.org/foo"\r
+ * ,\r
+ * "myUrl3|http://$SEQUENCE_ID=/([0-9]+).+([A-Za-z]+)/=$.someserver.org/foo"\r
+ * , "myUrl4|target|http://$SEQUENCE_ID$.someserver.org/foo|too",\r
+ * "PF1|http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID=/(?:PFAM:)?(.+)/=$"\r
+ * ,\r
+ * "PF2|http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID=/(PFAM:)?(.+)/=$"\r
+ * ,\r
+ * "PF3|http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID=/PFAM:(.+)/=$"\r
+ * , "NOTFER|http://notfer.org/$SEQUENCE_ID=/(?<!\\s)(.+)/=$",\r
*/\r
"NESTED|http://nested/$SEQUENCE_ID=/^(?:Label:)?(?:(?:gi\\|(\\d+))|([^:]+))/=$/nested" };\r
String[] idstrings = new String[]\r