當前位置: 首頁>>代碼示例>>Java>>正文


Java ObservableFloatValue類代碼示例

本文整理匯總了Java中javafx.beans.value.ObservableFloatValue的典型用法代碼示例。如果您正苦於以下問題:Java ObservableFloatValue類的具體用法?Java ObservableFloatValue怎麽用?Java ObservableFloatValue使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ObservableFloatValue類屬於javafx.beans.value包,在下文中一共展示了ObservableFloatValue類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testObservableFloatValue

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
@Test
public void testObservableFloatValue(){
    ObservableFloatValue actual = new SimpleFloatProperty(10f);

    assertThat(actual).hasValue(10f);

    assertThat(actual).hasSameValue(actual);
}
 
開發者ID:lestard,項目名稱:assertj-javafx,代碼行數:9,代碼來源:FloatTest.java

示例2: should_fail_if_actual_has_wrong_value

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
@Test
public void should_fail_if_actual_has_wrong_value(){
    try{
        ObservableFloatValue actual = new SimpleFloatProperty(10.123F);

        new ObservableNumberValueAssertions(actual).hasValue(10.12F, offset(0.001F));
        fail("Should throw an AssertionError");
    }catch(AssertionError error){
        assertThat(error).hasMessageContaining("less than <0.001> but difference was <0.0030002594>");
    }
}
 
開發者ID:lestard,項目名稱:assertj-javafx,代碼行數:12,代碼來源:ObservableNumberValueAssertions_hasValue_float_with_offset_Test.java

示例3: should_fail_if_offset_is_null

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
@Test
public void should_fail_if_offset_is_null(){
    try{
        ObservableFloatValue actual = new SimpleFloatProperty(10.123F);
        new ObservableNumberValueAssertions(actual).hasValue(10.123F, null);

        fail("Should throw an AssertionError");
    }catch(NullPointerException error){
        assertThat(error).hasMessageContaining("offset may not be null");
    }
}
 
開發者ID:lestard,項目名稱:assertj-javafx,代碼行數:12,代碼來源:ObservableNumberValueAssertions_hasValue_float_with_offset_Test.java

示例4: should_fail_if_actual_has_wrong_value

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
@Test
public void should_fail_if_actual_has_wrong_value(){
    try{
        ObservableFloatValue actual = new SimpleFloatProperty(1234.56F);

        new ObservableValueAssertions<>(actual).hasValue(1234F);
        fail("Should throw an AssertionError");
    }catch(AssertionError error){
        assertThat(error).hasMessageContaining("<1234.0> but was <1234.56>");
    }
}
 
開發者ID:lestard,項目名稱:assertj-javafx,代碼行數:12,代碼來源:ObservableValueAssertions_hasValue_float_Test.java

示例5: selectFloat

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
public FloatBinding selectFloat(Function<S, ? extends ObservableFloatValue> childPropertyAccessor) {
    return selectFloat(childPropertyAccessor, 0.0f);
}
 
開發者ID:rmfisher,項目名稱:fx-animation-editor,代碼行數:4,代碼來源:ChainedBindingFunctions.java

示例6: should_pass_if_actual_has_given_value_with_offset

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
@Test
public void should_pass_if_actual_has_given_value_with_offset(){
    ObservableFloatValue actual = new SimpleFloatProperty(10.123F);

    new ObservableNumberValueAssertions(actual).hasValue(10.12F, offset(0.01F));
}
 
開發者ID:lestard,項目名稱:assertj-javafx,代碼行數:7,代碼來源:ObservableNumberValueAssertions_hasValue_float_with_offset_Test.java

示例7: should_pass_if_actual_has_given_value

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
@Test
public void should_pass_if_actual_has_given_value(){
    ObservableFloatValue actual = new SimpleFloatProperty(1234.56F);

    new ObservableValueAssertions<>(actual).hasValue(1234.56F);
}
 
開發者ID:lestard,項目名稱:assertj-javafx,代碼行數:7,代碼來源:ObservableValueAssertions_hasValue_float_Test.java

示例8: testScalb

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Test
public void testScalb(){

    MathBindingsTestHelper.<Float, Integer, ObservableFloatValue, ObservableIntegerValue, Number>
        testTwoArgBinding1(MathBindings::scalb, Math::scalb, new Args<>(12f, 12), new Args<>(Float.NaN, 12), new Args<>(Float.POSITIVE_INFINITY, 3), new Args<>(0f, 3));

    MathBindingsTestHelper.<Float, Integer,  ObservableIntegerValue, Number>
        testTwoArgBinding2(MathBindings::scalb, Math::scalb, new Args<>(12f, 12), new Args<>(Float.NaN, 12), new Args<>(Float.POSITIVE_INFINITY, 3), new Args<>(0f, 3));

    MathBindingsTestHelper.<Float, Integer,  ObservableFloatValue, Number>
        testTwoArgBinding3(MathBindings::scalb, Math::scalb, new Args<>(12f, 12), new Args<>(Float.NaN, 12), new Args<>(Float.POSITIVE_INFINITY, 3), new Args<>(0f, 3));



    MathBindingsTestHelper.<Double, Integer, ObservableDoubleValue, ObservableIntegerValue, Number>
        testTwoArgBinding1(MathBindings::scalb, Math::scalb, new Args<>(12d, 12), new Args<>(Double.NaN, 12), new Args<>(Double.POSITIVE_INFINITY, 3), new Args<>(0d, 3));

    MathBindingsTestHelper.<Double, Integer,  ObservableIntegerValue, Number>
        testTwoArgBinding2(MathBindings::scalb, Math::scalb, new Args<>(12d, 12), new Args<>(Double.NaN, 12), new Args<>(Double.POSITIVE_INFINITY, 3), new Args<>(0d, 3));

    MathBindingsTestHelper.<Double, Integer,  ObservableDoubleValue, Number>
        testTwoArgBinding3(MathBindings::scalb, Math::scalb, new Args<>(12d, 12), new Args<>(Double.NaN, 12), new Args<>(Double.POSITIVE_INFINITY, 3), new Args<>(0d, 3));



}
 
