X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FJabaParamStore.java;h=e3ac85a0e49574976da2a03d1fbb40f0582301d1;hb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;hp=f454bb22d418204083bc2f2598a32f07748088de;hpb=47168f025aefdaa044802bd5f8f510ffe43a4808;p=jalview.git diff --git a/src/jalview/ws/jws2/JabaParamStore.java b/src/jalview/ws/jws2/JabaParamStore.java index f454bb2..e3ac85a 100644 --- a/src/jalview/ws/jws2/JabaParamStore.java +++ b/src/jalview/ws/jws2/JabaParamStore.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -20,6 +20,16 @@ */ package jalview.ws.jws2; +import jalview.util.MessageManager; +import jalview.ws.jws2.dm.JabaOption; +import jalview.ws.jws2.dm.JabaParameter; +import jalview.ws.jws2.dm.JabaWsParamSet; +import jalview.ws.jws2.jabaws2.Jws2Instance; +import jalview.ws.params.ArgumentI; +import jalview.ws.params.ParamDatastoreI; +import jalview.ws.params.ParamManager; +import jalview.ws.params.WsParamSetI; + import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -27,7 +37,6 @@ import java.util.Hashtable; import java.util.List; import java.util.StringTokenizer; -import org.jmol.util.ArrayUtil; import compbio.metadata.Argument; import compbio.metadata.Option; import compbio.metadata.Parameter; @@ -35,15 +44,6 @@ import compbio.metadata.Preset; import compbio.metadata.PresetManager; import compbio.metadata.RunnerConfig; -import jalview.ws.jws2.dm.JabaOption; -import jalview.ws.jws2.dm.JabaParameter; -import jalview.ws.jws2.dm.JabaWsParamSet; -import jalview.ws.jws2.jabaws2.Jws2Instance; -import jalview.ws.params.ArgumentI; -import jalview.ws.params.ParamDatastoreI; -import jalview.ws.params.ParamManager; -import jalview.ws.params.WsParamSetI; - public class JabaParamStore implements ParamDatastoreI { @@ -166,9 +166,9 @@ public class JabaParamStore implements ParamDatastoreI } if (narg == null) { - throw new Error( - "Implementation Error: Cannot handle Jaba parameter object " - + rg.getClass()); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_cannot_handle_jaba_param", + new String[] { rg.getClass().toString() })); } else { @@ -184,12 +184,12 @@ public class JabaParamStore implements ParamDatastoreI String[] rgssorton = rgnames.toArray(new String[rgs.size()]); jalview.util.QuickSort.sort(rgssorton, rgssort); ArgumentI tmp1; - int i=0; - while (rgssort.length-i>i) + int i = 0; + while (rgssort.length - i > i) { - tmp1=rgssort[rgssort.length-i-1]; - rgssort[rgssort.length-i-1] = rgssort[i]; - rgssort[i++]=tmp1; + tmp1 = rgssort[rgssort.length - i - 1]; + rgssort[rgssort.length - i - 1] = rgssort[i]; + rgssort[i++] = tmp1; } return Arrays.asList(rgssort); } @@ -203,9 +203,9 @@ public class JabaParamStore implements ParamDatastoreI .getOption() : null; if (narg == null) { - throw new Error( - "Implementation Error: Cannot handle Jaba parameter object " - + rg.getClass()); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_cannot_handle_jaba_param", + new String[] { rg.getClass().toString() })); } else { @@ -244,7 +244,8 @@ public class JabaParamStore implements ParamDatastoreI if (servicePresets.containsKey(name)) { throw new Error( - "Implementation error: Attempt to delete a service preset!"); + MessageManager + .getString("error.implementation_error_attempt_to_delete_service_preset")); } } @@ -253,8 +254,7 @@ public class JabaParamStore implements ParamDatastoreI List jobParams) { JabaWsParamSet jps = new JabaWsParamSet(presetName, text, jobParams); - jps.setApplicableUrls(new String[] - { service.getUri() }); + jps.setApplicableUrls(new String[] { service.getUri() }); editedParams.put(jps.getName(), jps); if (manager != null) { @@ -270,15 +270,16 @@ public class JabaParamStore implements ParamDatastoreI : getPreset(presetName)); if (jps == null) { - throw new Error("Implementation error: Can't locate either oldname (" - + oldName + ") or presetName (" + presetName - + "in the datastore!"); + throw new Error( + MessageManager + .formatMessage( + "error.implementation_error_cannot_locate_oldname_presetname", + new String[] { oldName, presetName })); } jps.setName(presetName); jps.setDescription(text); jps.setArguments(jobParams); - jps.setApplicableUrls(new String[] - { service.getUri() }); + jps.setApplicableUrls(new String[] { service.getUri() }); if (oldName != null && !oldName.equals(jps.getName())) { editedParams.remove(oldName); @@ -323,7 +324,8 @@ public class JabaParamStore implements ParamDatastoreI if (!involves(urls)) { throw new IOException( - "Implementation error: Cannot find service url in the given url set!"); + MessageManager + .getString("error.implementation_error_cannot_find_service_url_in_given_set")); } JabaWsParamSet wsp = new JabaWsParamSet(); @@ -349,14 +351,16 @@ public class JabaParamStore implements ParamDatastoreI if (!involves(pset.getApplicableUrls())) { throw new IOException( - "Implementation error: Cannot find service url in the given url set for this service parameter store (" - + service.getUri() + ") !"); - + MessageManager + .formatMessage( + "error.implementation_error_cannot_find_service_url_in_given_set_param_store", + new String[] { service.getUri() })); } if (!(pset instanceof JabaWsParamSet)) { throw new Error( - "Implementation error: JabaWsParamSets can only be handled by JabaParamStore"); + MessageManager + .getString("error.implementation_error_jabaws_param_set_only_handled_by")); } StringBuffer rslt = new StringBuffer();