amanda.hinchman-dominguez
05/20/2018, 5:23 AMamanda.hinchman-dominguez
05/20/2018, 5:27 AMamanda.hinchman-dominguez
05/20/2018, 5:33 AMedvin
05/20/2018, 7:15 AMedvin
05/20/2018, 7:17 AMedvin
05/20/2018, 7:19 AMresources
folder, you can stick images together with your source files, but you'd need to change your build descriptor to copy them to the build folder, since you'd be parting with the standard location scheme. No big deal, and I've done it on some projects where I feel it's more beneficial to keep source and corresponding resources side by side.edvin
05/20/2018, 7:20 AMedvin
05/20/2018, 7:21 AMobservableArrayList
function. val shapesProperty = SimpleListProperty<ShapeItem>(FXCollections.observableArrayList(arrayListOf()))
is redundant. Just do SimpleListProperty<ShapeItem>(FXCollections.observableArrayList())
. End result is the same though. More importantly, you have a bug in ShapeItem
. The constructor takes two parameters (name and path), but you just throw them on the floor, you don't assign them to your properties.edvin
05/20/2018, 7:28 AMbutton(shapeItem.name)
instead of button(shapeItem.nameProperty)
. Binding to the nameProperty
would allow the button label to change if the shapeItem name property changes, but if you don't need that, you might actually stick with just name
, as it doesn't create a binding and as such is slightly more light weight.edvin
05/20/2018, 7:30 AMbindChildren
statement twice at startup, since you're first binding towards an empty list, then changing the list by adding two shapeItems, so it has to reevaluate. Simply preparing the data before creating the view would fix that, so just swap these two lines so they look like this:edvin
05/20/2018, 7:31 AMedvin
05/20/2018, 7:34 AMedvin
05/20/2018, 7:35 AMelexx
05/20/2018, 8:40 AMbutton("click me").action { ... }
and button("click me") { action { ... }}
. Because I have troubles with the 1st form together with runAsyncWithProgress
. The 2nd form works just fine, but button.action { runAsyncWithProgress { ... }}
seems to remove the parent node of button instead of appending a spinner to the text of the button.elexx
05/20/2018, 8:45 AMabhinay
05/20/2018, 8:46 AMabhinay
05/20/2018, 8:51 AMabhinay
05/20/2018, 8:52 AMbutton("Button 1") {
action {
...
}
}
will return a Button instance where as
button("Button 2 ").action {
}
will return the type from action
(or setOnAction
) i.e. void.elexx
05/20/2018, 8:54 AMelexx
05/20/2018, 8:54 AMout.png▾
abhinay
05/20/2018, 8:54 AMabhinay
05/20/2018, 8:55 AMelexx
05/20/2018, 8:55 AMcrummy
05/20/2018, 12:15 PMworld.actor.forEach { actor ->
actorModel.rebind { actor }
circle {
centerXProperty().bind(actorModel.x)
centerYProperty().bind(actorModel.y)
radius = 10.0
}
}
I don't quite understand how the model binding works (right now it prints them out with some default positioning). Given an ActorModel, and a list of observable Actors, can I re-use my ActorModel to display each?edvin
05/20/2018, 2:21 PMcrummy
05/20/2018, 2:58 PMedvin
05/20/2018, 3:20 PM