use of com.jfoenix.controls.events.JFXDialogEvent in project JFoenix by jfoenixadmin.
the class JFXDialog method close.
/**
* close the dialog
*/
public void close() {
animation.setRate(-1);
animation.play();
animation.setOnFinished((e) -> {
resetProperties();
onDialogClosedProperty.get().handle(new JFXDialogEvent(JFXDialogEvent.CLOSED));
dialogContainer.getChildren().remove(this);
});
}
use of com.jfoenix.controls.events.JFXDialogEvent in project JFoenix by jfoenixadmin.
the class JFXDialog method getShowAnimation.
/***************************************************************************
* *
* Transitions *
* *
**************************************************************************/
private Transition getShowAnimation(DialogTransition transitionType) {
Transition animation = null;
if (contentHolder != null) {
switch(transitionType) {
case LEFT:
contentHolder.setScaleX(1);
contentHolder.setScaleY(1);
contentHolder.setTranslateX(-offsetX);
animation = new LeftTransition();
break;
case RIGHT:
contentHolder.setScaleX(1);
contentHolder.setScaleY(1);
contentHolder.setTranslateX(offsetX);
animation = new RightTransition();
break;
case TOP:
contentHolder.setScaleX(1);
contentHolder.setScaleY(1);
contentHolder.setTranslateY(-offsetY);
animation = new TopTransition();
break;
case BOTTOM:
contentHolder.setScaleX(1);
contentHolder.setScaleY(1);
contentHolder.setTranslateY(offsetY);
animation = new BottomTransition();
break;
default:
contentHolder.setScaleX(0);
contentHolder.setScaleY(0);
animation = new CenterTransition();
break;
}
}
if (animation != null)
animation.setOnFinished((finish) -> onDialogOpenedProperty.get().handle(new JFXDialogEvent(JFXDialogEvent.OPENED)));
return animation;
}
Aggregations