From 26eb10c52964acaf9c09d73a8ba52fcc48b6e178 Mon Sep 17 00:00:00 2001 From: Simon Scholz Date: Sun, 26 Nov 2023 18:06:28 +0100 Subject: [PATCH] Add Base64 logo for UI --- .../main/kotlin/io/github/simonscholz/Main.kt | 6 +- .../extension/BindingExtensions.kt | 4 +- .../io/github/simonscholz/model/Mapper.kt | 2 + .../github/simonscholz/model/QrCodeConfig.kt | 2 + .../model/QrCodeConfigViewModel.kt | 2 + ...ervable.kt => ButtonSelectedObservable.kt} | 2 +- .../simonscholz/service/ConfigService.kt | 52 +++++++++++++++--- .../simonscholz/service/ImageService.kt | 28 +++------- .../kotlin/io/github/simonscholz/ui/FileUI.kt | 19 +------ .../io/github/simonscholz/ui/ImageUI.kt | 2 +- .../ui/properties/LogoPropertiesUI.kt | 36 ++++++++++++ .../PositionalSquaresPropertiesUI.kt | 6 +- .../src/main/resources/dustbin_remove16.png | Bin 0 -> 189 bytes 13 files changed, 104 insertions(+), 57 deletions(-) rename qr-code-app/src/main/kotlin/io/github/simonscholz/observables/{CheckboxObservable.kt => ButtonSelectedObservable.kt} (96%) create mode 100644 qr-code-app/src/main/resources/dustbin_remove16.png diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/Main.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/Main.kt index 88e1c90..81da665 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/Main.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/Main.kt @@ -41,16 +41,13 @@ fun main() { }, ) - var alreadyAppliedOnce = false - val alreadyAppliedOnceDelegate = { alreadyAppliedOnce } val imageService = ImageService(qrCodeConfigViewModel) - val fileUi = FileUI(CodeGeneratorService(qrCodeConfigViewModel), configService, imageService, alreadyAppliedOnceDelegate) + val fileUi = FileUI(CodeGeneratorService(qrCodeConfigViewModel), configService, imageService) MainMenu.createFrameMenu(frame, qrCodeConfigViewModel.qrCodeContent, fileUi, configService) val (imagePanel, setImage) = ImageUI.createImagePanel(imageService, fileUi) val (propertiesPanel, applyOnChange) = PropertiesUI.createPropertiesUI(qrCodeConfigViewModel, dataBindingContext) { onPropertyApply(qrCodeConfigViewModel.qrCodeContent, imageService, setImage, imagePanel) - alreadyAppliedOnce = true } val mainPanel = MainUI.createMainPanel(imagePanel, propertiesPanel) @@ -60,7 +57,6 @@ fun main() { it.model.addChangeListener { if (applyOnChange()) { onPropertyApply(qrCodeConfigViewModel.qrCodeContent, imageService, setImage, imagePanel) - alreadyAppliedOnce = true } } } diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/extension/BindingExtensions.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/extension/BindingExtensions.kt index 0c114d3..0082325 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/extension/BindingExtensions.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/extension/BindingExtensions.kt @@ -1,7 +1,7 @@ package io.github.simonscholz.extension import io.github.simonscholz.observables.BackgroundColorObservable -import io.github.simonscholz.observables.CheckboxObservable +import io.github.simonscholz.observables.ButtonSelectedObservable import io.github.simonscholz.observables.ComponentEnabledObservable import io.github.simonscholz.observables.ComponentInvertedEnabledObservable import io.github.simonscholz.observables.DocumentObservable @@ -29,6 +29,6 @@ fun Component.toBackgroundColorObservable(): IObservableValue = fun Component.toEnabledObservable(): IObservableValue = ComponentEnabledObservable(this) fun Component.toEnabledInvertedObservable(): IObservableValue = ComponentInvertedEnabledObservable(this) -fun AbstractButton.toCheckboxObservable(): IObservableValue = CheckboxObservable(this) +fun AbstractButton.toButtonSelectedObservable(): IObservableValue = ButtonSelectedObservable(this) fun JComboBox.toSelectedItemObservable(): IObservableValue = JComboBoxSelectedItemObservable(this) diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/model/Mapper.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/model/Mapper.kt index 2c45b1d..9368a98 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/model/Mapper.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/model/Mapper.kt @@ -11,6 +11,8 @@ object Mapper { backgroundColor = viewModel.backgroundColor.value.toColorInfo(), foregroundColor = viewModel.foregroundColor.value.toColorInfo(), logo = viewModel.logo.value, + logoBase64 = viewModel.logoBase64.value, + useBase64Logo = viewModel.useBase64Logo.value, logoRelativeSize = viewModel.logoRelativeSize.value, logoBackgroundColor = viewModel.logoBackgroundColor.value.toColorInfo(), logoShape = viewModel.logoShape.value, diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/model/QrCodeConfig.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/model/QrCodeConfig.kt index dc1b587..f54c853 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/model/QrCodeConfig.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/model/QrCodeConfig.kt @@ -9,6 +9,8 @@ data class QrCodeConfig( val foregroundColor: ColorInfo, val logo: String, + val logoBase64: String?, + val useBase64Logo: Boolean, val logoRelativeSize: Double, val logoBackgroundColor: ColorInfo, val logoShape: LogoShape, diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/model/QrCodeConfigViewModel.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/model/QrCodeConfigViewModel.kt index 34c7b2c..5042131 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/model/QrCodeConfigViewModel.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/model/QrCodeConfigViewModel.kt @@ -12,6 +12,8 @@ class QrCodeConfigViewModel { val foregroundColor: WritableValue = WritableValue(Color.BLACK, Color::class.java) val logo: WritableValue = WritableValue("", String::class.java) + val logoBase64: WritableValue = WritableValue("iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAdO3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjapZtZlhw5ckX/sQotAbMBy8F4jnag5es+RDKryGKXulocMoORHu5wG95gcLrzP/993X/xq/aaXS7WeFE9v3LPPQ5eNP/5Nd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iAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkdpbXAgMi4xMCAoTGludXgpIgogICAgICBzdEV2dDp3aGVuPSIyMDIzLTEwLTA0VDEwOjIwOjIzKzAyOjAwIi8+CiAgICA8L3JkZjpTZXE+CiAgIDwveG1wTU06SGlzdG9yeT4KICA8L3JkZjpEZXNjcmlwdGlvbj4KIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/PpkRdz0AAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfnCgQIFBehKQ1GAAAQm0lEQVRo3s2byY8c53nGf99XW1d3T6+zkDMccsRFqyUZtmzZgZxFthFHcOKLLkGAADkESJA/Ikj+hxwSIBdfkgAxDDi24NjyIlhJLCmOZa2kLIrb7NM9vXd1VX1LDlXsmREpcUbkSKpBEcOeYk099a7P874UrW7PcoxHOuwz3riG6e1A1EPqBHSS/dAJ0I6PKNaQtXmKJ5bxSjPH+TiI4wBsjWZw5RJq/R0KdkKp3sRxvQ/9NzpNGHbaxLKIt/wgM2fuByE+/YAH195BXf4V1XoNvxB+pHvE4xG93pDggScpLa18OgGryZjOyz+iHkoK5co9ebio36WnAxpf+CrS8+/JPeW9uMlkd4fuz/6NhcbMPQMLEFZqzM94tH/6ryT97qcD8KS9xfjl/2DhzArSce55zEnX5cSpU/Rf/A5xb/eTBZz0O4xeeY655RXEMSSYadxJyfzpFfovfpd0PPhkABuV0v2f7zO7uISQkuM+pOMwt7TE7ovfwxr98QPu/Oa/aNRncI6STIS4/XnIww0K1MsBnddf+ngBT3a3cVuX8YvlIwEVgEAgRH7mXxnowwEvzFRh7Q3SYf/jAzx86yVmZheQjnsosAKyGBfythbOXgCHsrZ0PapzC/TeevnjAZwMunjDrcO5cg72ADApESI/pcyTnTh47Z1c2y8gdy6jJ+PjBzy8/CbFWuOOreIt7pxbeAo0B559djTQ0vMo1xsMrr1z/ID15ruZde9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S0Wj1Wb2wjJZTLIUHgYq0lSRRKGYwx00mKlALXdfA8B8eRGGMZj2OUtjQaFebma1Pd+9vf/QEb3YMbtFIIasWA1VaHYhhOFeFi4ONLQX805v6V0zz+8APMz2YqifvKq69z5cYacRLj+z5hGNIaTg4UepPLo4PJ7bfeLt5YJ45jXNelVivRaJxjNIpotfq020OU0riug+tJHCmRObk3xhBFCcOhwfNciqWQEydnKZfD7MXkYJVSXLyxTnXm4LqysZbWYIwrxbRDsxZGk4QREHg+27sdfvjzFykUAs4sLeJeW1tjo7WL5/uocXL72iUEfuDT7g1oVm/9j1SB77O2uc2ZU4vZsonWFAo+p07NArNYC0mSopRGKT3N1p7n4nkOvu9NVx1uvoj9x+rmNoF/++3dnU6fRrV8202fWGniwRgBtPtDJCC3uyMUgu1O70Ozm+e6+K5Lp3/r0LkQ+FxZXf8wdZcg8CiVClSrJWr1MrVamVKpgO9701zwQcfV1XUKwa2A270BxbCwtx71AUe718cIyWZ3iFTG4Lku0SS5Q78Mvuey0xvSG45u+fl7qxsc13G7e/eGI9r9Eb7rcKc2O5okeK6LsZb/B0GTMG0aS2KoAAAAAElFTkSuQmCC", String::class.java) + val useBase64Logo: WritableValue = WritableValue(true, Boolean::class.java) val logoRelativeSize: WritableValue = WritableValue(.2, Double::class.java) val logoBackgroundColor: WritableValue = WritableValue(Color.WHITE, Color::class.java) val logoShape: WritableValue = WritableValue(LogoShape.CIRCLE, LogoShape::class.java) diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/observables/CheckboxObservable.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/observables/ButtonSelectedObservable.kt similarity index 96% rename from qr-code-app/src/main/kotlin/io/github/simonscholz/observables/CheckboxObservable.kt rename to qr-code-app/src/main/kotlin/io/github/simonscholz/observables/ButtonSelectedObservable.kt index 54c6670..1ee728d 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/observables/CheckboxObservable.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/observables/ButtonSelectedObservable.kt @@ -4,7 +4,7 @@ import org.eclipse.core.databinding.observable.Diffs import org.eclipse.core.databinding.observable.value.AbstractObservableValue import javax.swing.AbstractButton -class CheckboxObservable( +class ButtonSelectedObservable( private val button: AbstractButton, ) : AbstractObservableValue() { diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/service/ConfigService.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/service/ConfigService.kt index 3606b6f..da04352 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/service/ConfigService.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/service/ConfigService.kt @@ -6,29 +6,41 @@ import io.github.simonscholz.model.Mapper import io.github.simonscholz.model.QrCodeConfig import io.github.simonscholz.model.QrCodeConfigViewModel import java.io.File -import java.util.prefs.Preferences +import java.nio.file.Paths +import kotlin.io.path.createDirectories class ConfigService( private val qrCodeConfigViewModel: QrCodeConfigViewModel, ) { private val objectMapper = ObjectMapper().registerKotlinModule() - private val preferences = Preferences.userRoot().node("qr-code-app") fun saveConfig() { - val config = Mapper.fromViewModel(qrCodeConfigViewModel) - val configJson = objectMapper.writeValueAsString(config) - preferences.put(QR_CODE_CONFIG_PREFERENCE_KEY, configJson) + runCatching { + val config = Mapper.fromViewModel(qrCodeConfigViewModel) + objectMapper.writeValue(getConfigFile(), config) + }.onFailure { + println("Failed to save config to preferences. ${it.message}") + it.printStackTrace() + } } fun loadConfig() { - preferences.get(QR_CODE_CONFIG_PREFERENCE_KEY, null)?.let { - val config = objectMapper.readValue(it, QrCodeConfig::class.java) + runCatching { + val config = objectMapper.readValue(getConfigFile(), QrCodeConfig::class.java) Mapper.applyViewModel(config, qrCodeConfigViewModel) + }.onFailure { + println("Failed to load config from preferences. ${it.message}") + resetConfig() } } fun resetConfig() { - preferences.remove(QR_CODE_CONFIG_PREFERENCE_KEY) + runCatching { + File(getQrCodeAppDataFolder(), QR_CODE_CONFIG_FILE).delete() + }.onFailure { + println("Failed to delete config file. ${it.message}") + it.printStackTrace() + } } fun saveConfigFile(filePath: String) { @@ -46,7 +58,29 @@ class ConfigService( Mapper.applyViewModel(config, qrCodeConfigViewModel) } + private fun getConfigFile(): File { + val configDirectory = Paths.get(getQrCodeAppDataFolder()).createDirectories() + return File(configDirectory.toFile(), QR_CODE_CONFIG_FILE) + } + + private fun getQrCodeAppDataFolder(): String { + val os = System.getProperty("os.name").lowercase() + + return when { + os.contains("win") -> { + // Windows + System.getenv("APPDATA")?.let { "$it/qr-code-app" } ?: throw IllegalStateException("APPDATA environment variable not found.") + } + os.contains("nix") || os.contains("nux") || os.contains("mac") -> { + // Linux or macOS + val homeDir = System.getProperty("user.home") + "$homeDir/.config/qr-code-app" + } + else -> throw UnsupportedOperationException("Unsupported operating system: $os") + } + } + companion object { - private const val QR_CODE_CONFIG_PREFERENCE_KEY = "qrcode.config" + private const val QR_CODE_CONFIG_FILE = "config.json" } } diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/service/ImageService.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/service/ImageService.kt index eda9f14..0b40996 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/service/ImageService.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/service/ImageService.kt @@ -4,8 +4,6 @@ import io.github.simonscholz.model.QrCodeConfigViewModel import io.github.simonscholz.qrcode.QrCodeConfig import io.github.simonscholz.qrcode.QrCodeFactory import io.github.simonscholz.qrcode.QrPositionalSquaresConfig -import io.github.simonscholz.ui.ImageUI -import java.awt.Color import java.awt.Image import java.awt.image.BufferedImage import java.io.File @@ -36,7 +34,7 @@ class ImageService(private val qrCodeConfigViewModel: QrCodeConfigViewModel) { outerBorderColor = qrCodeConfigViewModel.positionalSquareOuterBorderColor.value, ), ) - if (qrCodeConfigViewModel.logo.value.isNotBlank() && File(qrCodeConfigViewModel.logo.value).exists()) { + if (!qrCodeConfigViewModel.useBase64Logo.value && qrCodeConfigViewModel.logo.value.isNotBlank() && File(qrCodeConfigViewModel.logo.value).exists()) { runCatching { ImageIO.read(File(qrCodeConfigViewModel.logo.value)).let { val scaledLogo = getScaledLogo(it, qrCodeConfigViewModel) @@ -51,6 +49,13 @@ class ImageService(private val qrCodeConfigViewModel: QrCodeConfigViewModel) { }.onFailure { _ -> JOptionPane.showMessageDialog(null, "You did not select a proper image", "Image Loading Error", JOptionPane.ERROR_MESSAGE) } + } else if (qrCodeConfigViewModel.useBase64Logo.value && qrCodeConfigViewModel.logoBase64.value.isNotBlank()) { + builder.qrLogoConfig( + base64Logo = qrCodeConfigViewModel.logoBase64.value, + relativeSize = qrCodeConfigViewModel.logoRelativeSize.value, + bgColor = qrCodeConfigViewModel.logoBackgroundColor.value, + shape = qrCodeConfigViewModel.logoShape.value, + ) } val qrCodeConfig = builder.build() return QrCodeFactory.createQrCodeApi().createQrCodeImage(qrCodeConfig) @@ -70,21 +75,4 @@ class ImageService(private val qrCodeConfigViewModel: QrCodeConfigViewModel) { val ratio = logo.getWidth(null).toDouble() / logo.getHeight(null).toDouble() return logo.getScaledInstance((maxLogoSize * ratio).toInt(), maxLogoSize, Image.SCALE_SMOOTH) } - - fun renderInitialImage(): BufferedImage { - val resource = ImageUI::class.java.getClassLoader().getResource("avatar-60x.png") - val logo = ImageIO.read(resource) - val qrCodeConfig = QrCodeConfig.Builder("https://simonscholz.github.io/") - .qrBorderConfig(Color.BLACK) - .qrLogoConfig(logo) - .qrPositionalSquaresConfig( - QrPositionalSquaresConfig( - isCircleShaped = true, - relativeSquareBorderRound = .2, - centerColor = Color.RED, - ), - ) - .build() - return QrCodeFactory.createQrCodeApi().createQrCodeImage(qrCodeConfig) - } } diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/FileUI.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/FileUI.kt index af547fa..91b4e7c 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/FileUI.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/FileUI.kt @@ -21,25 +21,16 @@ class FileUI( private val codeGeneratorService: CodeGeneratorService, private val configService: ConfigService, private val imageService: ImageService, - private val alreadyAppliedOnceDelegate: () -> Boolean, ) { fun copyBase64ImageToClipboard() { - val qrCodeImage = if (alreadyAppliedOnceDelegate()) { - imageService.renderImage() - } else { - imageService.renderInitialImage() - } + val qrCodeImage = imageService.renderImage() val clipboard: Clipboard = Toolkit.getDefaultToolkit().systemClipboard val copyString = StringSelection(qrCodeImage.toBase64()) clipboard.setContents(copyString, null) } fun copyImageToClipboard() { - val qrCodeImage = if (alreadyAppliedOnceDelegate()) { - imageService.renderImage() - } else { - imageService.renderInitialImage() - } + val qrCodeImage = imageService.renderImage() val transferableImage = ImageTransferable(qrCodeImage) val clipboard = Toolkit.getDefaultToolkit().systemClipboard clipboard.setContents(transferableImage, null) @@ -71,11 +62,7 @@ class FileUI( File("${fileChooser.selectedFile.absolutePath}.png") } - val qrCodeImage = if (alreadyAppliedOnceDelegate()) { - imageService.renderImage() - } else { - imageService.renderInitialImage() - } + val qrCodeImage = imageService.renderImage() ImageIO.write(qrCodeImage, "png", fileToSave) } } diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/ImageUI.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/ImageUI.kt index b5fdd0a..a99ce3a 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/ImageUI.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/ImageUI.kt @@ -21,7 +21,7 @@ object ImageUI { val imageContainer = JPanel(MigLayout("", "[center]")) imageContainer.background = Color.WHITE - val image = imageService.renderInitialImage() + val image = imageService.renderImage() val imageDrawPanel = ImagePanel().apply { setImage(image) diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/properties/LogoPropertiesUI.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/properties/LogoPropertiesUI.kt index 7722820..349fba1 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/properties/LogoPropertiesUI.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/properties/LogoPropertiesUI.kt @@ -1,6 +1,9 @@ package io.github.simonscholz.ui.properties +import io.github.simonscholz.extension.toButtonSelectedObservable import io.github.simonscholz.extension.toDoubleObservable +import io.github.simonscholz.extension.toEnabledInvertedObservable +import io.github.simonscholz.extension.toEnabledObservable import io.github.simonscholz.extension.toObservable import io.github.simonscholz.extension.toSelectedItemObservable import io.github.simonscholz.model.QrCodeConfigViewModel @@ -9,11 +12,14 @@ import io.github.simonscholz.ui.CustomItems import net.miginfocom.swing.MigLayout import org.eclipse.core.databinding.DataBindingContext import java.io.File +import javax.swing.ButtonGroup +import javax.swing.ImageIcon import javax.swing.JButton import javax.swing.JComboBox import javax.swing.JFileChooser import javax.swing.JLabel import javax.swing.JPanel +import javax.swing.JRadioButton import javax.swing.JSpinner import javax.swing.JTextField import javax.swing.SpinnerNumberModel @@ -24,6 +30,20 @@ object LogoPropertiesUI { fun createLogoPropertiesUI(dataBindingContext: DataBindingContext, qrCodeConfigViewModel: QrCodeConfigViewModel): JPanel { val logoPropertiesPanel = JPanel(MigLayout()) + logoPropertiesPanel.add(JLabel("Logo source:")) + + val radioPanel = JPanel(MigLayout("nogrid")) + val useFileButton = JRadioButton("Use file") + val useBase64Button = JRadioButton("Use base 64") + ButtonGroup().run { + add(useFileButton) + add(useBase64Button) + } + radioPanel.add(useFileButton) + radioPanel.add(useBase64Button) + dataBindingContext.bindValue(useBase64Button.toButtonSelectedObservable(), qrCodeConfigViewModel.useBase64Logo) + logoPropertiesPanel.add(radioPanel, "wrap") + logoPropertiesPanel.add(JLabel("Logo:")) val logoTextField = JTextField() dataBindingContext.bindValue(logoTextField.toObservable(), qrCodeConfigViewModel.logo) @@ -40,6 +60,22 @@ object LogoPropertiesUI { } } logoPropertiesPanel.add(chooseFile, "wrap, growx, width 30:30:30") + dataBindingContext.bindValue(logoTextField.toEnabledInvertedObservable(), qrCodeConfigViewModel.useBase64Logo) + dataBindingContext.bindValue(chooseFile.toEnabledInvertedObservable(), qrCodeConfigViewModel.useBase64Logo) + + logoPropertiesPanel.add(JLabel("Base64 encoded Logo:")) + val base64LogoTextField = JTextField().apply { + dataBindingContext.bindValue(this.toObservable(), qrCodeConfigViewModel.logoBase64) + logoPropertiesPanel.add(this, "growx, width 200:220:300") + dataBindingContext.bindValue(this.toEnabledObservable(), qrCodeConfigViewModel.useBase64Logo) + } + + val deleteBase64LogoTextField = JButton() + deleteBase64LogoTextField.icon = ImageIcon(LogoPropertiesUI::class.java.classLoader.getResource("dustbin_remove16.png")) + deleteBase64LogoTextField.addActionListener { + base64LogoTextField.text = "" + } + logoPropertiesPanel.add(deleteBase64LogoTextField, "wrap, growx, width 30:30:30") logoPropertiesPanel.add(JLabel("Relative Logo Size:")) val sizeSpinnerModel = SpinnerNumberModel(.2, .0, 1.0, 0.01) diff --git a/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/properties/PositionalSquaresPropertiesUI.kt b/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/properties/PositionalSquaresPropertiesUI.kt index 3fbe0b0..5507123 100644 --- a/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/properties/PositionalSquaresPropertiesUI.kt +++ b/qr-code-app/src/main/kotlin/io/github/simonscholz/ui/properties/PositionalSquaresPropertiesUI.kt @@ -1,6 +1,6 @@ package io.github.simonscholz.ui.properties -import io.github.simonscholz.extension.toCheckboxObservable +import io.github.simonscholz.extension.toButtonSelectedObservable import io.github.simonscholz.extension.toDoubleObservable import io.github.simonscholz.extension.toEnabledInvertedObservable import io.github.simonscholz.model.QrCodeConfigViewModel @@ -20,7 +20,7 @@ object PositionalSquaresPropertiesUI { positionalSquaresPropertiesPanel.add(JLabel("Is Circle Shape:")) val isCircleShaped = JCheckBox("(Disables Border Radius)") positionalSquaresPropertiesPanel.add(isCircleShaped, "wrap, growx, width 200:220:300") - dataBindingContext.bindValue(isCircleShaped.toCheckboxObservable(), qrCodeConfigViewModel.positionalSquareIsCircleShaped) + dataBindingContext.bindValue(isCircleShaped.toButtonSelectedObservable(), qrCodeConfigViewModel.positionalSquareIsCircleShaped) positionalSquaresPropertiesPanel.add(JLabel("Positional Sqaure Border Radius:")) val relativeSquareBorderRoundSpinnerModel = SpinnerNumberModel(.2, .0, 1.0, 0.01) @@ -28,7 +28,7 @@ object PositionalSquaresPropertiesUI { dataBindingContext.bindValue(relativePositionalSquareBorderRoundSpinner.toDoubleObservable(), qrCodeConfigViewModel.positionalSquareRelativeBorderRound) positionalSquaresPropertiesPanel.add(relativePositionalSquareBorderRoundSpinner, "wrap, growx, width 200:220:300") - dataBindingContext.bindValue(relativePositionalSquareBorderRoundSpinner.toEnabledInvertedObservable(), isCircleShaped.toCheckboxObservable()) + dataBindingContext.bindValue(relativePositionalSquareBorderRoundSpinner.toEnabledInvertedObservable(), isCircleShaped.toButtonSelectedObservable()) CustomItems.createColorPickerItem(positionalSquaresPropertiesPanel, "Center Color:", qrCodeConfigViewModel.positionalSquareCenterColor, dataBindingContext) CustomItems.createColorPickerItem(positionalSquaresPropertiesPanel, "Inner Square Color:", qrCodeConfigViewModel.positionalSquareInnerSquareColor, dataBindingContext) diff --git a/qr-code-app/src/main/resources/dustbin_remove16.png b/qr-code-app/src/main/resources/dustbin_remove16.png new file mode 100644 index 0000000000000000000000000000000000000000..582aa3a6f25ef14d301afcde2af4c7eb1078daee GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP%z)q z#WBR9H#tG#S_5~-a%V&JjkCTqRHzBXaUDI8RP}==f%TD!!Zr3JRg*RRQcXC literal 0 HcmV?d00001