private Timeline createHideTimeline(final Popup popup, NotificationBar bar, final Pos p, Duration startDelay, Notifications notification) {
KeyValue fadeOutBegin = new KeyValue(bar.opacityProperty(), 1.0);
KeyValue fadeOutEnd = new KeyValue(bar.opacityProperty(), 0.0);
KeyFrame kfBegin = new KeyFrame(Duration.ZERO, fadeOutBegin);
KeyFrame kfEnd = new KeyFrame(Duration.millis(500), fadeOutEnd);
Timeline timeline = new Timeline(kfBegin, kfEnd);
timeline.setDelay(startDelay);
timeline.setOnFinished(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
hide(popup, p);
notification.onHideAction.handle(e);
}
});
return timeline;
}
Notifications.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:yfiton
作者:
评论列表
文章目录