@@ -2,9 +2,6 @@ package org.scijava.scripting.fx
2
2
3
3
import javafx.application.Platform
4
4
import javafx.beans.InvalidationListener
5
- import javafx.event.Event
6
- import javafx.event.EventHandler
7
- import javafx.event.EventType
8
5
import javafx.geometry.Insets
9
6
import javafx.geometry.Pos
10
7
import javafx.scene.Group
@@ -87,15 +84,6 @@ class SciJavaReplFX(context: Context) {
87
84
val history: Node
88
85
get() = _history
89
86
90
- fun <T : Event > addPromptEventHandler (
91
- eventType : EventType <T >,
92
- eventHandler : EventHandler <T >) = _prompt .addEventHandler(eventType, eventHandler)
93
-
94
-
95
- fun <T : Event > addPromptEventHandler (
96
- eventType : EventType <T >,
97
- eventHandler : (T ) -> Unit ) = addPromptEventHandler(eventType, EventHandler { eventHandler(it) })
98
-
99
87
@Synchronized
100
88
fun evalCurrentPrompt () {
101
89
val promptText = _prompt .text
@@ -104,12 +92,12 @@ class SciJavaReplFX(context: Context) {
104
92
_prompt .positionCaret(0 )
105
93
_prompt .promptText = " In [${count + 1 } ]:"
106
94
_prompt .isEditable = false
107
- _history .text = " ${_history .text} \n In [$count ]: ${ promptText} \n Out [$count ]: "
95
+ _history .text = " ${_history .text} \n In [$count ]: $promptText \n Out [$count ]: "
108
96
_history .positionCaret(_history .text.length)
109
97
}
110
98
// TODO use queue or block this thread here? could potentially block main application thread? bad?
111
99
try {
112
- repl.evaluate(promptText)
100
+ repl.evaluate(promptText)
113
101
} finally {
114
102
++ count
115
103
invokeOnFXApplicationThread {
@@ -120,7 +108,7 @@ class SciJavaReplFX(context: Context) {
120
108
}
121
109
122
110
private fun scaleFontSisze (factor : Double ) {
123
- require(factor > 0 , { " Factor > 0 required but received $factor <= 0" })
111
+ require(factor > 0 ) { " Factor > 0 required but received $factor <= 0" }
124
112
val size = _history .font.size
125
113
val font = Font .font(" Monospace" , size * factor)
126
114
_history .font = font
0 commit comments