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
Post a Comment