javafx.beans.binding.NumberExpression Java Examples

The following examples show how to use javafx.beans.binding.NumberExpression. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FibTest.java    From ReactFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private FibTest(int n) {
    N = n;
    fib = new NumberExpression[N];
    fib[0] = new SimpleLongProperty(0);
    fib[1] = new SimpleLongProperty(0);
    for(int i = 2; i < N; ++i) {
        fib[i] = fib[i-2].add(fib[i-1]);
    }
}
 
Example #2
Source File: ProgressModel.java    From VocabHunter with Apache License 2.0 4 votes vote down vote up
private NumberBinding bindPercentage(final NumberExpression property, final NumberBinding total) {
    return Bindings.when(property.isEqualTo(0)).then(0).otherwise(property.multiply(PERCENT).divide(total));
}