Replacing gui by kotlin

This commit is contained in:
Alexander Nozik 2017-11-07 22:06:21 +03:00
parent 797df76dba
commit 1d51ae6702
7 changed files with 7 additions and 8 deletions

View File

@ -5,7 +5,6 @@ import hep.dataforge.control.devices.Device
import hep.dataforge.control.devices.DeviceListener
import hep.dataforge.control.devices.PortSensor
import hep.dataforge.control.devices.Sensor
import hep.dataforge.fx.FXObject
import hep.dataforge.fx.fragments.FXFragment
import hep.dataforge.fx.fragments.FragmentWindow
import hep.dataforge.values.Value
@ -24,7 +23,7 @@ import java.util.*
/**
* Created by darksnake on 14-May-17.
*/
abstract class DeviceViewConnection<D : Device> : Component(), Connection, DeviceListener, FXObject {
abstract class DeviceViewConnection<D : Device> : Component(), Connection, DeviceListener {
private val bindings = HashMap<String, ObjectBinding<Value>>()
@ -141,7 +140,7 @@ abstract class DeviceViewConnection<D : Device> : Component(), Connection, Devic
}
togglebutton("View") {
isSelected = false
FragmentWindow.build(this){FXFragment.buildFromNode(device.name) { fxNode }}
FragmentWindow.build(this){FXFragment.buildFromNode(device.name) { getFxNode() }}
}
}
}

View File

@ -27,7 +27,7 @@ abstract class NumassControlApplication<D : Device> : App() {
device = setupDevice()
val controller = buildView(device)
device.connect(controller, Roles.VIEW_ROLE, Roles.DEVICE_LISTENER_ROLE)
val scene = Scene(controller.pane)
val scene = Scene(controller.getPane())
stage.scene = scene
stage.show()

View File

@ -108,7 +108,7 @@ class VacCollectorViewConnection : DeviceViewConnection<VacCollectorDevice>() {
hbarPolicy = ScrollPane.ScrollBarPolicy.NEVER
vbox {
viewList.forEach {
add(it.fxNode)
add(it.getFxNode())
separator(Orientation.HORIZONTAL)
}
}

View File

@ -85,7 +85,7 @@ val storageInterceptor = InterceptorFactory { context, meta ->
}
}
val controlInterceptor = InterceptorFactory { context, meta ->
val deviceInterceptor = InterceptorFactory { context, meta ->
val deviceManager = context.getFeature(DeviceManager::class.java);
ServerInterceptor("devices") {
get("listDevices") {

View File

@ -17,7 +17,7 @@ fun main(args: Array<String>) {
}
context.optFeature(DeviceManager::class.java).ifPresent{
server.intercept(deviceInterceptor)
}
server.start()

View File

@ -13,7 +13,7 @@ include ":numass-core"
include ":numass-client"
include ":numass-server"
include ":numass-server"
include ":numass-kserver"
include ":numass-web"
include ":numass-test"
//
include ":numass-viewer"