本文整理汇总了Java中javafx.beans.binding.FloatBinding类的典型用法代码示例。如果您正苦于以下问题:Java FloatBinding类的具体用法?Java FloatBinding怎么用?Java FloatBinding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FloatBinding类属于javafx.beans.binding包,在下文中一共展示了FloatBinding类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toFloatBinding
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
public static FloatBinding toFloatBinding(ObservableValue<? extends Number> ov) {
return new FloatBinding() {
{
bind(ov);
}
@Override
protected float computeValue() {
return ov.getValue() == null ? 0 : ov.getValue().floatValue();
}
};
}
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:13,代码来源:BeanConvertUtil.java
示例2: selectFloat
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
public FloatBinding selectFloat(Function<S, ? extends ObservableFloatValue> childPropertyAccessor) {
return selectFloat(childPropertyAccessor, 0.0f);
}
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:4,代码来源:ChainedBindingFunctions.java
示例3: mapToFloat
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
public FloatBinding mapToFloat(Function<S, Float> childValueAccessor) {
return mapToFloat(childValueAccessor, 0.0f);
}
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:4,代码来源:ChainedBindingFunctions.java
示例4: FloatBindingAssert
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
protected FloatBindingAssert(FloatBinding actual) {
super(actual, FloatBindingAssert.class);
}
开发者ID:lestard,项目名称:assertj-javafx,代码行数:4,代码来源:FloatBindingAssert.java
示例5: testFloatBinding
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
@Test
public void testFloatBinding(){
FloatProperty value = new SimpleFloatProperty(10f);
final FloatBinding actual = value.add(20);
assertThat(actual).hasValue(30f);
assertThat(actual).hasSameValue(actual);
}
开发者ID:lestard,项目名称:assertj-javafx,代码行数:11,代码来源:FloatTest.java
示例6: asFloat
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
/**
* 建立包裝目前觀察值為浮點型態的繫節。
*
* @param thiz 來源觀察值
* @param mapper 轉換目前觀察值為浮點型態的函數
* @return 浮點型態的繫節(依賴目前的觀察物件)
*/
default FloatBinding asFloat(Function<? super T, ? extends Float> mapper)
{
ObservableValue<T> thiz = (ObservableValue<T>) this;
return Bindings.createFloatBinding(() -> mapper.apply(thiz.getValue()), thiz);
}
开发者ID:SkyLandTW,项目名称:JXTN,代码行数:13,代码来源:ObservableValueExt.java
示例7: abs
import javafx.beans.binding.FloatBinding; //导入依赖的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
示例8: copySign
import javafx.beans.binding.FloatBinding; //导入依赖的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
示例9: max
import javafx.beans.binding.FloatBinding; //导入依赖的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
示例10: min
import javafx.beans.binding.FloatBinding; //导入依赖的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
示例11: nextAfter
import javafx.beans.binding.FloatBinding; //导入依赖的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
示例12: nextDown
import javafx.beans.binding.FloatBinding; //导入依赖的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
示例13: nextUp
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
/**
* Binding for {@link java.lang.Math#nextUp(float)}
*
* @param f starting floating-point value
* @return The adjacent floating-point value closer to positive
* infinity.
*/
public static FloatBinding nextUp(final ObservableFloatValue f) {
return createFloatBinding(() -> Math.nextUp(f.get()), f);
}
开发者ID:lestard,项目名称:advanced-bindings,代码行数:11,代码来源:MathBindings.java
示例14: scalb
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
/**
* Binding for {@link java.lang.Math#scalb(float, int)}
*
* @param f number to be scaled by a power of two.
* @param scaleFactor power of 2 used to scale {@code f}
* @return {@code f} × 2<sup>{@code scaleFactor}</sup>
*/
public static FloatBinding scalb(final ObservableFloatValue f, final ObservableIntegerValue scaleFactor) {
return createFloatBinding(()->Math.scalb(f.get(), scaleFactor.get()),f, scaleFactor);
}
开发者ID:lestard,项目名称:advanced-bindings,代码行数:11,代码来源:MathBindings.java
示例15: signum
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
/**
* Binding for {@link java.lang.Math#signum(float)}
*
* @param f the floating-point value whose signum is to be returned
* @return the signum function of the argument
*/
public static FloatBinding signum(final ObservableFloatValue f) {
return createFloatBinding(() -> Math.signum(f.get()), f);
}
开发者ID:lestard,项目名称:advanced-bindings,代码行数:10,代码来源:MathBindings.java
示例16: ulp
import javafx.beans.binding.FloatBinding; //导入依赖的package包/类
/**
* Binding for {@link java.lang.Math#ulp(float)}
*
* @param f the floating-point value whose ulp is to be returned
* @return the size of an ulp of the argument
*/
public static FloatBinding ulp(final ObservableFloatValue f) {
return createFloatBinding(() -> Math.ulp(f.get()), f);
}
开发者ID:lestard,项目名称:advanced-bindings,代码行数:10,代码来源:MathBindings.java
注:本文中的javafx.beans.binding.FloatBinding类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论