in particular, none of this is a javafx aware mode...
# tornadofx
s
in particular, none of this is a javafx aware model. I assume i'll want to sort of make similar replica using javafx properties to use as the view model and have that all hook up? I think probably know where to go with it, I was just wondering if anyone had any good examples where the structure and data changed somewhat often
v
I've tried to to something like that, I used
MutableMap<String, ObservableList<String>>
as a structure for
TreeView
nodes, but it was 2-level hierarchy (category/section)
When
populate
function returns
ObservableList
, nodes, such as sections are added automatically
s
thanks, i'll take a look. I'm still new to all of kotlin, javafx and tornadofx. I'm a long time Java/Swing developer. I'm loving tornadofx just still wrapping my head around some of it.
v
There
mutableMap.keys
returns set of strings, thus it does not update category nodes. I think that problem is solvable, but I had not much time to solve it in a better way. Perhaps, if have well-known model like
company -> department -> person
, you can make your own classes like
data class Department(val persons: ObservableList<Person>)
and
Company(val departments: ObservableList<Department>, val persons: ObservableList<Person>)
, then feed
listOf(company1, company2).observable()
to
populate
function
And
cellFormat
function will extract node names from those
Company
,
Department
, and
Person
classes (when they are passed as nodes)
s
yeah i think that is what I'm envisioning. Think I'm going to take a break for a bit and come back to it. Thanks a lot!
v
It seems that reactive elements (observable properties) of JavaFX -- are the huge improvement over Swing
s
I have some cleaning up to do, and expanding of my model, but I think i have the general concept working. Thanks a lot for your help!