Mercurial > cgi-bin > hgweb.cgi > ImagePrep
view 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 |
line wrap: on
line source
/* * Entry point, etc. */ package name.blackcap.imageprep import java.io.File import java.util.logging.Level import java.util.logging.Logger import javax.swing.UIManager import name.blackcap.kcli.CommandLine import name.blackcap.kcli.InvalidArgumentException import name.blackcap.kcli.Option import name.blackcap.kcli.PromptingParser import org.apache.commons.cli.HelpFormatter import org.apache.commons.cli.Options import org.apache.commons.cli.ParseException object Application { /* name we call ourselves */ val MYNAME = "ImagePrep" /* global UI objects */ var mainFrame: MainFrame by setOnce() var helpDialog: HelpDialog by setOnce() var settingsDialog: SettingsDialog by setOnce() fun initialize() { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); mainFrame = MainFrame() /* must be created first */ settingsDialog = SettingsDialog() mainFrame.jMenuBar = MyMenuBar() setMacMenus() /* always safe to call; no-op if not a Mac */ helpDialog = HelpDialog() mainFrame.setVisible(true) } } fun main(args: Array<String>) { /* start up */ LOGGER.log(Level.INFO, "beginning execution") if (OS.type == OS.MAC) { System.setProperty("apple.laf.useScreenMenuBar", "true") } /* launch GUI */ inSwingThread { Application.initialize() } }