annotate src/name/blackcap/exifwasher/Main.kt @ 3:19c381c536ec

Code to make it a proper Mac GUI app. Untested!
author David Barts <n5jrn@me.com>
date Wed, 08 Apr 2020 20:29:12 -0700
parents
children dc1f4359659d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
1 /*
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
2 * Entry point, etc.
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
3 */
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
4 package name.blackcap.exifwasher
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
5
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
6 import javax.swing.UIManager
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
7
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
8 object Application {
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
9 /* name we call ourselves */
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
10 val MYNAME = "ExifWasher"
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
11
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
12 /* global UI objects */
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
13 var mainFrame: MainFrame by SetOnce<MainFrame>()
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
14 var settingsDialog: SettingsDialog by SetOnce<SettingsDialog>()
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
15
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
16 fun initialize() {
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
17 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
18 mainFrame = MainFrame() /* must be created first */
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
19 settingsDialog = SettingsDialog()
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
20 mainFrame.setVisible(true)
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
21 }
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
22 }
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
23
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
24 fun main(args: Array<String>) {
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
25 LOGGER.log(Level.INFO, "beginning execution")
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
26 if (OS.type == OS.MAC) {
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
27 System.setProperty("apple.laf.useScreenMenuBar", "true")
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
28 }
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
29 inSwingThread {
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
30 Application.initialize()
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
31 }
19c381c536ec Code to make it a proper Mac GUI app. Untested!
David Barts <n5jrn@me.com>
parents:
diff changeset
32 }