view src/name/blackcap/exifwasher/Main.kt @ 53:61a06e050bac

Fix help dialog.
author David Barts <n5jrn@me.com>
date Thu, 07 May 2020 12:33:52 -0700
parents fb407182ba76
children
line wrap: on
line source

/*
 * Entry point, etc.
 */
package name.blackcap.exifwasher

import javax.swing.UIManager
import java.util.logging.Level
import java.util.logging.Logger

object Application {
    /* name we call ourselves */
    val MYNAME = "JpegWasher"

    /* global UI objects */
    var mainFrame: MainFrame by setOnce()
    var settingsDialog: SettingsDialog by setOnce()
    var helpDialog: HelpDialog by setOnce()

    fun initialize() {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        mainFrame = MainFrame() /* must be created first */
        mainFrame.jMenuBar = MyMenuBar()
        setMacMenus() /* always safe to call; no-op if not a Mac */
        settingsDialog = SettingsDialog()
        helpDialog = HelpDialog()
        mainFrame.setVisible(true)
    }
}

fun main(args: Array<String>) {
    LOGGER.log(Level.INFO, "beginning execution")
    if (OS.type == OS.MAC) {
        System.setProperty("apple.laf.useScreenMenuBar", "true")
    }
    inSwingThread {
        Application.initialize()
    }
}