X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FUrlLink.java;h=00e33b2a83c4beac3ff58895c28b32075635cf3d;hb=f5a2fd32ad34d909ba7326ab40c1709cf00bdf32;hp=21dee381bcacf40b1c04a0e8297ea86379b21021;hpb=0ef6205b5b4caef00329b34d9ad118804e5b29be;p=jalview.git diff --git a/src/jalview/util/UrlLink.java b/src/jalview/util/UrlLink.java index 21dee38..00e33b2 100644 --- a/src/jalview/util/UrlLink.java +++ b/src/jalview/util/UrlLink.java @@ -1,3 +1,21 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) + * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ package jalview.util; import java.util.Vector; @@ -11,6 +29,7 @@ public class UrlLink * strings and replace the result in the URL. Regex's operate on the whole ID * string given to the matchURL method, if no regex is supplied, then only * text following the first pipe symbol will be susbstituted. + * Usage documentation todo. */ private String url_suffix, url_prefix, target, label, regexReplace; @@ -99,7 +118,7 @@ public class UrlLink label = link.substring(0, sep = link.lastIndexOf("|")); url_prefix = link.substring(sep + 1); regexReplace = null; // implies we trim any prefix if necessary // - // regexReplace=".*\\|?(.*)"; + // regexReplace=".*\\|?(.*)"; url_suffix = null; } } @@ -153,8 +172,8 @@ public class UrlLink } /** - * - * @return true if URL string could not be parsed properly. + * Check if URL string was parsed properly. + * @return boolean - if false then getInvalidMessage returns an error message */ public boolean isValid() { @@ -326,7 +345,7 @@ public class UrlLink * //"123123312", "123123 ABCDE foo", "PFAM:PF23943", */ "Label:gi|9234|pdb|102L|A" }; - + // TODO: test the setLabel method. for (int i = 0; i < links.length; i++) { UrlLink ul = new UrlLink(links[i]); @@ -366,4 +385,9 @@ public class UrlLink // TODO Auto-generated method stub return dynamic; } + + public void setLabel(String newlabel) + { + this.label = newlabel; + } }