/* * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * * 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. * * 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 . * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.urls; import java.io.File; import java.util.Vector; /** * Methods for providing consistent access to up-to-date URLs * * @author $author$ * @version $Revision$ */ public interface UrlProviderI { /* * Default sequence URL link label for EMBL-EBI search */ public static final String DEFAULT_LABEL = "EMBL-EBI Search"; /* * Default sequence URL link string for EMBL-EBI search */ public static final String DEFAULT_STRING = DEFAULT_LABEL + "|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$"; /* * Location of file for identifiers.org download */ public static final String ID_ORG_FILE = System.getProperty("user.home") + File.separatorChar + ".jalview_identifiers"; /** * Get names and urls in as strings for display * */ Vector getLinksForDisplay(); /** * Get the id of the default URL * * @return id of the default URL */ String getDefaultUrl(); /** * Get the link for the default URL * * @seqid sequence id for which to build link * @return link for the default URL */ String getDefaultUrl(String seqid); /** * Get the target of thelink for the default URL * * @seqid sequence id for which to build link * @return target of link for the default URL */ String getDefaultTarget(String seqid); /** * Set the default URL * * @param id * the id of the URL to set as default * @return true if setting was successful, false otherwise */ boolean setDefaultUrl(String id); /** * Write out all URLs as a string suitable for serialising * * @return string representation of available URLs */ String writeUrlsAsString(); /** * Set URL links from pair of collections * * @param names * @param urls */ void setUrlLinks(Vector names, Vector urls) throws IllegalArgumentException; /** * Choose the default URL in the event of the selected default being * unavailable * * @return id of chosen default url */ String chooseDefaultUrl(); }