本文整理了Java中javafx.beans.value.WritableValue
类的一些代码示例,展示了WritableValue
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WritableValue
类的具体详情如下:
包路径:javafx.beans.value.WritableValue
类名称:WritableValue
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
public void applyEndValues() {
for (JFXKeyValue keyValue : keyValues) {
if (keyValue.isValid()) {
final WritableValue target = keyValue.getTarget();
if (target != null) {
final Object endValue = keyValue.getEndValue();
if (endValue != null && !target.getValue().equals(endValue)) {
target.setValue(endValue);
}
}
}
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
public void applyCloseValues(){
target.setValue(getCloseValueSupplier().get());
}
代码示例来源:origin: jfoenixadmin/JFoenix
void reverse(double now) {
currentDuration = duration - (currentDuration - now);
// update initial values
for (JFXKeyValue keyValue : keyValues) {
final WritableValue target = keyValue.getTarget();
if (target != null) {
initialValuesMap.put(target, target.getValue());
endValuesMap.put(target, keyValue.getEndValue());
}
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
public void applyOpenValues() {
target.setValue(getOpenValueSupplier().get());
}
代码示例来源:origin: jfoenixadmin/JFoenix
public void init() {
finished = false;
for (JFXKeyValue keyValue : keyValues) {
if (keyValue.getTarget() != null) {
// replaced putIfAbsent for mobile compatibility
if (!initialValuesMap.containsKey(keyValue.getTarget())) {
initialValuesMap.put(keyValue.getTarget(), keyValue.getTarget().getValue());
}
if (!endValuesMap.containsKey(keyValue.getTarget())) {
endValuesMap.put(keyValue.getTarget(), keyValue.getEndValue());
}
}
}
}
代码示例来源:origin: jfoenixadmin/JFoenix
public void animate(double now) {
if (now <= currentDuration) {
for (JFXKeyValue keyValue : keyValues) {
if (keyValue.isValid()) {
final WritableValue target = keyValue.getTarget();
final Object endValue = endValuesMap.get(target);
if (endValue != null && target != null && !target.getValue().equals(endValue)) {
target.setValue(keyValue.getInterpolator().interpolate(initialValuesMap.get(target), endValue, now / currentDuration));
}
}
}
} else {
if (!finished) {
finished = true;
for (JFXKeyValue keyValue : keyValues) {
if (keyValue.isValid()) {
final WritableValue target = keyValue.getTarget();
if (target != null) {
// set updated end value instead of cached
final Object endValue = keyValue.getEndValue();
if (endValue != null) {
target.setValue(endValue);
}
}
}
}
currentDuration = duration;
}
}
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.core.databinding
@SuppressWarnings("unchecked")
@Override
protected void doSetValue(Object value) {
property.setValue((T) value);
}
};
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.core.databinding
@Override
protected Object doGetValue() {
return property.getValue();
}
代码示例来源:origin: com.google.code.validationframework/validationframework-experimental
@Override
public void setValue(W w) {
if (!ValueUtils.areEqual(wrapped.getValue(), w)) {
wrapped.setValue(w);
}
}
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.core.databinding
@Override
public void changed(ObservableValue<? extends E> observable, E oldValue, E newValue) {
if (this.syncing) {
return;
}
try {
this.syncing = true;
if (observable == fxObs) {
dbObs.setValue(newValue);
} else {
fxObs.setValue(newValue);
}
} finally {
this.syncing = false;
}
}
});
代码示例来源:origin: com.jfoenix/jfoenix
@Override
public boolean interpolate(boolean startValue, boolean endValue, double fraction) {
return condition.getAsBoolean()
? interpolator.interpolate(startValue, endValue, fraction)
: (boolean) target.getValue();
}
代码示例来源:origin: com.jfoenix/jfoenix
public void applyEndValues() {
for (JFXKeyValue keyValue : keyValues) {
if (keyValue.isValid()) {
final WritableValue target = keyValue.getTarget();
if (target != null) {
final Object endValue = keyValue.getEndValue();
if (endValue != null && !target.getValue().equals(endValue)) {
target.setValue(endValue);
}
}
}
}
}
代码示例来源:origin: com.jfoenix/jfoenix
public void applyOpenValues() {
target.setValue(getOpenValueSupplier().get());
}
代码示例来源:origin: com.jfoenix/jfoenix
@Override
public Object interpolate(Object startValue, Object endValue, double fraction) {
return condition.getAsBoolean()
? interpolator.interpolate(startValue, endValue, fraction)
: target.getValue();
}
代码示例来源:origin: com.jfoenix/jfoenix
public void animate(double now) {
if (now <= currentDuration) {
for (JFXKeyValue keyValue : keyValues) {
if (keyValue.isValid()) {
final WritableValue target = keyValue.getTarget();
final Object endValue = endValuesMap.get(target);
if (endValue != null && target != null && !target.getValue().equals(endValue)) {
target.setValue(keyValue.getInterpolator().interpolate(initialValuesMap.get(target), endValue, now / currentDuration));
}
}
}
} else {
if (!finished) {
finished = true;
for (JFXKeyValue keyValue : keyValues) {
if (keyValue.isValid()) {
final WritableValue target = keyValue.getTarget();
if (target != null) {
// set updated end value instead of cached
final Object endValue = keyValue.getEndValue();
if (endValue != null) {
target.setValue(endValue);
}
}
}
}
currentDuration = duration;
}
}
}
代码示例来源:origin: com.jfoenix/jfoenix
public void applyCloseValues(){
target.setValue(getCloseValueSupplier().get());
}
代码示例来源:origin: com.jfoenix/jfoenix
@Override
public double interpolate(double startValue, double endValue, double fraction) {
return condition.getAsBoolean()
? interpolator.interpolate(startValue, endValue, fraction)
: (double) target.getValue();
}
代码示例来源:origin: com.canoo.dolphin-platform/dolphin-platform-client-javafx
@Override
public <T> Binding to(Property<T> dolphinProperty, Converter<? super T, ? extends S> converter) {
Assert.requireNonNull(dolphinProperty, "dolphinProperty");
Assert.requireNonNull(converter, "converter");
final Subscription subscription = dolphinProperty.onChanged(event -> javaFxValue.setValue(converter.convert(dolphinProperty.get())));
javaFxValue.setValue(converter.convert(dolphinProperty.get()));
return () -> subscription.unsubscribe();
}
}
代码示例来源:origin: com.jfoenix/jfoenix
@Override
public int interpolate(int startValue, int endValue, double fraction) {
return condition.getAsBoolean()
? interpolator.interpolate(startValue, endValue, fraction)
: (int) target.getValue();
}
代码示例来源:origin: dev.rico/rico-remoting-client-javafx
@Override
public <T> Binding to(final Property<T> remotingProperty, final Converter<? super T, ? extends S> converter) {
Assert.requireNonNull(remotingProperty, "remotingProperty");
Assert.requireNonNull(converter, "converter");
final Subscription subscription = remotingProperty.onChanged(event -> javaFxValue.setValue(converter.convert(remotingProperty.get())));
javaFxValue.setValue(converter.convert(remotingProperty.get()));
return () -> subscription.unsubscribe();
}
}
内容来源于网络,如有侵权,请联系作者删除!