From: Ben Soares Date: Thu, 14 Dec 2023 16:40:02 +0000 (+0000) Subject: Merge branch 'develop' into bug/JAL-4238_PAEs_not_being_shown_in_JalviewJS X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=58e9dd6622603ddbc8266912074689c3e0fcffbc;p=jalview.git Merge branch 'develop' into bug/JAL-4238_PAEs_not_being_shown_in_JalviewJS --- 58e9dd6622603ddbc8266912074689c3e0fcffbc diff --cc src/jalview/bin/argparser/ArgParser.java index 48cbf9c,12e1b1d..f619687 --- a/src/jalview/bin/argparser/ArgParser.java +++ b/src/jalview/bin/argparser/ArgParser.java @@@ -751,7 -719,9 +761,8 @@@ public class ArgParse } else if (a.hasOption(Opt.BOOLEAN)) { - setBoolean(linkedId, type, avs, !negated, argIndex); + setBoolean(linkedId, givenLinkedId, type, avs, !negated, + argIndex); - setNegated(linkedId, avs, negated); } else if (a.hasOption(Opt.UNARY)) { @@@ -1096,38 -1066,44 +1107,38 @@@ /** * This version inserts the subvals sv into all created values */ - private void addValue(String linkedId, Type type, ArgValues avs, - SubVals sv, String v, int argIndex, boolean doSubs) + private void addValue(String linkedId, String givenLinkedId, Type type, + ArgValues avs, SubVals sv, String v, int argIndex, boolean doSubs) { - this.argValueOperation(Op.ADDVALUE, linkedId, type, avs, sv, v, false, - argIndex, doSubs); + this.argValueOperation(Op.ADDVALUE, linkedId, givenLinkedId, type, avs, + sv, v, false, argIndex, doSubs); } - private void setBoolean(String linkedId, Type type, ArgValues avs, - boolean b, int argIndex) + private void setBoolean(String linkedId, String givenLinkedId, Type type, + ArgValues avs, boolean b, int argIndex) { - this.argValueOperation(Op.SETBOOLEAN, linkedId, type, avs, null, null, - b, argIndex, false); + this.argValueOperation(Op.SETBOOLEAN, linkedId, givenLinkedId, type, + avs, null, null, b, argIndex, false); } - private void setNegated(String linkedId, ArgValues avs, boolean b) - { - this.argValueOperation(Op.SETNEGATED, linkedId, null, null, avs, null, - null, b, 0, false); - } - private void incrementCount(String linkedId, ArgValues avs) { - this.argValueOperation(Op.INCREMENTCOUNT, linkedId, null, avs, null, - null, false, 0, false); + this.argValueOperation(Op.INCREMENTCOUNT, linkedId, null, null, avs, + null, null, false, 0, false); } private enum Op { - ADDVALUE, SETBOOLEAN, SETNEGATED, INCREMENTCOUNT + ADDVALUE, SETBOOLEAN, INCREMENTCOUNT } - private void argValueOperation(Op op, String linkedId, Type type, - ArgValues avs, SubVals sv, String v, boolean b, int argIndex, - boolean doSubs) + private void argValueOperation(Op op, String linkedId, + String givenLinkedId, Type type, ArgValues avs, SubVals sv, + String v, boolean b, int argIndex, boolean doSubs) { // default to merge subvals if subvals are provided - argValueOperation(op, linkedId, type, avs, sv, true, v, b, argIndex, - doSubs); + argValueOperation(op, linkedId, givenLinkedId, type, avs, sv, true, v, + b, argIndex, doSubs); } /** @@@ -1231,22 -1208,21 +1243,22 @@@ break; case SETBOOLEAN: - tavs.setBoolean(type, b, argIndex, true, givenLinkedId); - finaliseStoringArgValue(matchedLinkedId, tavs); - break; - - case SETNEGATED: - tavs.setNegated(b, true); - break; - - case INCREMENTCOUNT: - tavs.incrementCount(); - break; - - default: + if (getPrioritisePositiveBooleanValue() && tavs.getCount() > 0 + && tavs.getBoolean()) + { + Console.debug("Not setting due to prioritisePositiveValue and '" + + a.argString() + "' has already been set to true"); + } + else + { - tavs.setBoolean(type, b, argIndex, true); ++ tavs.setBoolean(type, b, argIndex, true, givenLinkedId); + if (a.hasOption(Opt.BOOLEAN)) + { + tavs.setNegated(!b, true); + } - finaliseStoringArgValue(id, tavs); ++ finaliseStoringArgValue(matchedLinkedId, tavs); + } break; - } } @@@ -1278,21 -1254,12 +1290,21 @@@ break; case SETBOOLEAN: - avs.setBoolean(type, b, argIndex, false, givenLinkedId); - finaliseStoringArgValue(linkedId, avs); - break; - - case SETNEGATED: - avs.setNegated(b, false); + if (getPrioritisePositiveBooleanValue() && avs.getCount() > 0 + && avs.getBoolean()) + { + Console.debug("Not setting due to prioritisePositiveValue and '" + + a.argString() + "' has already been set to true"); + } + else + { - avs.setBoolean(type, b, argIndex, false); ++ avs.setBoolean(type, b, argIndex, false, givenLinkedId); + if (a.hasOption(Opt.BOOLEAN)) + { + avs.setNegated(!b, true); + } + finaliseStoringArgValue(linkedId, avs); + } break; case INCREMENTCOUNT: