javafx.beans.value.WritableValue.setValue()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中javafx.beans.value.WritableValue.setValue()方法的一些代码示例,展示了WritableValue.setValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WritableValue.setValue()方法的具体详情如下:
包路径:javafx.beans.value.WritableValue
类名称:WritableValue
方法名:setValue

WritableValue.setValue介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

public void applyCloseValues(){
  target.setValue(getCloseValueSupplier().get());
}

代码示例来源:origin: jfoenixadmin/JFoenix

public void applyOpenValues() {
  target.setValue(getOpenValueSupplier().get());
}

代码示例来源: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 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
  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

public void applyOpenValues() {
  target.setValue(getOpenValueSupplier().get());
}

代码示例来源:origin: com.jfoenix/jfoenix

public void applyCloseValues(){
  target.setValue(getCloseValueSupplier().get());
}

代码示例来源:origin: com.google.code.validationframework/validationframework-experimental

@Override
  public void setValue(W w) {
    if (!ValueUtils.areEqual(wrapped.getValue(), w)) {
      wrapped.setValue(w);
    }
  }
}

代码示例来源: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.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: 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();
  }
}

代码示例来源: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: org.graniteds/granite-client-javafx

convertedValue = convert ? convert(value) : value;
writableValue.setValue(convertedValue);

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.core.databinding

/**
 * Bind an javafx observable value to a eclipse db observable
 *
 * @param fxObs
 *            the javafx observable
 * @param dbObs
 *            the eclipse db observable
 * @param initialSync
 *            the initial sync direction
 * @param <E>
 *            the value type
 * @param <F>
 *            the observable value type
 */
@SuppressWarnings("unchecked")
public static <E, F extends ObservableValue<E> & WritableValue<E>> void bind(F fxObs, IObservableValue dbObs,
    InitialSync initialSync) {
  if (initialSync == InitialSync.FX_TO_DB) {
    dbObs.setValue(fxObs.getValue());
  } else {
    fxObs.setValue((E) dbObs.getValue());
  }
  ObservableWritableValue<E> wrapped = adapt(dbObs);
  do_bind(fxObs, wrapped);
}

代码示例来源:origin: org.graniteds/granite-client-javafx

writableValue.setValue(value);

相关文章