java - How can I bind two SimpleDoubleProperty`s to each other with an exponential relation? JavaFX -


i know how binding this:

doublepropertyone.bind(doublepropertytwo.multiply(2)); 

what need example above exponential relation:

doublepropertyone.bind(doublepropertytwo.asexponentialofe()); 

so doubleproperty equals e^doubleproperty. there way accomplish relation or how else implement it?

you can use bindings class crate binding depends on doublepropertytwo:

doublepropertyone.bind(bindings.createdoublebinding(() -> math.exp(doublepropertytwo.get()), doublepropertytwo)); 

here callable passed first parameter createdoublebinding reevaluated every time dependencies passed starting second parameter (in case doublepropertytwo) change.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -