2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.ws.jws2.dm;
20 import java.util.ArrayList;
21 import java.util.List;
23 import compbio.metadata.Option;
25 import jalview.ws.jws2.JabaParamStore;
26 import jalview.ws.params.ArgumentI;
27 import jalview.ws.params.WsParamSetI;
29 public class JabaWsParamSet implements WsParamSetI
34 List<Option> jabaArguments;
36 String name, description, applicableUrls[], sourceFile;
38 public JabaWsParamSet(String storeSetName, String descr, List jobParams)
40 if (jobParams.size() > 0)
42 if (jobParams.get(0) instanceof Option)
44 jabaArguments = new ArrayList<Option>();
45 // if classCastExceptions are raised then there has been an
46 // implementation error.
47 jabaArguments.addAll((List<Option>) jobParams);
51 if (!allJaba(jobParams))
54 "Cannot create a JabaWSParamSet from non-JabaWS parameters");
58 jabaArguments = JabaParamStore.getJabafromJwsArgs(jobParams);
65 applicableUrls = null;
68 public JabaWsParamSet()
73 private boolean allJaba(List jobParams)
76 boolean allJaba = true;
77 for (Object jp : jobParams)
79 if (jp instanceof JabaParameter || jp instanceof JabaOption)
93 public String getName()
99 public String getDescription()
108 public void setName(String name)
115 * the description to set
117 public void setDescription(String description)
119 this.description = description;
123 * @param applicableUrls
124 * the applicableUrls to set
126 public void setApplicableUrls(String[] applicableUrls)
128 this.applicableUrls = applicableUrls;
133 * the modifiable to set
135 public void setModifiable(boolean modifiable)
137 this.modifiable = modifiable;
141 public String[] getApplicableUrls()
143 return applicableUrls;
147 public String getSourceFile()
153 public void setSourceFile(String newfile)
155 sourceFile = newfile;
158 boolean modifiable = true;
161 public boolean isModifiable()
167 public List<ArgumentI> getArguments()
169 return JabaParamStore.getJwsArgsfromJaba(jabaArguments);
173 public void setArguments(List<ArgumentI> args)
178 "Cannot set arguments to a JabaWSParamSet that are not JabaWS arguments");
180 jabaArguments = new ArrayList<Option>();
181 for (ArgumentI rg : args)
183 jabaArguments.add(((JabaOption) rg).opt);
187 public List<Option> getjabaArguments()
189 return jabaArguments;
192 public void setjabaArguments(List<Option> args)
194 jabaArguments = args;