X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FDasSequenceFeatureFetcher.java;h=6b5abade4d6036c7ed33603cb6772ec87ed80815;hb=3ae7bdec3da96fd87abf72b4330440204132be2c;hp=8fc49b16de0033aa1d15fed024b15fb236a6de4d;hpb=9365a90059ec5d2f8ff094d9defcc021f63483d5;p=jalview.git diff --git a/src/jalview/ws/DasSequenceFeatureFetcher.java b/src/jalview/ws/DasSequenceFeatureFetcher.java index 8fc49b1..6b5abad 100644 --- a/src/jalview/ws/DasSequenceFeatureFetcher.java +++ b/src/jalview/ws/DasSequenceFeatureFetcher.java @@ -1,20 +1,19 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) + * Copyright (C) 2010 J Procter, AM Waterhouse, 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 file is part of Jalview. * - * 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. + * Jalview 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 3 of the License, or (at your option) any later version. * - * 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 + * Jalview 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 Jalview. If not, see . */ package jalview.ws; @@ -80,9 +79,9 @@ public class DasSequenceFeatureFetcher * Creates a new SequenceFeatureFetcher object. Uses default * * @param align - * DOCUMENT ME! + * DOCUMENT ME! * @param ap - * DOCUMENT ME! + * DOCUMENT ME! */ public DasSequenceFeatureFetcher(SequenceI[] sequences, FeatureSettings fsettings, Vector selectedSources) @@ -94,18 +93,20 @@ public class DasSequenceFeatureFetcher FeatureSettings fsettings, Vector ourselectedSources, boolean checkDbrefs, boolean promptFetchDbrefs) { - this.selectedSources = new Vector(); + this.selectedSources = new Vector(); Enumeration sources = ourselectedSources.elements(); // filter both sequences and sources to eliminate duplicates while (sources.hasMoreElements()) { Object src = sources.nextElement(); - if (!selectedSources.contains(src)) { - selectedSources.addElement(src); - }; + if (!selectedSources.contains(src)) + { + selectedSources.addElement(src); + } + ; } Vector sqs = new Vector(); - for (int i=0; i 0) { // feature is also appended to enable links to be seen. // TODO: consider extending dbrefs to have their own links ? - // TODO: new feature: extract dbref links from DAS servers and add the URL pattern to the list of DB name associated links in the user's preferences ? - // for the moment - just fix up the existing feature so it displays correctly. + // TODO: new feature: extract dbref links from DAS servers and add the + // URL pattern to the list of DB name associated links in the user's + // preferences ? + // for the moment - just fix up the existing feature so it displays + // correctly. // f.setType(dbr.getSource()); - //f.setDescription(); + // f.setDescription(); f.setValue("linkonly", Boolean.TRUE); - //f.setDescription(""); + // f.setDescription(""); Vector newlinks = new Vector(); Enumeration it = f.links.elements(); while (it.hasMoreElements()) { String elm; - UrlLink urllink = new UrlLink(elm = (String)it.nextElement()); - if (urllink.isValid()) { + UrlLink urllink = new UrlLink(elm = (String) it.nextElement()); + if (urllink.isValid()) + { urllink.setLabel(f.getDescription()); newlinks.addElement(urllink.toString()); - } else { - // couldn't parse the link properly. Keep it anyway - just in case. - debug("couldn't parse link string - "+elm); + } + else + { + // couldn't parse the link properly. Keep it anyway - just in + // case. + debug("couldn't parse link string - " + elm); newlinks.addElement(elm); } } @@ -835,7 +852,7 @@ public class DasSequenceFeatureFetcher * query the given URL for DasSources. * * @param registryURL - * return sources from registryURL + * return sources from registryURL */ public static DasSource[] getDASSources(String registryURL) { @@ -871,6 +888,8 @@ public class DasSequenceFeatureFetcher .size()]); } catch (Exception ex) { + System.err.println("Failed to contact DAS1 registry at " + + registryURL); ex.printStackTrace(); return null; }