本文整理汇总了Java中javafx.beans.value.WritableIntegerValue类的典型用法代码示例。如果您正苦于以下问题:Java WritableIntegerValue类的具体用法?Java WritableIntegerValue怎么用?Java WritableIntegerValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WritableIntegerValue类属于javafx.beans.value包,在下文中一共展示了WritableIntegerValue类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testJavaFXIntegerUnidirectional
import javafx.beans.value.WritableIntegerValue; //导入依赖的package包/类
@Test
public void testJavaFXIntegerUnidirectional() {
Property<Integer> integerDolphinProperty = new MockedProperty<>();
Property<Number> numberDolphinProperty = new MockedProperty<>();
IntegerProperty integerJavaFXProperty = new SimpleIntegerProperty();
WritableIntegerValue writableIntegerValue = new SimpleIntegerProperty();
integerDolphinProperty.set(47);
assertNotEquals(integerJavaFXProperty.doubleValue(), 47);
Binding binding = FXBinder.bind(integerJavaFXProperty).to(integerDolphinProperty);
assertEquals(integerJavaFXProperty.get(), 47);
integerDolphinProperty.set(100);
assertEquals(integerJavaFXProperty.get(), 100);
integerDolphinProperty.set(null);
assertEquals(integerJavaFXProperty.get(), 0);
binding.unbind();
integerDolphinProperty.set(100);
assertEquals(integerJavaFXProperty.get(), 0);
numberDolphinProperty.set(12);
binding = FXBinder.bind(integerJavaFXProperty).to(numberDolphinProperty);
assertEquals(integerJavaFXProperty.get(), 12);
numberDolphinProperty.set(null);
assertEquals(integerJavaFXProperty.get(), 0);
binding.unbind();
numberDolphinProperty.set(100);
assertEquals(integerJavaFXProperty.get(), 0);
integerDolphinProperty.set(47);
binding = FXBinder.bind(writableIntegerValue).to(integerDolphinProperty);
assertEquals(writableIntegerValue.get(), 47);
integerDolphinProperty.set(100);
assertEquals(writableIntegerValue.get(), 100);
integerDolphinProperty.set(null);
assertEquals(writableIntegerValue.get(), 0);
binding.unbind();
integerDolphinProperty.set(100);
assertEquals(writableIntegerValue.get(), 0);
}
示例2: marginHeightProperty
import javafx.beans.value.WritableIntegerValue; //导入依赖的package包/类
public WritableIntegerValue marginHeightProperty() {
return marginHeight;
}
示例3: marginWidthProperty
import javafx.beans.value.WritableIntegerValue; //导入依赖的package包/类
public WritableIntegerValue marginWidthProperty() {
return marginWidth;
}
示例4: bind
import javafx.beans.value.WritableIntegerValue; //导入依赖的package包/类
/**
* Start point of the fluent API to create a binding.
* @param writableDoubleValue the javafx property
* @return a binder that can be used by the fluent API to create binding.
*/
public static JavaFXBinder<Integer> bind(WritableIntegerValue writableDoubleValue) {
requireNonNull(writableDoubleValue, "writableDoubleValue");
return new DefaultJavaFXBinder(writableDoubleValue);
}