2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 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 java.util.ArrayList;
24 import java.util.List;
26 import compbio.metadata.Option;
28 import jalview.util.MessageManager;
29 import jalview.ws.jws2.JabaParamStore;
30 import jalview.ws.params.ArgumentI;
31 import jalview.ws.params.WsParamSetI;
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.getString("error.cannot_create_jabaws_param_set"));
61 jabaArguments = JabaParamStore.getJabafromJwsArgs(jobParams);
68 applicableUrls = null;
71 public JabaWsParamSet()
76 private boolean allJaba(List jobParams)
79 boolean allJaba = true;
80 for (Object jp : jobParams)
82 if (jp instanceof JabaParameter || jp instanceof JabaOption)
96 public String getName()
102 public String getDescription()
111 public void setName(String name)
118 * the description to set
120 public void setDescription(String description)
122 this.description = description;
126 * @param applicableUrls
127 * the applicableUrls to set
129 public void setApplicableUrls(String[] applicableUrls)
131 this.applicableUrls = applicableUrls;
136 * the modifiable to set
138 public void setModifiable(boolean modifiable)
140 this.modifiable = modifiable;
144 public String[] getApplicableUrls()
146 return applicableUrls;
150 public String getSourceFile()
156 public void setSourceFile(String newfile)
158 sourceFile = newfile;
161 boolean modifiable = true;
164 public boolean isModifiable()
170 public List<ArgumentI> getArguments()
172 return JabaParamStore.getJwsArgsfromJaba(jabaArguments);
176 public void setArguments(List<ArgumentI> args)
180 throw new Error(MessageManager.getString("error.cannot_set_arguments_to_jabaws_param_set"));
182 jabaArguments = new ArrayList<Option>();
183 for (ArgumentI rg : args)
185 jabaArguments.add(((JabaOption) rg).opt);
189 public List<Option> getjabaArguments()
191 return jabaArguments;
194 public void setjabaArguments(List<Option> args)
196 jabaArguments = args;