X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Furls%2Fapplet%2FAppletUrlProviderFactory.java;fp=src%2Fjalview%2Furls%2Fapplet%2FAppletUrlProviderFactory.java;h=fcedaa4bdfe2245f229856eb3b3eb75922b3959d;hb=2595e9d4ee0dbbd3406a98c4e49a61ccde806479;hp=0000000000000000000000000000000000000000;hpb=e20075ba805d744d7cc4976e2b8d5e5840fb0a8d;p=jalview.git diff --git a/src/jalview/urls/applet/AppletUrlProviderFactory.java b/src/jalview/urls/applet/AppletUrlProviderFactory.java new file mode 100644 index 0000000..fcedaa4 --- /dev/null +++ b/src/jalview/urls/applet/AppletUrlProviderFactory.java @@ -0,0 +1,64 @@ +/* + * 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.applet; + +import jalview.urls.CustomUrlProvider; +import jalview.urls.UrlProvider; +import jalview.urls.api.UrlProviderFactoryI; +import jalview.urls.api.UrlProviderI; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * UrlProvider factory for applet code + * + * @author $author$ + * @version $Revision$ + */ + +public class AppletUrlProviderFactory implements UrlProviderFactoryI +{ + private String provDefaultUrl; + + private Map provUrlList; + + public AppletUrlProviderFactory(String defaultUrlString, + Map urlList) + { + provDefaultUrl = defaultUrlString; + provUrlList = urlList; + } + + @Override + public UrlProviderI createUrlProvider() + { + // create all the UrlProviders we need + List providers = new ArrayList(); + UrlProviderI customProvider = new CustomUrlProvider(provUrlList, null); + providers.add(customProvider); + + UrlProviderI prov = new UrlProvider(provDefaultUrl, providers); + return prov; + } + +}