Upgrade to TornadoFX 1.6.2.

This commit is contained in:
Chris Rankin 2017-02-20 09:13:02 +00:00
parent ac56c7d451
commit ddd8d6a513
4 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,6 @@
buildscript { buildscript {
ext.kotlin_version = '1.0.6' ext.kotlin_version = '1.0.6'
ext.tornadofx_version = '1.6.0' ext.tornadofx_version = '1.6.2'
ext.jna_version = '4.1.0' ext.jna_version = '4.1.0'
ext.purejavacomm_version = '0.0.17' ext.purejavacomm_version = '0.0.17'
ext.guava_version = '14.0.1' ext.guava_version = '14.0.1'

View File

@ -94,6 +94,10 @@ class DemoBenchView : View("Corda Demo Bench") {
addNodeButton.isDisable = false addNodeButton.isDisable = false
} }
/**
* Ensures that DemoBench always has at least one instance NodeTabView.
* This method must NOT be called if DemoBench is shutting down.
*/
fun forceAtLeastOneTab() { fun forceAtLeastOneTab() {
if (nodeTabPane.tabs.isEmpty()) { if (nodeTabPane.tabs.isEmpty()) {
addNodeButton.fire() addNodeButton.fire()

View File

@ -169,9 +169,9 @@ class NodeTabView : Fragment() {
init { init {
INTEGER_FORMAT.isGroupingUsed = false INTEGER_FORMAT.isGroupingUsed = false
// Ensure that we close the terminal along with the tab. // Ensure that we destroy the terminal along with the tab.
nodeTab.setOnCloseRequest { nodeTab.setOnCloseRequest {
nodeTerminalView.close() nodeTerminalView.destroy()
} }
root.add(nodeConfigView) root.add(nodeConfigView)

View File

@ -35,7 +35,7 @@ class NodeTerminalView : Fragment() {
private val launchWebButton by fxid<Button>() private val launchWebButton by fxid<Button>()
private val launchExplorerButton by fxid<Button>() private val launchExplorerButton by fxid<Button>()
private var isClosed: Boolean = false private var isDestroyed: Boolean = false
private val explorer = explorerController.explorer() private val explorer = explorerController.explorer()
private val webServer = webServerController.webServer() private val webServer = webServerController.webServer()
private val viewer = DBViewer() private val viewer = DBViewer()
@ -143,14 +143,14 @@ class NodeTerminalView : Fragment() {
} }
}) })
fun close() { fun destroy() {
if (!isClosed) { if (!isDestroyed) {
webServer.close() webServer.close()
explorer.close() explorer.close()
viewer.close() viewer.close()
rpc?.close() rpc?.close()
pty?.close() pty?.close()
isClosed = true isDestroyed = true
} }
} }