<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Doesn't </div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16"; font-size: 12pt;"><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">DoubleBinding
</span><span style="color: rgb(0, 0, 0); background-color: rgb(212, 212, 212);">createDoubleBinding</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">(</span><span style="color: rgb(78, 143, 0); background-color: rgb(255, 255, 255);">final</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"> Callable<Double>
 func, </span><span style="color: rgb(78, 143, 0); background-color: rgb(255, 255, 255);">final</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"> Observable... dependencies)</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16"; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"><br>
</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16"; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">handles the use case you describe?</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16"; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);"><br>
</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16"; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color: rgb(255, 255, 255);">-andy</span></div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="mail-editor-reference-message-container">
<div class="ms-outlook-mobile-reference-message skipProofing">
<meta name="Generator" content="Microsoft Exchange Server">
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of John Hendrikx <john.hendrikx@gmail.com><br>
<b>Date: </b>Sunday, October 26, 2025 at 02:59<br>
<b>To: </b>openjfx-dev <openjfx-dev@openjdk.org><br>
<b>Subject: </b>JEP Proposal: Fluent Bindings for multiple observables<br>
<br>
</div>
<div class="PlainText" style="font-size: 11pt;">JEP: <a href="https://gist.github.com/hjohn/611acb65769b68a845b8919c62a3e99a" data-outlook-id="4ef3afb8-941c-4127-ae81-efc74a2f1438">
https://gist.github.com/hjohn/611acb65769b68a845b8919c62a3e99a</a><br>
<br>
Hi everyone,<br>
<br>
I'd like to propose an extension to the fluent bindings API on<br>
ObservableValue (map, flatMap, orElse) which were introduced in JavaFX<br>
19 over 3 years ago.<br>
<br>
The API currently is very powerful when dealing with a single<br>
observable, but lacks support when dealing with multiple observables. <br>
For example, let's say you want to compute a width/height ratio.  You<br>
could write this:<br>
<br>
    ObservableValue<Double> ratio = width.map(w -> w / height.get());<br>
<br>
... but you'll quickly find that such an observable will not update<br>
itself when height changes, only when width changes.<br>
<br>
The go-to solution for this is currently:<br>
<br>
    DoubleBinding ratio = new DoubleBinding() {<br>
        { bind(width, height); }<br>
<br>
        protected double computeValue() { return width.get() /<br>
height.get(); }<br>
    }<br>
<br>
My proposal would extend ObservableValue with a new `with` method that<br>
returns an intermediate stage that can be easily converted back to an<br>
ObservableValue:<br>
<br>
    ObservableValue<Double> ratio = width.with(height).map((w, h) -> w /<br>
h);  // yields a ratio that updates whenever w or h changes<br>
<br>
Or for example:<br>
<br>
     ObservableValue<Point> point = x.with(y).map(Point::new);  //<br>
yields a Point that updates whenever x or y changes<br>
<br>
The intermediate stage would not be an observable value itself.  This<br>
limits the API surface, and makes this proposal fairly lightweight and<br>
much easier to implement.<br>
<br>
Please see the JEP for the full proposal.  I look forward to your feedback!<br>
<br>
--John<br>
<br>
<br>
</div>
</div>
</body>
</html>