return true;
/*
- // script to execute after all loading is completed one way or another
- String groovyscript = m.get(Arg.GROOVY) == null ? null
- : m.get(Arg.GROOVY).getValue();
- String file = m.get(Arg.OPEN) == null ? null
- : m.get(Arg.OPEN).getValue();
- String data = null;
- FileFormatI format = null;
- DataSourceType protocol = null;
- */
+ * // script to execute after all loading is completed one way or another String
+ * groovyscript = m.get(Arg.GROOVY) == null ? null :
+ * m.get(Arg.GROOVY).getValue(); String file = m.get(Arg.OPEN) == null ? null :
+ * m.get(Arg.OPEN).getValue(); String data = null; FileFormatI format = null;
+ * DataSourceType protocol = null;
+ */
if (avm.containsArg(Arg.OPEN) || avm.containsArg(Arg.OPENNEW))
{
commandArgsProvided = true;
|| a == Arg.OPENNEW || format == FileFormat.Jalview)
{
/*
- * this approach isn't working yet
- // get default annotations before opening AlignFrame
- if (m.get(Arg.SSANNOTATION) != null)
- {
- Console.debug("***** SSANNOTATION="
- + m.get(Arg.SSANNOTATION).getBoolean());
- }
- if (m.get(Arg.NOTEMPFAC) != null)
- {
- Console.debug(
- "***** NOTEMPFAC=" + m.get(Arg.NOTEMPFAC).getBoolean());
- }
- boolean showSecondaryStructure = (m.get(Arg.SSANNOTATION) != null)
- ? m.get(Arg.SSANNOTATION).getBoolean()
- : false;
- boolean showTemperatureFactor = (m.get(Arg.NOTEMPFAC) != null)
- ? !m.get(Arg.NOTEMPFAC).getBoolean()
- : false;
- Console.debug("***** tempfac=" + showTemperatureFactor
- + ", showSS=" + showSecondaryStructure);
- StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
- if (ssm != null)
- {
- ssm.setAddTempFacAnnot(showTemperatureFactor);
- ssm.setProcessSecondaryStructure(showSecondaryStructure);
- }
+ * this approach isn't working yet // get default annotations before opening
+ * AlignFrame if (m.get(Arg.SSANNOTATION) != null) {
+ * Console.debug("##### SSANNOTATION=" + m.get(Arg.SSANNOTATION).getBoolean());
+ * } if (m.get(Arg.NOTEMPFAC) != null) { Console.debug( "##### NOTEMPFAC=" +
+ * m.get(Arg.NOTEMPFAC).getBoolean()); } boolean showSecondaryStructure =
+ * (m.get(Arg.SSANNOTATION) != null) ? m.get(Arg.SSANNOTATION).getBoolean() :
+ * false; boolean showTemperatureFactor = (m.get(Arg.NOTEMPFAC) != null) ?
+ * !m.get(Arg.NOTEMPFAC).getBoolean() : false; Console.debug("##### tempfac=" +
+ * showTemperatureFactor + ", showSS=" + showSecondaryStructure);
+ * StructureSelectionManager ssm = StructureSelectionManager
+ * .getStructureSelectionManager(Desktop.instance); if (ssm != null) {
+ * ssm.setAddTempFacAnnot(showTemperatureFactor);
+ * ssm.setProcessSecondaryStructure(showSecondaryStructure); }
*/
// get kind of temperature factor annotation
} catch (IllegalArgumentException e)
{
// Just an error message!
- StringBuilder sb = new StringBuilder().append("Cannot set --")
- .append(Arg.TEMPFAC.getName()).append(" to '")
+ StringBuilder sb = new StringBuilder().append("Cannot set ")
+ .append(Arg.TEMPFAC.argString()).append(" to '")
.append(tempfacType)
.append("', ignoring. Valid values are: ");
Iterator<StructureImportSettings.TFType> it = Arrays
false, false);
}
else
- /* comment out hacky approach up to here and add this line:
- if (showTemperatureFactor)
- */
+ /*
+ * comment out hacky approach up to here and add this line: if
+ * (showTemperatureFactor)
+ */
{
if (avm.containsArg(Arg.TEMPFAC_LABEL))
{
SequenceI seq = getSpecifiedSequence(af, subId);
if (seq == null)
{
- Console.warn("Could not find sequence for argument --"
- + Arg.STRUCTURE + "=" + val);
+ Console.warn("Could not find sequence for argument "
+ + Arg.STRUCTURE.argString() + "=" + val);
// you probably want to continue here, not break
// break;
continue;
// TRY THIS
/*
- PDBEntry fileEntry = new AssociatePdbFileWithSeq()
- .associatePdbWithSeq(selectedPdbFileName,
- DataSourceType.FILE, selectedSequence, true,
- Desktop.instance);
-
- sViewer = launchStructureViewer(ssm, new PDBEntry[] { fileEntry },
- ap, new SequenceI[]
- { selectedSequence });
-
+ * PDBEntry fileEntry = new AssociatePdbFileWithSeq()
+ * .associatePdbWithSeq(selectedPdbFileName, DataSourceType.FILE,
+ * selectedSequence, true, Desktop.instance);
+ *
+ * sViewer = launchStructureViewer(ssm, new PDBEntry[] { fileEntry }, ap, new
+ * SequenceI[] { selectedSequence });
+ *
*/
/* THIS DOESN'T WORK */
// get tft, paeFilename, label?
/*
- ArgValue tftAv = avm.getArgValuesReferringTo("structid", structId,
- Arg.TEMPFAC);
+ * ArgValue tftAv = avm.getArgValuesReferringTo("structid", structId,
+ * Arg.TEMPFAC);
*/
StructureChooser.openStructureFileForSequence(null, null, ap, seq,
false, structureFile.getAbsolutePath(), null, null); // tft,
- // paeFilename);
+ // paeFilename);
}
}
}
}
if (structfile != null)
{
- Console.info("***** Attaching paeFile '" + paePath + "' to "
+ Console.info("##### Attaching paeFile '" + paePath + "' to "
+ "structfile=" + subVals.get("structfile"));
EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(),
paeFile, subVals.getIndex(), subVals.get("structfile"),
}
else if (structid != null)
{
- Console.info("***** Attaching paeFile '" + paePath + "' to "
+ Console.info("##### Attaching paeFile '" + paePath + "' to "
+ "structid=" + subVals.get("structid"));
EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(),
paeFile, subVals.getIndex(), subVals.get("structid"),
}
else
{
- Console.debug("***** Attaching paeFile '" + paePath
+ Console.debug("##### Attaching paeFile '" + paePath
+ "' to sequence index " + subVals.getIndex());
EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(),
paeFile, subVals.getIndex(), null, false, false,
htmlSVG.exportHTML(fileName);
break;
default:
- Console.warn("--image type '" + type + "' not known. Ignoring");
+ Console.warn(Arg.IMAGE.argString() + " type '" + type
+ + "' not known. Ignoring");
break;
}
}
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
-import java.util.Locale;
import java.util.Map;
import jalview.bin.Console;
if (argMap.containsKey(argName))
{
Console.warn("Trying to add argument name multiple times: '"
- + argName + "'"); // RESTORE THIS WHEN MERGED
+ + argName + "'"); // RESTORE THIS WHEN
+ // MERGED
if (argMap.get(argName) != a)
{
Console.error(
if (openEachInitialFilenames && !arg.startsWith(DOUBLEDASH)
&& !arg.startsWith("-") && new File(arg).exists())
{
- arg = DOUBLEDASH + Arg.OPENNEW.getName();
+ arg = Arg.OPENNEW.argString();
}
else
{
}
if (a.hasOption(Opt.PRIVATE) && !allowPrivate)
{
- Console.error("Argument '" + DOUBLEDASH + argName
- + "' is private. Ignoring.");
+ Console.error(
+ "Argument '" + a.argString() + "' is private. Ignoring.");
continue;
}
if (!a.hasOption(Opt.BOOLEAN) && negated)
if (!a.hasOption(Opt.STRING) && equalPos > -1)
{
// set --argname=value when arg does not accept values
- Console.error("Argument '" + DOUBLEDASH + argName
+ Console.error("Argument '" + a.argString()
+ "' does not expect a value (given as '" + arg
+ "'). Ignoring.");
continue;
if (!a.hasOption(Opt.LINKED) && linkedId != null)
{
// set --argname[linkedId] when arg does not use linkedIds
- Console.error("Argument '" + DOUBLEDASH + argName
+ Console.error("Argument '" + a.argString()
+ "' does not expect a linked id (given as '" + arg
+ "'). Ignoring.");
continue;
// not dealing with both NODUPLICATEVALUES and GLOB
if (a.hasOption(Opt.NODUPLICATEVALUES) && avm.hasValue(a, val))
{
- Console.error("Argument '" + DOUBLEDASH + argName
+ Console.error("Argument '" + a.argString()
+ "' cannot contain a duplicate value ('" + val
+ "'). Ignoring this and subsequent occurrences.");
continue;
String id = idsv.get(ArgValues.ID);
if (id != null && avm.hasId(a, id))
{
- Console.error("Argument '" + DOUBLEDASH + argName
+ Console.error("Argument '" + a.argString()
+ "' has a duplicate id ('" + id + "'). Ignoring.");
continue;
}
/*
* A helper method to take a list of String args where we're expecting
* {"--previousargs", "--arg", "file1", "file2", "file3", "--otheroptionsornot"}
- * and the index of the globbed arg, here 1. It returns a
- * List<String> {"file1", "file2", "file3"}
- * *and remove these from the original list object* so that processing
- * can continue from where it has left off, e.g. args has become
- * {"--previousargs", "--arg", "--otheroptionsornot"}
- * so the next increment carries on from the next --arg if available.
+ * and the index of the globbed arg, here 1. It returns a List<String> {"file1",
+ * "file2", "file3"} *and remove these from the original list object* so that
+ * processing can continue from where it has left off, e.g. args has become
+ * {"--previousargs", "--arg", "--otheroptionsornot"} so the next increment
+ * carries on from the next --arg if available.
*/
protected static List<String> getShellGlobbedFilenameValues(Arg a,
List<String> args, int i)
{
if (!argFile.exists())
{
- String message = DOUBLEDASH
- + Arg.ARGFILE.name().toLowerCase(Locale.ROOT) + EQUALS
- + "\"" + argFile.getPath() + "\": File does not exist.";
+ String message = Arg.ARGFILE.argString() + EQUALS + "\""
+ + argFile.getPath() + "\": File does not exist.";
Jalview.exit(message, 2);
}
try
{
- String setargfile = new StringBuilder(ArgParser.DOUBLEDASH)
- .append(Arg.SETARGFILE.getName()).append(EQUALS)
- .append(argFile.getCanonicalPath()).toString();
+ String setargfile = new StringBuilder(Arg.SETARGFILE.argString())
+ .append(EQUALS).append(argFile.getCanonicalPath())
+ .toString();
argsList.add(setargfile);
argsList.addAll(Files.readAllLines(Paths.get(argFile.getPath())));
- argsList.add(new StringBuilder(ArgParser.DOUBLEDASH)
- .append(Arg.UNSETARGFILE.getName()).toString());
+ argsList.add(Arg.UNSETARGFILE.argString());
} catch (IOException e)
{
- String message = DOUBLEDASH
- + Arg.ARGFILE.name().toLowerCase(Locale.ROOT) + "=\""
- + argFile.getPath() + "\": File could not be read.";
+ String message = Arg.ARGFILE.argString() + "=\"" + argFile.getPath()
+ + "\": File could not be read.";
Jalview.exit(message, 3);
}
}