annotate src/name/blackcap/imageprep/Osdep.kt @ 30:098c4f5507c7

Convert to JDK 15.
author David Barts <n5jrn@me.com>
date Mon, 13 Jun 2022 11:31:49 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
1 /*
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
2 * OS-dependent code, Mac version.
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
3 */
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
4 package name.blackcap.imageprep
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
5
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
6 import java.awt.Desktop
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
7 import java.awt.desktop.AboutHandler
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
8 import java.awt.desktop.PreferencesHandler
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
9 import java.awt.desktop.QuitStrategy
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
10
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
11 fun setMacMenus() {
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
12 if (OS.type == OS.MAC) {
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
13 Desktop.getDesktop().run {
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
14 setAboutHandler(AboutHandler({ showAboutDialog() }))
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
15 setPreferencesHandler(
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
16 PreferencesHandler({ Application.settingsDialog.setVisible(true) }))
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
17 setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS)
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
18 }
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
19 }
098c4f5507c7 Convert to JDK 15.
David Barts <n5jrn@me.com>
parents:
diff changeset
20 }