use of javafx.animation.KeyValue in project fxexperience2 by EricCanull.
the class BounceInDownTransition method starting.
@Override
protected void starting() {
double startY = -node.localToScene(0, 0).getY() - node.getBoundsInParent().getHeight();
timeline = new Timeline();
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateYProperty(), startY, WEB_EASE)));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(600), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateYProperty(), 30, WEB_EASE)));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(800), new KeyValue(node.translateYProperty(), -10, WEB_EASE)));
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(1000), new KeyValue(node.translateYProperty(), 0, WEB_EASE)));
super.starting();
}
use of javafx.animation.KeyValue in project fxexperience2 by EricCanull.
the class BounceOutDownTransition method starting.
@Override
protected void starting() {
double endY = node.getScene().getHeight() - node.localToScene(0, 0).getY();
timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(node.translateYProperty(), 0, WEB_EASE)), new KeyFrame(Duration.millis(200), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateYProperty(), -20, WEB_EASE)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateYProperty(), endY, WEB_EASE)));
super.starting();
}
use of javafx.animation.KeyValue in project fxexperience2 by EricCanull.
the class FadeInLeftBigTransition method starting.
@Override
protected void starting() {
double startX = -node.localToScene(0, 0).getX() - node.getBoundsInParent().getWidth();
timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateXProperty(), startX, WEB_EASE)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateXProperty(), 0, WEB_EASE)));
super.starting();
}
use of javafx.animation.KeyValue in project fx2048 by brunoborges.
the class Board method animateScore.
public void animateScore() {
if (gameMovePoints.get() == 0) {
return;
}
final Timeline timeline = new Timeline();
lblPoints.setText("+" + gameMovePoints.getValue().toString());
lblPoints.setOpacity(1);
double posX = vScore.localToScene(vScore.getWidth() / 2d, 0).getX();
lblPoints.setTranslateX(0);
lblPoints.setTranslateX(lblPoints.sceneToLocal(posX, 0).getX() - lblPoints.getWidth() / 2d);
lblPoints.setLayoutY(20);
final KeyValue kvO = new KeyValue(lblPoints.opacityProperty(), 0);
final KeyValue kvY = new KeyValue(lblPoints.layoutYProperty(), 100);
Duration animationDuration = Duration.millis(600);
final KeyFrame kfO = new KeyFrame(animationDuration, kvO);
final KeyFrame kfY = new KeyFrame(animationDuration, kvY);
timeline.getKeyFrames().add(kfO);
timeline.getKeyFrames().add(kfY);
timeline.play();
}
use of javafx.animation.KeyValue in project Gargoyle by callakrsos.
the class CrudBaseGridView method saveBtnClickHandler.
/**
* 저장버튼 클릭 핸들러
*
* @param saveClickCallbackProperty2
*
* @Date 2015. 10. 10.
* @return
* @User KYJ
*/
private EventHandler<MouseEvent> saveBtnClickHandler(ObjectProperty<Consumer<List<T>>> saveClickCallbackProperty) {
return new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
try {
Consumer<List<T>> callback = saveClickCallbackProperty.get();
if (callback == null) {
errorMsgCallback.accept("saveClickCallback 함수에 에러메세지 콜백을 등록하세요.");
return;
}
gridview.fireEvent(event);
List<T> items = getItems();
//필수값 검증로직 추가. 2016.12.08
AbstractVoNullChecker<T> nullCheckHandler = new DefaultVoNullChecker<>(CrudBaseGridView.this);
nullCheckHandler.setList(items);
Optional<Field> findFirst = nullCheckHandler.findFirst();
boolean present = findFirst.isPresent();
if (present) {
String msgFieldName = nullCheckHandler.getMsgNameByfield();
// String message = ValueUtil.getMessage("MSG_W_000001", msgFieldName);
int emptyIndex = nullCheckHandler.getEmptyIndex();
Set<Node> findAllByNodes = CrudBaseGridView.this.lookupAll("TableRow");
findAllByNodes.stream().map(n -> (TableRow) n).filter(r -> {
return emptyIndex == r.getIndex();
}).findFirst().ifPresent(n -> {
Timeline timeline = new Timeline();
timeline.setCycleCount(10);
timeline.setAutoReverse(true);
KeyFrame keyFrame = new KeyFrame(Duration.millis(500), new KeyValue(n.styleProperty(), "-fx-border-color : red ; -fx-border-width : 1px"));
KeyFrame keyFrame2 = new KeyFrame(Duration.millis(500), new KeyValue(n.styleProperty(), ""));
KeyValue keyValueX = new KeyValue(n.styleProperty(), "-fx-border-color : red ; -fx-border-width : 1px");
KeyValue keyValueY = new KeyValue(n.styleProperty(), "");
KeyFrame keyFrame3 = new KeyFrame(Duration.seconds(2), "", keyValueX, keyValueY);
timeline.getKeyFrames().add(keyFrame3);
timeline.play();
});
getSelectionModel().select(emptyIndex);
// DialogUtil.showMessageDialog(SharedMemory.getPrimaryStage(), msgFieldName + " Field is empty.");
return;
}
List<T> arrayList = new ArrayList<T>(items);
arrayList.addAll(deleteItems);
callback.accept(arrayList);
// 사용자 정의 로직이 이상없으면 deleteItems 항목도 비운다.
deleteItems.clear();
} catch (Exception e) {
throw e;
}
}
};
}
Aggregations