import jalview.bin.ArgParser.SubVals;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.annotations.AlphaFoldAnnotationRowBuilder;
import jalview.gui.AlignFrame;
import jalview.gui.AlignmentPanel;
+import jalview.gui.AssociatePdbFileWithSeq;
import jalview.gui.Desktop;
+import jalview.gui.Preferences;
import jalview.gui.StructureChooser;
+import jalview.gui.StructureViewer;
import jalview.io.AppletFormatAdapter;
import jalview.io.DataSourceType;
import jalview.io.FileFormatException;
if (first)
{
first = false;
- if (!headless)
+ if (!headless && desktop != null)
{
desktop.setProgressBar(
MessageManager.getString(
Console.debug("Using structure file "
+ structureFile.getAbsolutePath());
+ PDBEntry fileEntry = new AssociatePdbFileWithSeq()
+ .associatePdbWithSeq(structureFile.getAbsolutePath(),
+ DataSourceType.FILE, seq, true, Desktop.instance);
+
// open structure view
AlignmentPanel ap = af.alignPanel;
+ if (headless)
+ {
+ Cache.setProperty(Preferences.STRUCTURE_DISPLAY,
+ StructureViewer.ViewerType.JMOL.toString());
+ }
StructureChooser.openStructureFileForSequence(ap, seq,
structureFile);
}
if (argparser.isSet(Arg.HEADLESS))
headless = argparser.getBool(Arg.HEADLESS);
- boolean commandsSuccess = Commands.processArgs(argparser, headless);
- if (commandsSuccess)
- {
- Console.info("Successfully completed commands");
- if (headless)
- System.exit(0);
- }
- else
- {
- Console.warn("Error when running commands");
- if (headless)
- System.exit(1);
- }
if (!Platform.isJS())
/**
}
}
}
+ // Run Commands from cli
+ boolean commandsSuccess = Commands.processArgs(argparser, headless);
+ if (commandsSuccess)
+ {
+ Console.info("Successfully completed commands");
+ if (headless)
+ System.exit(0);
+ }
+ else
+ {
+ Console.warn("Error when running commands");
+ if (headless)
+ System.exit(1);
+ }
// Check if JVM and compile version might cause problems and log if it
// might.
ourOptions = Arrays.asList(options);
int response;
- if (parentComponent != this)
+ if (parentComponent != this
+ && !(parentComponent == null && Desktop.instance == null))
{
- JInternalFrame jif = this.createInternalFrame(parentComponent, title);
+ JInternalFrame jif = this.createInternalFrame(
+ parentComponent != null ? parentComponent : Desktop.instance,
+ title);
jif.setFrameIcon(null);
jif.addInternalFrameListener(new InternalFrameListener()
{