comparison src/name/blackcap/exifwasher/ShowDialog.kt @ 10:9bbe6d803eba

Fixed ShowDialog.
author David Barts <n5jrn@me.com>
date Fri, 10 Apr 2020 19:29:58 -0700
parents 0a106e9b91b4
children 39b977021ea1
comparison
equal deleted inserted replaced
9:0a106e9b91b4 10:9bbe6d803eba
2 * The dialog that displays the Exif data in a single file (display only, 2 * The dialog that displays the Exif data in a single file (display only,
3 * no changing). We do this after washing. 3 * no changing). We do this after washing.
4 */ 4 */
5 package name.blackcap.exifwasher 5 package name.blackcap.exifwasher
6 6
7 import java.awt.Color
7 import java.awt.Dimension 8 import java.awt.Dimension
8 import java.awt.event.ActionEvent 9 import java.awt.event.ActionEvent
9 import java.awt.event.ActionListener 10 import java.awt.event.ActionListener
10 import java.io.File 11 import java.io.File
11 import java.io.IOException 12 import java.io.IOException
25 private val HEIGHT = 480 26 private val HEIGHT = 480
26 27
27 private val COLUMN_NAMES = arrayOf<String>("Key", "Type", "Value") 28 private val COLUMN_NAMES = arrayOf<String>("Key", "Type", "Value")
28 private val myTable = JTable(arrayOf<Array<Any>>(), COLUMN_NAMES).apply { 29 private val myTable = JTable(arrayOf<Array<Any>>(), COLUMN_NAMES).apply {
29 autoCreateRowSorter = false 30 autoCreateRowSorter = false
31 border = BorderFactory.createLineBorder(Color.GRAY)
32 gridColor = Color.GRAY
30 rowSorter = null 33 rowSorter = null
34 setShowGrid(true)
31 } 35 }
32 36
33 /* deliberately not the default, because this changes a file */ 37 /* deliberately not the default, because this changes a file */
34 private val dismissButton = JButton("Dismiss").also { 38 private val dismissButton = JButton("Dismiss").also {
35 it.addActionListener(ActionListener { close() }) 39 it.addActionListener(ActionListener { close() })
36 it.border = BorderFactory.createEmptyBorder(0, BW, 0, BW)
37 } 40 }
38 41
39 /* controls the washing of the Exif data */ 42 /* controls the washing of the Exif data */
40 fun show(image: File) { 43 fun show(image: File) {
41 title = "Washed: ${image.name}" 44 title = "Washed: ${image.name}"
97 preferredSize = Dimension(WIDTH, HEIGHT) 100 preferredSize = Dimension(WIDTH, HEIGHT)
98 background = Application.mainFrame.background 101 background = Application.mainFrame.background
99 }) 102 })
100 add(Box(BoxLayout.X_AXIS).apply { 103 add(Box(BoxLayout.X_AXIS).apply {
101 alignmentX = Box.CENTER_ALIGNMENT 104 alignmentX = Box.CENTER_ALIGNMENT
102 border = BorderFactory.createEmptyBorder(BW, BW, BW2, BW) 105 border = BorderFactory.createEmptyBorder(BW, BW2, BW2, BW2)
103 add(Box.createHorizontalGlue()) 106 add(Box.createHorizontalGlue())
104 add(dismissButton) 107 add(dismissButton)
105 }) 108 })
106 } 109 }
107 pack() 110 pack()