X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalviewJS2.java;h=26110f85c6f2d8c41d9dd1dfd1ed0717f7bac318;hb=a9f2db2f1688164dd54da7521509c135d7fdf042;hp=eff5334507721f4e1cd74ce7d0fd5388017fc7d2;hpb=31b84e9690b026255a488724ef7b847da94e48af;p=jalview.git diff --git a/src/jalview/bin/JalviewJS2.java b/src/jalview/bin/JalviewJS2.java index eff5334..26110f8 100644 --- a/src/jalview/bin/JalviewJS2.java +++ b/src/jalview/bin/JalviewJS2.java @@ -1,5 +1,7 @@ package jalview.bin; +import jalview.util.Platform; + import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -18,51 +20,46 @@ public class JalviewJS2 static { /** - * --j2sNative + * @j2sNative * - * thisApplet.__Info.args = + * J2S.thisApplet.__Info.args = * ["open","examples/uniref50.fa","features", * "examples/exampleFeatures.txt"]; */ - - - /** - * @j2sNative - * - * thisApplet.__Info.args = - * ["open","examples/jaxbtest.jvx"]; - */ - } public static void main(String[] args) throws Exception { Jalview.main(args); - showFocusTimer(); + //showFocusTimer(); } protected static int focusTime = 0; -private static void showFocusTimer() { - - Timer t = new Timer(100, new ActionListener() { + private static void showFocusTimer() + { + + if (Platform.isJS()) + { + Timer t = new Timer(100, new ActionListener() + { - @Override - public void actionPerformed(ActionEvent e) { - String s = /** @j2sNative document.activeElement.id || */ - null; + @Override + public void actionPerformed(ActionEvent e) + { + String s = /** @j2sNative document.activeElement.id || */ + null; - s += " " + (++focusTime); + s += " " + (++focusTime); - /** @j2sNative document.title = s; */ - } + /** @j2sNative document.title = s; */ + } - }); + }); - t.setRepeats(true); - if (/** @j2sNative true || */ - false) - t.start(); + t.setRepeats(true); + t.start(); + } }