+/*\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
+ * \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
+ * \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
+ * \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
+ */\r
package jalview.util;\r
\r
import java.util.Vector;\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
*/\r
private String url_suffix, url_prefix, target, label, regexReplace;\r
\r
label = link.substring(0, sep = link.lastIndexOf("|"));\r
url_prefix = link.substring(sep + 1);\r
regexReplace = null; // implies we trim any prefix if necessary //\r
- // regexReplace=".*\\|?(.*)";\r
+ // regexReplace=".*\\|?(.*)";\r
url_suffix = null;\r
}\r
}\r
}\r
\r
/**\r
- * \r
- * @return true if URL string could not be parsed properly.\r
+ * Check if URL string was parsed properly.\r
+ * @return boolean - if false then <code>getInvalidMessage</code> returns an error message\r
*/\r
public boolean isValid()\r
{\r
* //"123123312", "123123 ABCDE foo", "PFAM:PF23943",\r
*/\r
"Label:gi|9234|pdb|102L|A" };\r
-\r
+ // TODO: test the setLabel method.\r
for (int i = 0; i < links.length; i++)\r
{\r
UrlLink ul = new UrlLink(links[i]);\r
// TODO Auto-generated method stub\r
return dynamic;\r
}\r
+\r
+ public void setLabel(String newlabel)\r
+ {\r
+ this.label = newlabel;\r
+ }\r
}\r