1ed9f274c2d8e03959f30f01acabf0d80513940d
[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"
38           , "noannotation"
39           , "showoverview"
40       };
41     }
42     Jalview.main(args);
43         //showFocusTimer();
44 }
45
46 protected static int focusTime = 0;
47
48   private static void showFocusTimer()
49   {
50
51     if (Platform.isJS())
52     {
53       Timer t = new Timer(100, new ActionListener()
54       {
55
56         @Override
57         public void actionPerformed(ActionEvent e)
58         {
59           String s = /** @j2sNative document.activeElement.id || */
60                   null;
61
62           s += " " + (++focusTime);
63
64           /** @j2sNative document.title = s; */
65         }
66
67       });
68
69       t.setRepeats(true);
70       t.start();
71     }
72   }
73
74
75 }