開發者ID:lestard,項目名稱:advanced-bindings,代碼行數:28,代碼來源:MathBindingsTest.java

示例9: abs

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
/**
 * Binding for {@link java.lang.Math#abs(float)}
 *
 *  @param   a   the argument whose absolute value is to be determined as observableValue
 * @return  the absolute value of the argument.
 */
public static FloatBinding abs(final ObservableFloatValue a) {
    return createFloatBinding(() -> Math.abs(a.get()), a);
}
 
開發者ID:lestard,項目名稱:advanced-bindings,代碼行數:10,代碼來源:MathBindings.java

示例10: copySign

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
/**
 * Binding for {@link java.lang.Math#copySign(float, float)}
 *
 * @param magnitude  the parameter providing the magnitude of the result
 * @param sign   the parameter providing the sign of the result
 * @return a value with the magnitude of {@code magnitude}
 * and the sign of {@code sign}.
 */
public static FloatBinding copySign(final ObservableFloatValue magnitude, ObservableFloatValue sign) {
    return createFloatBinding(() -> Math.copySign(magnitude.get(), sign.get()), magnitude, sign);
}
 
開發者ID:lestard,項目名稱:advanced-bindings,代碼行數:12,代碼來源:MathBindings.java

示例11: getExponent

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
/**
 * Binding for {@link java.lang.Math#getExponent(float)}
 *
 * @param f a {@code float} value
 * @return the unbiased exponent of the argument
 */
public static IntegerBinding getExponent(final ObservableFloatValue f) {
    return createIntegerBinding(() -> Math.getExponent(f.get()), f);
}
 
開發者ID:lestard,項目名稱:advanced-bindings,代碼行數:10,代碼來源:MathBindings.java

示例12: max

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
/**
 * Binding for {@link java.lang.Math#max(float, float)}
 *
 * @param   a   an argument.
 * @param   b   another argument.
 * @return  the larger of {@code a} and {@code b}.
 */
public static FloatBinding max(final ObservableFloatValue a, final ObservableFloatValue b) {
    return createFloatBinding(() -> Math.max(a.get(), b.get()), a, b);
}
 
開發者ID:lestard,項目名稱:advanced-bindings,代碼行數:11,代碼來源:MathBindings.java

示例13: min

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
/**
 * Binding for {@link java.lang.Math#min(float, float)}
 *
 * @param   a   an argument.
 * @param   b   another argument.
 * @return  the smaller of {@code a} and {@code b}.
 */
public static FloatBinding min(final ObservableFloatValue a, final ObservableFloatValue b) {
    return createFloatBinding(() -> Math.min(a.get(), b.get()), a, b);
}
 
開發者ID:lestard,項目名稱:advanced-bindings,代碼行數:11,代碼來源:MathBindings.java

示例14: nextAfter

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
/**
 * Binding for {@link java.lang.Math#nextAfter(float, double)}
 *
 * @param start  starting floating-point value
 * @param direction value indicating which of
 * {@code start}'s neighbors or {@code start} should
 * be returned
 * @return The floating-point number adjacent to {@code start} in the
 * direction of {@code direction}.
 */
public static FloatBinding nextAfter(final ObservableFloatValue start, final ObservableFloatValue direction) {
    return createFloatBinding(() -> Math.nextAfter(start.get(), direction.get()), start, direction);
}
 
開發者ID:lestard,項目名稱:advanced-bindings,代碼行數:14,代碼來源:MathBindings.java

示例15: nextDown

import javafx.beans.value.ObservableFloatValue; //導入依賴的package包/類
/**
 * Binding for {@link java.lang.Math#nextDown(float)}
 *
 * @param f  starting floating-point value
 * @return The adjacent floating-point value closer to negative
 * infinity.
 */
public static FloatBinding nextDown(final ObservableFloatValue f) {
    return createFloatBinding(() -> Math.nextDown(f.get()), f);
}
 
開發者ID:lestard,項目名稱:advanced-bindings,代碼行數:11,代碼來源:MathBindings.java


注:本文中的javafx.beans.value.ObservableFloatValue類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。