comparison src/name/blackcap/imageprep/SettingsDialog.kt @ 30:098c4f5507c7

Convert to JDK 15.
author David Barts <n5jrn@me.com>
date Mon, 13 Jun 2022 11:31:49 -0700
parents 9bf3d8de6904
children
comparison
equal deleted inserted replaced
29:e90d290a9a8d 30:098c4f5507c7
25 class SettingsDialog: JDialog(Application.mainFrame) { 25 class SettingsDialog: JDialog(Application.mainFrame) {
26 /* maximum allowed dimension in output */ 26 /* maximum allowed dimension in output */
27 private val _maxDimension = MaxDimSpinner(_PROPS.getInt("maxDimension")) 27 private val _maxDimension = MaxDimSpinner(_PROPS.getInt("maxDimension"))
28 val maxDimension: Int 28 val maxDimension: Int
29 get() { 29 get() {
30 return _maxDimension.value as Int 30 return _maxDimension.value
31 } 31 }
32 32
33 /* JPEG output quality */ 33 /* JPEG output quality */
34 private val _outputQuality = OutQualSpinner(_PROPS.getInt("outputQuality")) 34 private val _outputQuality = OutQualSpinner(_PROPS.getInt("outputQuality"))
35 val outputQuality: Int 35 val outputQuality: Int
225 225
226 fun Properties.getBoolean(key: String): Boolean { 226 fun Properties.getBoolean(key: String): Boolean {
227 val raw = getProperty(key) 227 val raw = getProperty(key)
228 if (raw.isNullOrEmpty()) 228 if (raw.isNullOrEmpty())
229 return false 229 return false
230 val c1 = raw[0].toLowerCase() 230 val c1 = raw[0].lowercaseChar()
231 return c1 == 't' || c1 == 'y' 231 return c1 == 't' || c1 == 'y'
232 } 232 }
233 233
234 fun Properties.setBoolean(key: String, value: Boolean): Unit { 234 fun Properties.setBoolean(key: String, value: Boolean): Unit {
235 setProperty(key, value.toString()) 235 setProperty(key, value.toString())