本文整理汇总了Java中javafx.beans.property.DoubleProperty.set方法的典型用法代码示例。如果您正苦于以下问题:Java DoubleProperty.set方法的具体用法?Java DoubleProperty.set怎么用?Java DoubleProperty.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.beans.property.DoubleProperty
的用法示例。
在下文中一共展示了DoubleProperty.set方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startPanAnimation
import javafx.beans.property.DoubleProperty; //导入方法依赖的package包/类
private void startPanAnimation(double velocity, Timeline timeline, DoubleProperty animatedPan, DoubleProperty pan) {
if (isRunning(timeline)) {
return;
}
double durationInMillis = 1e10;
double distance = velocity * durationInMillis;
animatedPan.set(pan.get());
KeyValue keyValue = new KeyValue(animatedPan, animatedPan.get() - distance);
KeyFrame keyFrame = new KeyFrame(Duration.millis(durationInMillis), keyValue);
timeline.getKeyFrames().setAll(keyFrame);
timeline.playFromStart();
}
示例2: bind
import javafx.beans.property.DoubleProperty; //导入方法依赖的package包/类
public void bind(final DoubleProperty property, final String propertyName) {
String value = props.getProperty(propertyName);
if (value != null) {
property.set(Double.valueOf(value));
}
property.addListener(new InvalidationListener() {
@Override
public void invalidated(Observable o) {
props.setProperty(propertyName, property.getValue().toString());
}
});
}
示例3: setPointCircles
import javafx.beans.property.DoubleProperty; //导入方法依赖的package包/类
public void setPointCircles(MouseEvent event, Circle controlPointCircle, DoubleProperty controlPointX,
DoubleProperty controlPointY) {
double x = event.getX() + controlPointCircle.getLayoutX();
double y = event.getY() + controlPointCircle.getLayoutY();
double dataX = getXAxis().getValueForDisplay(x).doubleValue();
double dataY = getYAxis().getValueForDisplay(y).doubleValue();
controlPointX.set(clamp(dataX));
controlPointY.set(clamp(dataY));
requestChartLayout();
}
示例4: configureDividerPosition
import javafx.beans.property.DoubleProperty; //导入方法依赖的package包/类
private void configureDividerPosition() {
String stored = propertyStore.getProperty(PropertyKey.DIVIDER_POSITION);
DoubleProperty dividerPosition = outerPane.getDividers().get(0).positionProperty();
if (stored != null && MathFunctions.canParseDouble(stored)) {
initialDividerPosition = Double.parseDouble(stored);
} else {
initialDividerPosition = DEFAULT_DIVIDER_POSITION;
}
dividerPosition.set(initialDividerPosition);
dividerPosition.addListener((v, o, n) -> propertyStore.setProperty(PropertyKey.DIVIDER_POSITION, "" + n.doubleValue()));
}
示例5: progressSet
import javafx.beans.property.DoubleProperty; //导入方法依赖的package包/类
private static void progressSet(DoubleProperty progress, double value) {
if (progress != null) progress.set(value);
}
示例6: onAnimatedPanChanged
import javafx.beans.property.DoubleProperty; //导入方法依赖的package包/类
private void onAnimatedPanChanged(DoubleProperty animatedPan, DoubleProperty pan) {
pan.set(Math.round(animatedPan.get()));
if (onDragged != null) {
onDragged.accept(calculateDragDelta());
}
}