Mercurial > cgi-bin > hgweb.cgi > ImagePrep
comparison src/name/blackcap/imageprep/SettingsDialog.kt @ 22:d3979a2155a8
Fix out qual and max dim controls.
author | David Barts <n5jrn@me.com> |
---|---|
date | Mon, 23 Nov 2020 15:45:04 -0800 |
parents | 0f3634a0816d |
children | 9bf3d8de6904 |
comparison
equal
deleted
inserted
replaced
21:0f3634a0816d | 22:d3979a2155a8 |
---|---|
9 import java.io.BufferedWriter | 9 import java.io.BufferedWriter |
10 import java.io.File | 10 import java.io.File |
11 import java.io.FileOutputStream | 11 import java.io.FileOutputStream |
12 import java.io.IOException | 12 import java.io.IOException |
13 import java.io.OutputStreamWriter | 13 import java.io.OutputStreamWriter |
14 import java.util.Hashtable | |
15 import java.util.Properties | 14 import java.util.Properties |
16 import java.util.logging.Level | 15 import java.util.logging.Level |
17 import java.util.logging.Logger | 16 import java.util.logging.Logger |
18 import javax.swing.* | 17 import javax.swing.* |
19 import javax.swing.event.ChangeEvent | |
20 import javax.swing.event.ChangeListener | |
21 import kotlin.math.log10 | |
22 import kotlin.math.pow | |
23 import kotlin.math.roundToInt | |
24 import kotlin.text.toInt | 18 import kotlin.text.toInt |
25 | 19 |
26 /* work around name shadowing */ | 20 /* work around name shadowing */ |
27 private val _PROPS = PROPERTIES | 21 private val _PROPS = PROPERTIES |
28 | 22 |
128 contentPane.apply { | 122 contentPane.apply { |
129 layout = BoxLayout(this, BoxLayout.Y_AXIS) | 123 layout = BoxLayout(this, BoxLayout.Y_AXIS) |
130 add(Box(BoxLayout.X_AXIS).apply { | 124 add(Box(BoxLayout.X_AXIS).apply { |
131 alignmentX = LEFT_ALIGNMENT | 125 alignmentX = LEFT_ALIGNMENT |
132 border = BorderFactory.createEmptyBorder(BW2, BW2, BW, BW2) | 126 border = BorderFactory.createEmptyBorder(BW2, BW2, BW, BW2) |
133 add(leftLabel("Maximum dimension: ")) | 127 add(leftLabel("Default maximum dimension: ")) |
134 add(_maxDimension) | 128 add(_maxDimension) |
135 add(Box.createGlue()) | 129 add(Box.createGlue()) |
136 add(leftLabel("Output quality: ")) | 130 add(leftLabel("Default output quality: ")) |
137 add(_outputQuality) | 131 add(_outputQuality) |
138 }) | 132 }) |
139 add(Box(BoxLayout.X_AXIS).apply { | 133 add(Box(BoxLayout.X_AXIS).apply { |
140 alignmentX = LEFT_ALIGNMENT | 134 alignmentX = LEFT_ALIGNMENT |
141 border = BorderFactory.createEmptyBorder(BW, BW2, BW, BW2) | 135 border = BorderFactory.createEmptyBorder(BW, BW2, BW, BW2) |
163 add(Box.createGlue()) | 157 add(Box.createGlue()) |
164 add(_ok) | 158 add(_ok) |
165 add(Box.createGlue()) | 159 add(Box.createGlue()) |
166 }) | 160 }) |
167 } | 161 } |
168 rootPane.setDefaultButton(_ok) | |
169 pack() | 162 pack() |
170 setResizable(false) | 163 setResizable(false) |
171 } | 164 } |
172 | 165 |
173 private fun leftLabel(text: String) = JLabel(text).apply { | 166 private fun leftLabel(text: String) = JLabel(text).apply { |