26110f85c6f2d8c41d9dd1dfd1ed0717f7bac318
[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      * @j2sNative
24      * 
25      *            J2S.thisApplet.__Info.args =
26      *            ["open","examples/uniref50.fa","features",
27      *            "examples/exampleFeatures.txt"];
28      */
29   }
30
31   public static void main(String[] args) throws Exception
32   {
33     Jalview.main(args);
34         //showFocusTimer();
35 }
36
37 protected static int focusTime = 0;
38
39   private static void showFocusTimer()
40   {
41
42     if (Platform.isJS())
43     {
44       Timer t = new Timer(100, new ActionListener()
45       {
46
47         @Override
48         public void actionPerformed(ActionEvent e)
49         {
50           String s = /** @j2sNative document.activeElement.id || */
51                   null;
52
53           s += " " + (++focusTime);
54
55           /** @j2sNative document.title = s; */
56         }
57
58       });
59
60       t.setRepeats(true);
61       t.start();
62     }
63   }
64
65
66 }