Mercurial > cgi-bin > hgweb.cgi > ImagePrep
comparison src/name/blackcap/imageprep/Main.kt @ 0:e0efe7848130
Initial commit. Untested!
author | David Barts <davidb@stashtea.com> |
---|---|
date | Thu, 16 Jul 2020 19:57:23 -0700 |
parents | |
children | 5234e4500d45 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e0efe7848130 |
---|---|
1 /* | |
2 * Entry point, etc. | |
3 */ | |
4 package name.blackcap.imageprep | |
5 | |
6 import javax.swing.UIManager | |
7 import java.util.logging.Level | |
8 import java.util.logging.Logger | |
9 | |
10 object Application { | |
11 /* name we call ourselves */ | |
12 val MYNAME = "ImagePrep" | |
13 | |
14 /* global UI objects */ | |
15 var mainFrame: MainFrame by setOnce() | |
16 var helpDialog: HelpDialog by setOnce() | |
17 | |
18 fun initialize() { | |
19 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); | |
20 mainFrame = MainFrame() /* must be created first */ | |
21 mainFrame.jMenuBar = MyMenuBar() | |
22 setMacMenus() /* always safe to call; no-op if not a Mac */ | |
23 helpDialog = HelpDialog() | |
24 mainFrame.setVisible(true) | |
25 } | |
26 } | |
27 | |
28 fun main(args: Array<String>) { | |
29 LOGGER.log(Level.INFO, "beginning execution") | |
30 if (OS.type == OS.MAC) { | |
31 System.setProperty("apple.laf.useScreenMenuBar", "true") | |
32 } | |
33 inSwingThread { | |
34 Application.initialize() | |
35 } | |
36 } |