import jalview.util.Platform;
import jalview.ws.jws2.Jws2Discoverer;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.util.logging.Logger;
import javax.swing.LookAndFeel;
-import javax.swing.Timer;
import javax.swing.UIManager;
import groovy.lang.Binding;
*/
public class Jalview
{
- /**
- * @j2sNative
- *
- * // find first query parameter (if any) that doesn't start with j2s
- * // and set as space-delimited arguments to Jalview main
- * hr = decodeURI(document.location.href);
- * pos = hr.indexOf("?");
- * if (pos > 0)
- * {
- * q = hr.substring(pos+1);
- * args = q.split("&");
- * for (i = 0 ; i < args.length; i++)
- * {
- * arg1 = args[i];
- * if (!arg1.startsWith("j2s"))
- * {
- * thisApplet.__Info.args = arg1.split(" ");
- * break;
- * }
- * }
- * }
- */
-
- /*
- * singleton instance of this class
- */
+ static
+ {
+ Platform.getURLCommandArguments();
+ }
+
+ // singleton instance of this class
+
private static Jalview instance;
private Desktop desktop;
static
{
if (!Platform.isJS())
- { // BH 2018
- // grab all the rights we can for the JVM
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
+ {
+ // grab all the rights we can for the JVM
Policy.setPolicy(new Policy()
{
@Override
@SuppressWarnings("unused")
private static void setLogging()
{
+
+ /**
+ * @j2sIgnore
+ *
+ */
+ {
+ System.out.println("not in js");
+ }
+
// BH - for event debugging in JavaScript (Java mode only)
- if (!(/** @j2sNative true ||*/false))
+ if (!Platform.isJS())
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
{
Logger.getLogger("").setLevel(Level.ALL);
logClass("java.awt.EventDispatchThread");
"CMD [-props " + usrPropsFile + "] executed successfully!");
}
+ if (!Platform.isJS())
/**
- * BH 2018 ignoring this section for JS
+ * Java only
*
- * @j2sNative
+ * @j2sIgnore
*/
{
if (aparser.contains("help") || aparser.contains("h"))
desktop.setInBatchMode(true); // indicate we are starting up
desktop.setVisible(true);
+ if (!Platform.isJS())
/**
- * BH 2018 JS bypass this section
- *
- * @j2sNative
+ * Java only
*
+ * @j2sIgnore
*/
{
desktop.startServiceDiscovery();
}
System.out.println("CMD [-open " + file + "] executed successfully!");
- if (!Platform.isJS() && !file.startsWith("http://"))
+ if (!Platform.isJS())
+ /**
+ * ignore in JavaScript -- can't just file existence - could load it?
+ *
+ * @j2sIgnore
+ */
{
- if (!(new File(file)).exists())
+ if (!file.startsWith("http://") && !file.startsWith("https://"))
+ // BH 2019 added https check for Java
{
- System.out.println("Can't find " + file);
- if (headless)
+ if (!(new File(file)).exists())
{
- System.exit(1);
+ System.out.println("Can't find " + file);
+ if (headless)
+ {
+ System.exit(1);
+ }
}
}
}
// And the user
// ////////////////////
- if (/** @j2sNative false && */ // BH 2018
- !headless && file == null && vamsasImport == null
+ if (!Platform.isJS() && !headless && file == null
+ && vamsasImport == null
&& jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
{
file = jalview.bin.Cache.getDefault("STARTUP_FILE",
jalview.bin.Cache.getDefault("www.jalview.org",