JAL-3446 test for simpler key mask operation
[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[] {
37         //  "headless",
38           "open", "examples/uniref50.fa",
39           "features",
40           "examples/exampleFeatures.txt"
41           , "noannotation"
42           , "showoverview"
43         //  , "png", "test-bh.png"
44       };
45     }
46
47     // String cmds = "nodisplay -open examples/uniref50.fa -sortbytree -props
48     // test/jalview/io/testProps.jvprops -colour zappo "
49     // + "-jabaws http://www.compbio.dundee.ac.uk/jabaws -nosortbytree "
50     // + "-features examples/testdata/plantfdx.features -annotations
51     // examples/testdata/plantfdx.annotations -tree
52     // examples/testdata/uniref50_test_tree";
53     // args = cmds.split(" ");
54     Jalview.main(args);
55         //showFocusTimer();
56 }
57
58 protected static int focusTime = 0;
59
60   private static void showFocusTimer()
61   {
62
63     if (Platform.isJS())
64     {
65       Timer t = new Timer(100, new ActionListener()
66       {
67
68         @Override
69         public void actionPerformed(ActionEvent e)
70         {
71           String s = /** @j2sNative document.activeElement.id || */
72                   null;
73
74           s += " " + (++focusTime);
75
76           /** @j2sNative document.title = s; */
77         }
78
79       });
80
81       t.setRepeats(true);
82       t.start();
83     }
84   }
85
86
87 }