X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fbin%2FJalviewJS2.java;h=26110f85c6f2d8c41d9dd1dfd1ed0717f7bac318;hb=e42524a147f92c836a0a336dde394394976216d2;hp=516cc200863c856b750fa5af4b4f74916e4129ed;hpb=d18f36d6bb22fa26f13ea1857d3ec644e854432e;p=jalview.git diff --git a/src/jalview/bin/JalviewJS2.java b/src/jalview/bin/JalviewJS2.java index 516cc20..26110f8 100644 --- a/src/jalview/bin/JalviewJS2.java +++ b/src/jalview/bin/JalviewJS2.java @@ -1,5 +1,12 @@ package jalview.bin; +import jalview.util.Platform; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.Timer; + /** * Entry point for JalviewJS development. * @@ -13,26 +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(); +} + +protected static int focusTime = 0; + + 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; + + s += " " + (++focusTime); + + /** @j2sNative document.title = s; */ + } + + }); + + t.setRepeats(true); + t.start(); + } }