summaryrefslogtreecommitdiff
path: root/src/main/kotlin/me/kyren223/harpoonforjb/SettingsData.kt
diff options
context:
space:
mode:
authorKyren223 <ulmliad223@gmail.com>2024-02-13 14:07:55 +0200
committerKyren223 <ulmliad223@gmail.com>2024-02-13 14:07:55 +0200
commit6f6bd6a028f48a1685370049406986425f889a50 (patch)
tree0dcb9ccf43b21b754b80cd8b519003b022e21832 /src/main/kotlin/me/kyren223/harpoonforjb/SettingsData.kt
parent923453baa759f7d7e2f6fb4e1d1610fe5b773789 (diff)
Added a settings menu
Changed project from java to kotlin
Diffstat (limited to 'src/main/kotlin/me/kyren223/harpoonforjb/SettingsData.kt')
-rw-r--r--src/main/kotlin/me/kyren223/harpoonforjb/SettingsData.kt47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/kotlin/me/kyren223/harpoonforjb/SettingsData.kt b/src/main/kotlin/me/kyren223/harpoonforjb/SettingsData.kt
new file mode 100644
index 0000000..3749661
--- /dev/null
+++ b/src/main/kotlin/me/kyren223/harpoonforjb/SettingsData.kt
@@ -0,0 +1,47 @@
+package me.kyren223.harpoonforjb
+
+import com.intellij.ui.JBIntSpinner
+import com.intellij.ui.components.JBLabel
+import com.intellij.util.ui.FormBuilder
+import javax.swing.JPanel
+
+class SettingsData {
+
+ val panel: JPanel
+ private val harpoonWidth: JBIntSpinner = JBIntSpinner(800, 1, 5000, 10)
+ private val harpoonHeight: JBIntSpinner = JBIntSpinner(400, 1, 5000, 10)
+ private val harpoonFontSize: JBIntSpinner = JBIntSpinner(20, 1, 100)
+
+ init {
+ panel = FormBuilder.createFormBuilder()
+ .addLabeledComponent(JBLabel("Harpoon width"), harpoonWidth, 1, false)
+ .addLabeledComponent(JBLabel("Harpoon height"), harpoonHeight, 1, false)
+ .addLabeledComponent(JBLabel("Harpoon font size"), harpoonFontSize, 1, false)
+ .addComponentFillVertically(JPanel(), 0)
+ .panel
+ }
+
+ fun getHarpoonWidth(): Int {
+ return harpoonWidth.number
+ }
+
+ fun getHarpoonHeight(): Int {
+ return harpoonHeight.number
+ }
+
+ fun getHarpoonFontSize(): Int {
+ return harpoonFontSize.number
+ }
+
+ fun setHarpoonWidth(width: Int) {
+ harpoonWidth.number = width
+ }
+
+ fun setHarpoonHeight(height: Int) {
+ harpoonHeight.number = height
+ }
+
+ fun setHarpoonFontSize(fontSize: Int) {
+ harpoonFontSize.number = fontSize
+ }
+}