From: gmungoc Date: Thu, 10 May 2018 12:34:37 +0000 (+0100) Subject: JAL-2629 adjust placement and optionality of arguments/options X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d25ed8f9fb513fe5c33823afbeeb557c73a8c27b;p=jalview.git JAL-2629 adjust placement and optionality of arguments/options --- diff --git a/src/jalview/hmmer/HMMERParamStore.java b/src/jalview/hmmer/HMMERParamStore.java index b609f69..37ad435 100644 --- a/src/jalview/hmmer/HMMERParamStore.java +++ b/src/jalview/hmmer/HMMERParamStore.java @@ -127,11 +127,12 @@ public final class HMMERParamStore implements ParamDatastoreI } } nameScanner.close(); - args.add(new Option(MessageManager.getString(HMMSearch.DATABASE_KEY), + args.add(new StringParameter( + MessageManager.getString(HMMSearch.DATABASE_KEY), MessageManager.getString("label.database_for_hmmsearch"), true, MessageManager.getString(HMMSearch.THIS_ALIGNMENT_KEY), MessageManager.getString(HMMSearch.THIS_ALIGNMENT_KEY), - databases, null)); + databases)); } args.add(new BooleanOption( MessageManager.getString(HMMSearch.AUTO_ALIGN_SEQS_KEY), @@ -205,7 +206,7 @@ public final class HMMERParamStore implements ParamDatastoreI protected void addChoiceOfHmm(List args) { List hmms = viewport.getAlignment().getHmmSequences(); - if (!hmms.isEmpty()) + if (hmms.size() > 1) { List options = new ArrayList<>(); for (SequenceI hmmSeq : hmms) @@ -213,9 +214,10 @@ public final class HMMERParamStore implements ParamDatastoreI options.add(hmmSeq.getName()); } String defseq = options.get(0); - Option option = new Option(MessageManager.getString("label.use_hmm"), - "", true, defseq, defseq, options, null); - args.add(option); + ArgumentI arg = new StringParameter( + MessageManager.getString("label.use_hmm"), null, true, defseq, + defseq, options); + args.add(arg); } } @@ -250,16 +252,20 @@ public final class HMMERParamStore implements ParamDatastoreI /* * choice of whether to compute HMM for alignment and/or group(s) + * - only if there are any groups */ - Collection options = new ArrayList<>(); - options.add(MessageManager.getString("label.alignment")); - options.add(MessageManager.getString("label.groups_and_alignment")); - options.add(MessageManager.getString("label.groups")); - options.add(MessageManager.getString("label.selected_group")); - args.add(new Option(MessageManager.getString("label.hmmbuild_for"), - MessageManager.getString("label.hmmbuild_for_desc"), true, - MessageManager.getString("label.alignment"), - MessageManager.getString("label.alignment"), options, null)); + if (!viewport.getAlignment().getGroups().isEmpty()) + { + Collection options = new ArrayList<>(); + options.add(MessageManager.getString("label.alignment")); + options.add(MessageManager.getString("label.groups_and_alignment")); + options.add(MessageManager.getString("label.groups")); + options.add(MessageManager.getString("label.selected_group")); + args.add(new Option(MessageManager.getString("label.hmmbuild_for"), + MessageManager.getString("label.hmmbuild_for_desc"), true, + MessageManager.getString("label.alignment"), + MessageManager.getString("label.alignment"), options, null)); + } } @Override