本文整理汇总了Java中javafx.beans.property.DoubleProperty.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java DoubleProperty.setValue方法的具体用法?Java DoubleProperty.setValue怎么用?Java DoubleProperty.setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.beans.property.DoubleProperty
的用法示例。
在下文中一共展示了DoubleProperty.setValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: seriesAdded
import javafx.beans.property.DoubleProperty; //导入方法依赖的package包/类
@Override
protected void seriesAdded(Series<X, Y> series, int seriesIndex) {
// create new path for series
Path seriesLine = new Path();
seriesLine.setStrokeLineJoin(StrokeLineJoin.BEVEL);
series.setNode(seriesLine);
// create series Y multiplier
DoubleProperty seriesYAnimMultiplier = new SimpleDoubleProperty(this, "seriesYMultiplier");
seriesYMultiplierMap.put(series, seriesYAnimMultiplier);
// handle any data already in series
if (shouldAnimate()) {
seriesLine.setOpacity(0);
seriesYAnimMultiplier.setValue(0d);
} else {
seriesYAnimMultiplier.setValue(1d);
}
getPlotChildren().add(seriesLine);
List<KeyFrame> keyFrames = new ArrayList<KeyFrame>();
if (shouldAnimate()) {
// animate in new series
keyFrames.add(new KeyFrame(Duration.ZERO, new KeyValue(seriesLine.opacityProperty(), 0),
new KeyValue(seriesYAnimMultiplier, 0)));
keyFrames.add(new KeyFrame(Duration.millis(200), new KeyValue(seriesLine.opacityProperty(), 1)));
keyFrames.add(new KeyFrame(Duration.millis(500), new KeyValue(seriesYAnimMultiplier, 1)));
}
for (int j = 0; j < series.getData().size(); j++) {
Data<X, Y> item = series.getData().get(j);
final Node symbol = createSymbol(series, seriesIndex, item, j);
if (symbol != null) {
if (shouldAnimate())
symbol.setOpacity(0);
getPlotChildren().add(symbol);
if (shouldAnimate()) {
// fade in new symbol
keyFrames.add(new KeyFrame(Duration.ZERO, new KeyValue(symbol.opacityProperty(), 0)));
keyFrames.add(new KeyFrame(Duration.millis(200), new KeyValue(symbol.opacityProperty(), 1)));
}
}
}
if (shouldAnimate())
animate(keyFrames.toArray(new KeyFrame[keyFrames.size()]));
}
示例2: seriesAdded
import javafx.beans.property.DoubleProperty; //导入方法依赖的package包/类
@Override
protected void seriesAdded(MultiAxisChart.Series<X, Y> series, int seriesIndex) {
// create new paths for series
Path seriesLine = new Path();
Path fillPath = new Path();
seriesLine.setStrokeLineJoin(StrokeLineJoin.BEVEL);
Group areaGroup = new Group(fillPath, seriesLine);
series.setNode(areaGroup);
// create series Y multiplier
DoubleProperty seriesYAnimMultiplier = new SimpleDoubleProperty(this, "seriesYMultiplier");
seriesYMultiplierMap.put(series, seriesYAnimMultiplier);
// handle any data already in series
if (shouldAnimate()) {
seriesYAnimMultiplier.setValue(0d);
} else {
seriesYAnimMultiplier.setValue(1d);
}
getPlotChildren().add(areaGroup);
List<KeyFrame> keyFrames = new ArrayList<KeyFrame>();
if (shouldAnimate()) {
// animate in new series
keyFrames.add(new KeyFrame(Duration.ZERO, new KeyValue(areaGroup.opacityProperty(), 0),
new KeyValue(seriesYAnimMultiplier, 0)));
keyFrames.add(new KeyFrame(Duration.millis(200), new KeyValue(areaGroup.opacityProperty(), 1)));
keyFrames.add(new KeyFrame(Duration.millis(500), new KeyValue(seriesYAnimMultiplier, 1)));
}
for (int j = 0; j < series.getData().size(); j++) {
Data<X, Y> item = series.getData().get(j);
final Node symbol = createSymbol(series, seriesIndex, item, j);
if (symbol != null) {
if (shouldAnimate()) {
symbol.setOpacity(0);
getPlotChildren().add(symbol);
// fade in new symbol
keyFrames.add(new KeyFrame(Duration.ZERO, new KeyValue(symbol.opacityProperty(), 0)));
keyFrames.add(new KeyFrame(Duration.millis(200), new KeyValue(symbol.opacityProperty(), 1)));
} else {
getPlotChildren().add(symbol);
}
}
}
if (shouldAnimate())
animate(keyFrames.toArray(new KeyFrame[keyFrames.size()]));
}