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