X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalviewJS2.java;h=5079dee80619ec6e6f30c60644e9557747c77e22;hb=55b1dd41a30dfec6983f6380c7890a729f940792;hp=037f41eb125d49c104f52337af28929b1f853660;hpb=7977bb38c5ea8f5cbf6c3428e6fdfbd5aba764cd;p=jalview.git diff --git a/src/jalview/bin/JalviewJS2.java b/src/jalview/bin/JalviewJS2.java index 037f41e..5079dee 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,18 +20,52 @@ public class JalviewJS2 static { /** - * @j2sNative + * @ could do it this way: + * + * j2sNative * - * thisApplet.__Info.args = - * ["open","http://www.jalview.org/builds/release/examples/uniref50.fa","features", - * "http://www.jalview.org/builds/release/examples/exampleFeatures.txt"]; + * J2S.thisApplet.__Info.args = [ "open","examples/uniref50.fa", + * "features","examples/exampleFeatures.txt" ]; */ - } public static void main(String[] args) throws Exception { + if (args.length == 0) + { + args = new String[] { "open", "examples/uniref50.fa", "features", + "examples/exampleFeatures.txt" }; + } 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(); + } }