Mercurial > cgi-bin > hgweb.cgi > ImagePrep
annotate src/name/blackcap/imageprep/Main.kt @ 20:71029c9bf7cd
Commit overlooked files.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sat, 21 Nov 2020 10:15:35 -0800 |
parents | 5fa5d15b4a7b |
children | 92afaa27f40a |
rev | line source |
---|---|
0 | 1 /* |
2 * Entry point, etc. | |
3 */ | |
4 package name.blackcap.imageprep | |
5 | |
4
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
6 import java.io.File |
0 | 7 import java.util.logging.Level |
8 import java.util.logging.Logger | |
4
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
9 import javax.swing.UIManager |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
10 import name.blackcap.kcli.CommandLine |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
11 import name.blackcap.kcli.InvalidArgumentException |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
12 import name.blackcap.kcli.Option |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
13 import name.blackcap.kcli.PromptingParser |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
14 import org.apache.commons.cli.HelpFormatter |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
15 import org.apache.commons.cli.Options |
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
16 import org.apache.commons.cli.ParseException |
0 | 17 |
18 object Application { | |
19 /* name we call ourselves */ | |
20 val MYNAME = "ImagePrep" | |
21 | |
22 /* global UI objects */ | |
23 var mainFrame: MainFrame by setOnce() | |
24 var helpDialog: HelpDialog by setOnce() | |
19
5fa5d15b4a7b
Attempt to make it a std. app. Builds, sorta runs, needs more work.
David Barts <n5jrn@me.com>
parents:
5
diff
changeset
|
25 var settingsDialog: SettingsDialog by setOnce() |
0 | 26 |
27 fun initialize() { | |
28 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); | |
29 mainFrame = MainFrame() /* must be created first */ | |
19
5fa5d15b4a7b
Attempt to make it a std. app. Builds, sorta runs, needs more work.
David Barts <n5jrn@me.com>
parents:
5
diff
changeset
|
30 settingsDialog = SettingsDialog() |
0 | 31 mainFrame.jMenuBar = MyMenuBar() |
32 setMacMenus() /* always safe to call; no-op if not a Mac */ | |
33 helpDialog = HelpDialog() | |
34 mainFrame.setVisible(true) | |
35 } | |
36 } | |
37 | |
38 fun main(args: Array<String>) { | |
5
884f1415a330
Rationalized directory management.
David Barts <n5jrn@me.com>
parents:
4
diff
changeset
|
39 /* start up */ |
0 | 40 LOGGER.log(Level.INFO, "beginning execution") |
41 if (OS.type == OS.MAC) { | |
42 System.setProperty("apple.laf.useScreenMenuBar", "true") | |
43 } | |
4
5234e4500d45
Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
44 |
5
884f1415a330
Rationalized directory management.
David Barts <n5jrn@me.com>
parents:
4
diff
changeset
|
45 /* launch GUI */ |
0 | 46 inSwingThread { |
47 Application.initialize() | |
48 } | |
49 } |