+ else
+ {
+ Console.warn("No more files to open");
+ if (desktop != null)
+ desktop.setProgressBar(null, progress);
+ }
+ }
+
+ }
+
+ // open the structure (from same PDB file or given PDBfile)
+ if (!avm.getBoolean(Arg.NOSTRUCTURE))
+ {
+ AlignFrame af = afMap.get(id);
+ if (avm.hasValue(Arg.STRUCTURE))
+ {
+ for (ArgValue av : avm.getArgValueList(Arg.STRUCTURE))
+ {
+ String val = av.getValue();
+ SubVals subId = new SubVals(val);
+ SequenceI seq = getSpecifiedSequence(af, subId);
+ if (seq == null)
+ {
+ Console.warn("Could not find sequence for argument --"
+ + Arg.STRUCTURE + "=" + val);
+ // you probably want to continue here, not break
+ // break;
+ continue;
+ }
+ File structureFile = null;
+ if (subId.getContent() != null
+ && subId.getContent().length() != 0)
+ {
+ structureFile = new File(subId.getContent());
+ Console.debug("Using structure file (from argument) '"
+ + structureFile.getAbsolutePath() + "'");
+ }
+ /* THIS DOESN'T WORK */
+ else if (seq.getAllPDBEntries() != null
+ && seq.getAllPDBEntries().size() > 0)
+ {
+ structureFile = new File(
+ seq.getAllPDBEntries().elementAt(0).getFile());
+ Console.debug("Using structure file (from sequence) '"
+ + structureFile.getAbsolutePath() + "'");
+ }
+
+ if (structureFile == null)
+ {
+ Console.warn("Not provided structure file with '" + val + "'");
+ continue;
+ }
+
+ if (!structureFile.exists())
+ {
+ Console.warn("Structure file '"
+ + structureFile.getAbsoluteFile() + "' not found.");
+ continue;
+ }
+
+ Console.debug("Using structure file "
+ + structureFile.getAbsolutePath());
+
+ // open structure view
+ AlignmentPanel ap = af.alignPanel;
+ StructureChooser.openStructureFileForSequence(ap, seq,
+ structureFile);
+ }