r/JavaFX • • May 23 '23

I made this! TreeMapFX: A simple TreeMap chart component

39 Upvotes

8 comments sorted by

View all comments

Show parent comment

2

u/PartOfTheBotnet May 25 '23 edited May 25 '23

When I wrapped, like you said changes to nodeFunction with Platform.runLater they went a way.

OK, good to know. I'll look into this when I get the time a bit more. (Elaborated more a bit below)

you should look into Reentrantlock

I'm pretty pea-brained on multi-threading, hence the approach I took ;)

But I also wanted something that made changes to the property "just work". I wasn't aware of the bit on thread safety, and assumed changes to the properties would be handled on the FX thread. But in hindsight it makes sense that it doesn't. Like I said, pea-brained. Would it be reasonable to say that this is something most FX users are aware of? If so allowing these failures to occur when not run on the proper thread can be chalked up to a user/skill issue. Otherwise, would it be better to handle in the project, or to yet again defer to the user, but include a note in the Javadocs so that you can say "hey, I warned ya"?

valuesList -> valuesProperty + improved binding usage

Yeah, the list thing is something I thought of a few minutes after the release, oops. No problem though, making a 1.1.0 ain't hard.

takes balls to show off your project and provide source because you are essentially letting anyone, comment on something you probably spent a lot of work into so hats off.

I spent no more than a few hours on this tbh. I wish people would give valuable feedback like this more often. A developer shouldn't be hurt by comments on improvement items if they're made in good faith.

Though understandably not all projects are as easy to review as this one. Its quite small and easy to digest. If I posted something my other projects like the current Recaf rewrite work I think you'd need a team of full developers to make an actual review that matches the quality of a reply like this but scaled to the entire project.

including dumb people (I fall under sometimes)

I think we all fit the bill there.