comparison src/name/blackcap/exifwasher/ShowDialog.kt @ 5:dc1f4359659d

Got it compiling.
author David Barts <n5jrn@me.com>
date Thu, 09 Apr 2020 18:20:34 -0700
parents 19c381c536ec
children 65d14d44bc3f
comparison
equal deleted inserted replaced
4:ba5dc14652da 5:dc1f4359659d
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.Dimension
7 import java.awt.event.ActionEvent 8 import java.awt.event.ActionEvent
8 import java.awt.event.ActionListener 9 import java.awt.event.ActionListener
9 import java.io.File 10 import java.io.File
10 import java.io.IOException 11 import java.io.IOException
11 import java.util.logging.Level 12 import java.util.logging.Level
44 title = "Washed: ${image.name}" 45 title = "Washed: ${image.name}"
45 useWaitCursor() 46 useWaitCursor()
46 swingWorker<Array<Array<String>>?> { 47 swingWorker<Array<Array<String>>?> {
47 inBackground { 48 inBackground {
48 try { 49 try {
49 val image = Image(image.absolutePath) 50 val openedImage = Image(image.absolutePath)
50 val meta = image.meta 51 val meta = openedImage.metadata
51 val keys = meta.keys 52 val keys = meta.keys
52 keys.sort() 53 keys.sort()
53 Array<Array<String>>(keys.size) { 54 Array<Array<String>>(keys.size) {
54 val key = keys[it] 55 val key = keys[it]
55 val value = meta[key] 56 val value = meta[key]
77 } 78 }
78 } 79 }
79 } 80 }
80 } 81 }
81 82
82 private class MyTableModel : DefaultTableModel { 83 private class MyTableModel(tData: Array<Array<String>>, cNames: Array<String>) : DefaultTableModel(tData, cNames) {
83 override fun isCellEditable(row: Int, col: Int) = false 84 override fun isCellEditable(row: Int, col: Int) = false
84 override fun getColumnClass(col: Int) = java.lang.String::class.java 85 override fun getColumnClass(col: Int) = String::class.java
85 } 86 }
86 87
87 init { 88 init {
88 defaultCloseOperation = JDialog.DISPOSE_ON_CLOSE /* delete if reusing */ 89 defaultCloseOperation = JDialog.DISPOSE_ON_CLOSE /* delete if reusing */
89 title = "Untitled" 90 title = "Untitled"