Package javafx.beans.binding

Examples of javafx.beans.binding.NumberBinding


        // Make the progress line+circle follow the pledged amount and disappear if there are no pledges yet.
        //
        // This is all calculated lazily, so changes in pledgedProperty propagate through to the widgets only
        // when they actually need to be drawn.
        DoubleBinding progress = min(1.0, divide(pledgedAmount, (double) project.getGoalAmount().value));
        NumberBinding pixelWidth = multiply(widthProperty(), progress);
        // These come pre-bound in the FXML just to make things look more clear in Scene Builder, so unbind them here.
        progressLine.endXProperty().unbind();
        progressCircle.centerXProperty().unbind();
        animatedBind(progressLine, progressLine.endXProperty(), pixelWidth);
        animatedBind(progressCircle, progressCircle.centerXProperty(), pixelWidth);

        progressLine.visibleProperty().bind(pixelWidth.greaterThan(0.0));
        progressCircle.visibleProperty().bind(progressLine.visibleProperty());
        Tooltip tooltip = new Tooltip();
        // TODO: Maybe use Adam's BtcFormat class here instead.
        tooltip.textProperty().bind(new ReactiveCoinFormatter("%s BTC raised so far", MonetaryFormat.BTC, pledgedAmount));
        Tooltip.install(progressCircle, tooltip);
View Full Code Here

TOP

Related Classes of javafx.beans.binding.NumberBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.