2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.ws.jws2.dm;
23 import jalview.util.MessageManager;
24 import jalview.ws.jws2.JabaParamStore;
25 import jalview.ws.params.ArgumentI;
26 import jalview.ws.params.WsParamSetI;
28 import java.util.ArrayList;
29 import java.util.List;
31 import compbio.metadata.Option;
33 public class JabaWsParamSet implements WsParamSetI
38 List<Option> jabaArguments;
40 String name, description, applicableUrls[], sourceFile;
42 public JabaWsParamSet(String storeSetName, String descr, List jobParams)
44 if (jobParams.size() > 0)
46 if (jobParams.get(0) instanceof Option)
48 jabaArguments = new ArrayList<Option>();
49 // if classCastExceptions are raised then there has been an
50 // implementation error.
51 jabaArguments.addAll((List<Option>) jobParams);
55 if (!allJaba(jobParams))
57 throw new Error(MessageManager
58 .getString("error.cannot_create_jabaws_param_set"));
62 jabaArguments = JabaParamStore.getJabafromJwsArgs(jobParams);
69 applicableUrls = null;
72 public JabaWsParamSet()
77 private boolean allJaba(List jobParams)
80 boolean allJaba = true;
81 for (Object jp : jobParams)
83 if (jp instanceof JabaParameter || jp instanceof JabaOption)
97 public String getName()
103 public String getDescription()
112 public void setName(String name)
119 * the description to set
121 public void setDescription(String description)
123 this.description = description;
127 * @param applicableUrls
128 * the applicableUrls to set
130 public void setApplicableUrls(String[] applicableUrls)
132 this.applicableUrls = applicableUrls;
137 * the modifiable to set
139 public void setModifiable(boolean modifiable)
141 this.modifiable = modifiable;
145 public String[] getApplicableUrls()
147 return applicableUrls;
151 public String getSourceFile()
157 public void setSourceFile(String newfile)
159 sourceFile = newfile;
162 boolean modifiable = true;
165 public boolean isModifiable()
171 public List<ArgumentI> getArguments()
173 return JabaParamStore.getJwsArgsfromJaba(jabaArguments);
177 public void setArguments(List<ArgumentI> args)
181 throw new Error(MessageManager
182 .getString("error.cannot_set_arguments_to_jabaws_param_set"));
184 jabaArguments = new ArrayList<Option>();
185 for (ArgumentI rg : args)
187 jabaArguments.add(((JabaOption) rg).opt);
191 public List<Option> getjabaArguments()
193 return jabaArguments;
196 public void setjabaArguments(List<Option> args)
198 jabaArguments = args;