Normand Briere
2018-07-07 ecaf579303705545735450cbc8b8014d7e062329
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package timeflow.app;
 
import timeflow.model.*;
 
import javax.swing.*;
import java.awt.event.*;
 
// For some reason we have to do this in a separate class in order to
// get the menubar working right on the Mac.
public class TimeflowAppLauncher
{
        public static void main(String[] args) throws Exception
        {
                System.setProperty("apple.laf.useScreenMenuBar", "true");
                System.setProperty("com.apple.mrj.application.apple.menu.about.name", "TimeFlow");
                System.out.println("Running " + Display.version());
 
                try
                {
                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                } catch (Exception e)
                {
                        System.out.println("Can't set system look & feel");
                }
                
                GetTimeFlow();
        }
 
        public static TimeflowApp GetTimeFlow()
        {
                final TimeflowApp t = new TimeflowApp();
                t.splash = new AboutWindow(t, t.model.getDisplay());
                t.splash(true);
                SwingUtilities.invokeLater(new Runnable()
                {
 
                        @Override
                        public void run()
                        {
                                try
                                {
                                        t.init();
                                        t.setVisible(true);
                                } catch (Exception e)
                                {
                                        e.printStackTrace(System.out);
                                }
                                t.splash.addMouseListener(new MouseAdapter()
                                {
 
                                        @Override
                                        public void mouseClicked(MouseEvent e)
                                        {
                                                t.splash.setVisible(false);
                                        }
                                });
                                t.splash(false);
                                //t.splash.message=t.model.getDisplay().version();
                        }
                });
                
                return t;
        }
}