comparison src/name/blackcap/imageprep/Misc.kt @ 16:2bb46da74667

Detect unsupported file types on input.
author David Barts <n5jrn@me.com>
date Mon, 20 Jul 2020 12:56:07 -0700
parents 884f1415a330
children
comparison
equal deleted inserted replaced
15:fad32eda667f 16:2bb46da74667
231 border = b 231 border = b
232 else 232 else
233 border = BorderFactory.createCompoundBorder(b, border) 233 border = BorderFactory.createCompoundBorder(b, border)
234 } 234 }
235 235
236 /**
237 * Display an error dialog pertaining to an IOException.
238 *
239 * @param parent Parent component for this dialog
240 * @param file java.io.File object associated with this error
241 * @param op Operation that failed (e.g. "read", "write", etc.)
242 * @param e An IOException
243 */
236 fun ioExceptionDialog(parent: Component, file: File, op: String, e: IOException) { 244 fun ioExceptionDialog(parent: Component, file: File, op: String, e: IOException) {
237 val msg = e.message 245 val msg = e.message
238 val fileName = file.getName() 246 val fileName = file.getName()
239 val dmsg = if (msg.isNullOrEmpty()) { 247 val dmsg = if (msg.isNullOrEmpty()) {
240 "Unable to ${op} ${fileName}." 248 "Unable to ${op} ${fileName}."