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