import java.util.Vector;
import javax.swing.LookAndFeel;
+import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import groovy.lang.Binding;
private boolean noAnnotation;
+ public static final String TERMINATOR_LINE = "Jalview argument parsing complete.";
+
public boolean getStartCalculations()
{
return !noCalculation;
|| "true".equals(System.getProperty("java.awt.headless")))
{
headless = true;
+ setSynchronous(true);
}
if (isJS)
System.exit(0);
}
-
// anything else!
final String jabawsUrl = aparser.getValue(ArgsParser.JABAWS);
try
{
if (!isJS && Platform.isWin())
- {
+ {
UIManager.setLookAndFeel(
headless ? "javax.swing.plaf.metal.MetalLookAndFeel"
: UIManager.getSystemLookAndFeelClassName());
-// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
} catch (Exception ex)
{
SequenceOntologyFactory.setSequenceOntology(new SequenceOntology());
}
- if (!headless)
+ if (headless)
+ {
+ // If this is not tested, then
+
+ if (aparser.contains(ArgsParser.NOUSAGESTATS))
+ {
+ System.err.println("CMD [-nousagestats] executed successfully!");
+ }
+ if (aparser.contains(ArgsParser.NOQUESTIONNAIRE))
+ {
+ System.err.println("CMD [-noquestionnaire] executed successfully!");
+ }
+
+ }
+ else
{
desktop = Desktop.getInstance();
desktop.setInBatchMode(true); // indicate we are starting up
}
parseArguments(aparser, true);
+ System.err.println(TERMINATOR_LINE);
}
/**
// + " " + status);
}
-}
+ /**
+ * flag to allow selected Runnable and Thread processes to run synchronously
+ *
+ * JAL-3563
+ *
+ */
+ private static boolean isSynchronous = false;
+
+ /**
+ * Set Jalview to run selected processes synchronously in test and headless
+ * environments.
+ *
+ * JAL-3563
+ *
+ * @param b
+ * @author Bob Hanson
+ */
+ public static void setSynchronous(boolean b)
+ {
+ isSynchronous = b;
+ }
+
+ /**
+ * Allows optional synchronous running of a Runnable that would otherwise use
+ * SwingUtilities.invokeLater.
+ *
+ * JAL-3563
+ *
+ * @param t
+ * @author Bob Hanson
+ */
+ public static boolean isSynchronous()
+ {
+ return isSynchronous;
+ }
+
+ /**
+ * Allows optional synchronous running of a Runnable that would otherwise use
+ * SwingUtilities.invokeLater.
+ *
+ * JAL-3563
+ *
+ * @param t
+ * @author Bob Hanson
+ */
+ public static void execRunnable(Runnable r)
+ {
+ if (isSynchronous())
+ {
+ r.run();
+ }
+ else
+ {
+ SwingUtilities.invokeLater(r);
+ }
+ }
+
+ /**
+ * Allows optional synchronous running of a thread that would otherwise be run
+ * using start().
+ *
+ * JAL-3563
+ *
+ * @param t
+ * @author Bob Hanson
+ */
+ public static void execThread(Thread t)
+ {
+ if (isSynchronous())
+ {
+ t.run();
+ }
+ else
+ {
+ t.start();
+ }
+ }
+}
\ No newline at end of file