本文整理汇总了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);
}
示例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>");
}
}
示例5: selectFloat
import javafx.beans.value.ObservableFloatValue; //导入依赖的package包/类
public FloatBinding selectFloat(Function<S, ? extends ObservableFloatValue> childPropertyAccessor) {
return selectFloat(childPropertyAccessor, 0.0f);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}