comparison src/name/blackcap/exifwasher/WashDialog.kt @ 8:88d02fa97d78

Got WasherDialog table laying out somewhat sanely.
author David Barts <n5jrn@me.com>
date Fri, 10 Apr 2020 15:09:36 -0700
parents 65d14d44bc3f
children 0a106e9b91b4
comparison
equal deleted inserted replaced
7:65d14d44bc3f 8:88d02fa97d78
81 "Unable to read metadata.", 81 "Unable to read metadata.",
82 "Error", JOptionPane.ERROR_MESSAGE) 82 "Error", JOptionPane.ERROR_MESSAGE)
83 } else { 83 } else {
84 myTable.run { 84 myTable.run {
85 model = MyTableModel(tableData, COLUMN_NAMES) 85 model = MyTableModel(tableData, COLUMN_NAMES)
86 columnModel.run { 86 autoResizeMode = JTable.AUTO_RESIZE_OFF
87 getColumn(0).run { 87 setColWidth(0, 0, COLUMN_NAMES[0])
88 preferredWidth = 10 88 setColWidth(1, 180, null)
89 maxWidth = 850000000 /* xxx - don't ask */ 89 setColWidth(2, 72, "Undefined")
90 } 90 setColWidth(3, 720, null)
91 getColumn(1).preferredWidth = 100 /* key name */ 91 setOverallWidth()
92 getColumn(2).preferredWidth = 5 /* type */
93 getColumn(3).preferredWidth = 200 /* value */
94 }
95 autoResizeMode = JTable.AUTO_RESIZE_LAST_COLUMN
96 } 92 }
97 setVisible(true) 93 setVisible(true)
98 } 94 }
99 } 95 }
100 } 96 }
198 border = BorderFactory.createEmptyBorder(BW, BW, BW, BW) 194 border = BorderFactory.createEmptyBorder(BW, BW, BW, BW)
199 add(JScrollPane(myTable).apply { 195 add(JScrollPane(myTable).apply {
200 alignmentX = JScrollPane.LEFT_ALIGNMENT 196 alignmentX = JScrollPane.LEFT_ALIGNMENT
201 border = BorderFactory.createEmptyBorder(BW, BW, BW, BW) 197 border = BorderFactory.createEmptyBorder(BW, BW, BW, BW)
202 verticalScrollBarPolicy = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS 198 verticalScrollBarPolicy = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
203 horizontalScrollBarPolicy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER 199 horizontalScrollBarPolicy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS
204 preferredSize = Dimension(WIDTH, HEIGHT) 200 preferredSize = Dimension(WIDTH, HEIGHT)
205 background = Application.mainFrame.background 201 background = Application.mainFrame.background
206 }) 202 })
207 add(selectAll.apply { 203 add(selectAll.apply {
208 alignmentX = JCheckBox.LEFT_ALIGNMENT 204 alignmentX = JCheckBox.LEFT_ALIGNMENT
213 alignmentX = Box.CENTER_ALIGNMENT 209 alignmentX = Box.CENTER_ALIGNMENT
214 border = BorderFactory.createEmptyBorder(BW, BW, BW2, BW) 210 border = BorderFactory.createEmptyBorder(BW, BW, BW2, BW)
215 add(resetButton) 211 add(resetButton)
216 add(Box.createHorizontalGlue()) 212 add(Box.createHorizontalGlue())
217 add(cancelButton) 213 add(cancelButton)
214 add(Box.createHorizontalStrut(BW2))
218 add(washButton) 215 add(washButton)
219 }) 216 })
220 } 217 }
221 pack() 218 pack()
222 } 219 }