add calculating methods to bind

Tom Eugelink tbee at
Wed May 21 19:25:37 UTC 2014

I came up with this:

startXProperty().bind( *snap(*heightProperty().multiply(0.2)) )

And then:

     private DoubleBinding snap(final ObservableNumberValue other, final Observable... dependencies) {
         return new DoubleBinding() {

             public void dispose() {

             protected double computeValue() {
                 return NodeUtil.snap(other.doubleValue());

             public ObservableList<?> getDependencies() {
                 return new ImmutableObservableList<Observable>(dependencies);

But that always returns 0... I feel this should have worked.


More information about the openjfx-dev mailing list