Re: [announce] InhiBeans: mitigate redundant recalculations

2014-01-16 Thread Alexander Kouznetsov
There are two other options you may want to consider: 1) Use XXXBinding as following: value.bind(new DoubleBinding() { { bind(widthProperty(), heightProperty()); } @Override protected Double computeValue() { return widthProperty().get() *

Re: [announce] InhiBeans: mitigate redundant recalculations

2014-01-16 Thread Tomas Mikula
Hi Alexander, On Thu, Jan 16, 2014 at 10:24 AM, Alexander Kouznetsov alexander.kouznet...@oracle.com wrote: There are two other options you may want to consider: 1) Use XXXBinding as following: value.bind(new DoubleBinding() { { bind(widthProperty(), heightProperty()); } @Override

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-16 Thread Tomas Mikula
On Mon, Dec 16, 2013 at 7:56 AM, Tom Eugelink t...@tbee.org wrote: I understand what you are trying to do. I was wondering if a more coarse grained approach would be preferable, so a central registration of whether or not to postpone change events. So: Central.postponeAllChangeEvents()

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-16 Thread Tomas Mikula
On Mon, Dec 16, 2013 at 12:17 PM, Tomas Mikula tomas.mik...@gmail.com wrote: On Mon, Dec 16, 2013 at 7:56 AM, Tom Eugelink t...@tbee.org wrote: I understand what you are trying to do. I was wondering if a more coarse grained approach would be preferable, so a central registration of whether

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-16 Thread Tomas Mikula
On Mon, Dec 16, 2013 at 1:47 AM, Tomas Mikula tomas.mik...@gmail.com wrote: On Mon, Dec 16, 2013 at 1:07 AM, Scott Palmer swpal...@gmail.com wrote: Interesting, no worse than John's pattern though. I thought of using a try/finally to make sure release was called and that naturally lead to

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-16 Thread Richard Bair
Have you looked at https://github.com/Netflix/RxJava by chance? I've been dying to see somebody do an RxJava in JavaFX ever since devoxx and it looks like you may have inadvertently started down that path :-). Richard On Dec 16, 2013, at 8:09 AM, Tomas Mikula tomas.mik...@gmail.com wrote:

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-16 Thread Tomas Mikula
As a matter of fact, I have. Only to the extent of the Principles of Reactive Programming [1] course that is currently in progress on Coursera. From what I have seen so far, it's all about asynchronous composition (with emphasis on both asynchronous and composition). I didn't see it addressing

RE: [announce] InhiBeans: mitigate redundant recalculations

2013-12-16 Thread John Smith
@openjdk.java.net Subject: Re: [announce] InhiBeans: mitigate redundant recalculations As a matter of fact, I have. Only to the extent of the Principles of Reactive Programming [1] course that is currently in progress on Coursera. From what I have seen so far, it's all about asynchronous composition

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-16 Thread Richard Bair
...@openjdk.java.net] On Behalf Of Tomas Mikula Sent: Monday, December 16, 2013 9:19 AM To: Richard Bair Cc: openjfx-dev@openjdk.java.net Subject: Re: [announce] InhiBeans: mitigate redundant recalculations As a matter of fact, I have. Only to the extent of the Principles of Reactive

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-16 Thread Tomas Mikula
Mikula Sent: Monday, December 16, 2013 9:19 AM To: Richard Bair Cc: openjfx-dev@openjdk.java.net Subject: Re: [announce] InhiBeans: mitigate redundant recalculations As a matter of fact, I have. Only to the extent of the Principles of Reactive Programming [1] course that is currently

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-15 Thread Scott Palmer
Interesting idea. There is a case I have been curious about and wonder what the best practices are for it. Suppose you have a case when you are changing multiple different properties that will be used in a single calculation. You want to deal with a single change to all of them in one go. E.g.

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-15 Thread John Hendrikx
Since you are only allowed to modify properties on the JavaFX thread (in most cases), I've been using Platform.runLater() to make sure I observe only complete changes. Basically I register an InvalidationListener on the properties that are relevant, and when one gets triggered I set a boolean

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-15 Thread Scott Palmer
Yes, that does the trick, but this basically means you can't use bindings for such things. I'm wondering if there might be an opportunity for another enhancement similar to the block() resume() that Tomas has implemented, but for receiving size of the notification mechanism. Effectively it would

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-15 Thread Tomas Mikula
On Sun, Dec 15, 2013 at 6:39 PM, Scott Palmer swpal...@gmail.com wrote: Interesting idea. There is a case I have been curious about and wonder what the best practices are for it. Suppose you have a case when you are changing multiple different properties that will be used in a single

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-15 Thread Scott Palmer
Good stuff! This is the sort of thing that might make a good contribution to extend the standard Bindings class. Scott On Sun, Dec 15, 2013 at 5:49 PM, Tomas Mikula tomas.mik...@gmail.comwrote: On Sun, Dec 15, 2013 at 6:39 PM, Scott Palmer swpal...@gmail.com wrote: Interesting idea.

Re: [announce] InhiBeans: mitigate redundant recalculations

2013-12-15 Thread Tomas Mikula
On Sun, Dec 15, 2013 at 8:30 PM, John Hendrikx hj...@xs4all.nl wrote: Since you are only allowed to modify properties on the JavaFX thread (in most cases), I've been using Platform.runLater() to make sure I observe only complete changes. Basically I register an InvalidationListener on the