*/
public class AlignViewport extends AlignmentViewport implements SelectionSource, VamsasSource, AlignViewportI
{
- private static final int RIGHT_JUSTIFY = 1;
-
int startRes;
int endRes;
*/
public long[] getUndoRedoHash()
{
+ // TODO: JAL-1126
if (historyList == null || redoList == null)
return new long[]
{ -1, -1 };
{
return validCharWidth;
}
+ private jalview.ws.jws2.dm.AAConsSettings preferredAAConsSettings;
+
+ public jalview.ws.jws2.dm.AAConsSettings getPreferredAAConsSettings()
+ {
+ return preferredAAConsSettings;
+ }
+ public void setPreferredAAConsSettings(jalview.ws.jws2.dm.AAConsSettings aaConsSettings)
+ {
+ preferredAAConsSettings=aaConsSettings;
+ }
+
}
--- /dev/null
+package jalview.ws.jws2.dm;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import compbio.metadata.Argument;
+import compbio.metadata.Preset;
+
+import jalview.ws.jws2.JabaPreset;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.WsParamSetI;
+
+/**
+ * preferences for running AACons service
+ *
+ * @author jprocter TODO: refactor to a generic 'last job and service run'
+ * container ?
+ */
+public class AAConsSettings
+{
+ boolean autoUpdate;
+
+ Jws2Instance service;
+
+ WsParamSetI preset;
+
+ List<Argument> jobArgset;
+
+ public AAConsSettings(boolean autoUpdate, Jws2Instance service,
+ WsParamSetI preset, List<Argument> jobArgset)
+ {
+ super();
+ this.autoUpdate = autoUpdate;
+ this.service = service;
+ this.preset = preset;
+ this.jobArgset = jobArgset;
+ }
+
+ public boolean isAutoUpdate()
+ {
+ return autoUpdate;
+ }
+
+ public void setAutoUpdate(boolean autoUpdate)
+ {
+ this.autoUpdate = autoUpdate;
+ }
+
+ public Jws2Instance getService()
+ {
+ return service;
+ }
+
+ public void setService(Jws2Instance service)
+ {
+ this.service = service;
+ if (preset != null)
+ {
+ // migrate preset to new service
+ for (String url : preset.getApplicableUrls())
+ {
+ if (url.equals(service.getUri()))
+ {
+ return;
+ }
+ }
+ WsParamSetI pr = service.getParamStore().getPreset(preset.getName());
+ if (pr instanceof JabaPreset && preset instanceof JabaPreset)
+ {
+ // easy - Presets are identical (we assume)
+ preset = pr;
+ return;
+ }
+ List<ArgumentI> oldargs = new ArrayList<ArgumentI>(), newargs = new ArrayList<ArgumentI>();
+ oldargs.addAll(preset.getArguments());
+ // need to compare parameters
+ for (ArgumentI newparg : pr.getArguments())
+ {
+ if (!oldargs.remove(newparg))
+ {
+ newargs.add(newparg);
+ }
+ }
+ if (oldargs.size() == 0 && newargs.size() == 0)
+ {
+ // exact match.
+ preset = pr;
+ return;
+ }
+ // Try even harder to migrate arguments.
+ throw new Error("Parameter migration not implemented yet");
+ }
+ }
+
+ public WsParamSetI getPreset()
+ {
+ return preset;
+ }
+
+ public void setPreset(WsParamSetI preset)
+ {
+ // TODO: test if service URL is in presets
+ this.preset = preset;
+ }
+
+ public List<Argument> getJobArgset()
+ {
+ return jobArgset;
+ }
+
+ public void setJobArgset(List<Argument> jobArgset)
+ {
+ // TODO: test if parameters valid for service
+ this.jobArgset = jobArgset;
+ }
+
+}