a323ffa296be7a9367a5631e7b11afff7e3939b7
[jalview.git] / src / jalview / bin / JalviewJS2.java
1 package jalview.bin;
2
3 import jalview.util.Platform;
4
5 import java.awt.event.ActionEvent;
6 import java.awt.event.ActionListener;
7
8 import javax.swing.Timer;
9
10 /**
11  * Entry point for JalviewJS development.
12  * 
13  * 
14  * 
15  * @author RM
16  *
17  */
18 public class JalviewJS2
19 {
20
21   static
22   {
23     /**
24      * @j2sNative
25      * 
26      *            J2S.thisApplet.__Info.args =
27      *            ["open","examples/uniref50.fa","features",
28      *            "examples/exampleFeatures.txt"];
29      */
30   }
31
32   public static void main(String[] args) throws Exception
33   {
34     Jalview.main(args);
35     // showFocusTimer();
36   }
37
38   protected static int focusTime = 0;
39
40   private static void showFocusTimer()
41   {
42
43     if (Platform.isJS())
44     {
45       Timer t = new Timer(100, new ActionListener()
46       {
47
48         @Override
49         public void actionPerformed(ActionEvent e)
50         {
51           String s = /** @j2sNative document.activeElement.id || */
52                   null;
53
54           s += " " + (++focusTime);
55
56           /** @j2sNative document.title = s; */
57         }
58
59       });
60
61       t.setRepeats(true);
62       t.start();
63     }
64   }
65
66 }