Given two properties such as
DoubleProperty x;
DoubleProperty y;
and given two functions that are inverses of each other, such as
DoubleUnaryOperator xToY = x -> Math.exp(x);
DoubleUnaryOperator yToX = y -> Math.log(y);
what is the simplest way to bidirectionally bind properties x
and y
such that they retain the relation defined?
(i.e. If we assign to x
then y
should automatically become xToY.apply(x.get())
and if we assign to y
then x
should automatically become yToX.apply(y.get())
.)
Is there a way in the bindings API to do this?