tornadofx

TornadoFX bind ListView to ListProperty

人走茶凉 提交于 2019-12-11 01:12:17
问题 Is it possible in tornadoFX to bind a ListView to a ListProperty? I have a ViewModel like follows: class MyVm: ItemViewModel<Item>() { val stringProperty = bind { item?.myString?.toProperty() } } class MyView: View() { ... init { with (root) { label(myVm.stringProperty) } } } if the item changes with vm.item = Item(...) the stringProperty will be updated accordingly, which will update all bound labels etc... Now I want to do the same with a ListView: class MyVm: ItemViewModel<Item>() { val

Layout with overlaying nodes and anchor-like positioning

 ̄綄美尐妖づ 提交于 2019-12-08 08:31:13
问题 I try to make a layout with JavaFX that allows overlaying nodes, resizing them to match (fill) container size and aligning them to container sides. Which layout pane should I use and how to set it to achieve the layout shown on the picture. I tried to put TreeView node and SwingNode in an AnchorPane and setting anchors to fill the container, like that TreeView: top 0, left 0, bottom 0 (no right anchor to let is resize to fit content) SwingNode: all to 0 TreeView was displayed correctly but

Layout with overlaying nodes and anchor-like positioning

为君一笑 提交于 2019-12-07 13:28:30
I try to make a layout with JavaFX that allows overlaying nodes, resizing them to match (fill) container size and aligning them to container sides. Which layout pane should I use and how to set it to achieve the layout shown on the picture. I tried to put TreeView node and SwingNode in an AnchorPane and setting anchors to fill the container, like that TreeView: top 0, left 0, bottom 0 (no right anchor to let is resize to fit content) SwingNode: all to 0 TreeView was displayed correctly but underlaying SwingNode didn't fit to the whole container. It looked like its right anchor was applied to

Adding view with constructor arguments to a borderpane

雨燕双飞 提交于 2019-12-06 16:46:30
问题 I want to add a the same class to different BorderPane ´s with different constructor arguments (one true and the other false) but it seems UIComponents cannot have arguments yet giving none crashes the page Adding the parameter, intelliJ shows me it is attempting to make a comparison?? I have tried adding the Views as VBox ´s instead, but then nothing appears, I have also tried an AnchorPane instead of BorderPane but that displays nothing as well. UPDATE: class ZoomedOutView : View(

TornadoFX unresolved JavaFx

六眼飞鱼酱① 提交于 2019-12-06 08:22:33
I wanted to create a new project that should be a desktop application. For this purpose, I have selected Kotlin language and TornadoFX framework. I have installed the TornadoFX plugin and created a new T tornadofx-gradle-project . The base setup made by Intellij was successful but I have encountered a problem. When I wanted to run the generated project it failed. The project cannot resolve the java fx. I have dug through the web and found nothing that would fix the problem. The error log that I receive after the failed build is: HAs anyone faces the same issue? How can I get rid of it? I have

Adding view with constructor arguments to a borderpane

蓝咒 提交于 2019-12-04 22:52:37
I want to add a the same class to different BorderPane ´s with different constructor arguments (one true and the other false) but it seems UIComponents cannot have arguments yet giving none crashes the page Adding the parameter, intelliJ shows me it is attempting to make a comparison?? I have tried adding the Views as VBox ´s instead, but then nothing appears, I have also tried an AnchorPane instead of BorderPane but that displays nothing as well. UPDATE: class ZoomedOutView : View("ZoomedOutView") { val audioView = find<AudioView>(mapOf(AudioView::playFromFile to false)) //TODO change views

Tornadofx - How to pass parameter to Fragment on every instance

二次信任 提交于 2019-12-03 07:09:41
I am a newbie to javafx, kotlin and obviously tornadofx. Issue : How to pass parameters to Fragment on every instance? Lets say I have a table view layout as my fragment. Now this fragment is used at multiple places but with different datasets. eg. Adding a fragment in: class SomeView : View() { ... root += SomeViewFragment::class } class SomeAnotherView : View() { ... root += SomeViewFragment::class } Declaring Fragment: class SomeViewFragment : Fragment() { ... tableview(someDataSetFromRestApiCall) { ... } } How can I pass different someDataSetFromRestApiCall from SomeView and