use of javafx.animation.FadeTransition in project bitsquare by bitsquare.
the class VolumeChart method seriesAdded.
@Override
protected void seriesAdded(XYChart.Series<Number, Number> series, int seriesIndex) {
for (int j = 0; j < series.getData().size(); j++) {
XYChart.Data item = series.getData().get(j);
Node volumeBar = createCandle(seriesIndex, item, j);
if (shouldAnimate()) {
volumeBar.setOpacity(0);
getPlotChildren().add(volumeBar);
FadeTransition ft = new FadeTransition(Duration.millis(500), volumeBar);
ft.setToValue(1);
ft.play();
} else {
getPlotChildren().add(volumeBar);
}
}
}
use of javafx.animation.FadeTransition in project sakuli by ConSol.
the class ProfileController method animateMessage.
private void animateMessage() {
FadeTransition ft = new FadeTransition(Duration.millis(1000), success);
ft.setFromValue(0.0);
ft.setToValue(1);
ft.play();
}
use of javafx.animation.FadeTransition in project SmartCity-Market by TechnionYP5777.
the class AbstractApplicationScreen method fadeTransition.
public static void fadeTransition(Node n) {
FadeTransition x = new FadeTransition(new Duration(2000), n);
x.setFromValue(0);
x.setToValue(100);
x.setCycleCount(1);
x.setInterpolator(Interpolator.LINEAR);
x.play();
}
use of javafx.animation.FadeTransition in project bitsquare by bitsquare.
the class CandleStickChart method dataItemAdded.
@Override
protected void dataItemAdded(XYChart.Series<Number, Number> series, int itemIndex, XYChart.Data<Number, Number> item) {
Node candle = createCandle(getData().indexOf(series), item, itemIndex);
if (getPlotChildren().contains(candle))
getPlotChildren().remove(candle);
if (shouldAnimate()) {
candle.setOpacity(0);
getPlotChildren().add(candle);
// fade in new candle
FadeTransition ft = new FadeTransition(Duration.millis(500), candle);
ft.setToValue(1);
ft.play();
} else {
getPlotChildren().add(candle);
}
if (series.getNode() instanceof Path) {
Path seriesPath = (Path) series.getNode();
seriesPath.toFront();
}
}
use of javafx.animation.FadeTransition in project bitsquare by bitsquare.
the class CandleStickChart method dataItemRemoved.
@Override
protected void dataItemRemoved(XYChart.Data<Number, Number> item, XYChart.Series<Number, Number> series) {
if (series.getNode() instanceof Path) {
Path seriesPath = (Path) series.getNode();
seriesPath.getElements().clear();
}
final Node node = item.getNode();
if (shouldAnimate()) {
// fade out old candle
FadeTransition ft = new FadeTransition(Duration.millis(500), node);
ft.setToValue(0);
ft.setOnFinished((ActionEvent actionEvent) -> {
getPlotChildren().remove(node);
});
ft.play();
} else {
getPlotChildren().remove(node);
}
}
Aggregations