use of javafx.animation.KeyFrame in project arquivoProject by fader-azevedo.
the class PaginaInicialController method listaTodasPastas.
@FXML
private void listaTodasPastas() throws IOException {
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
try {
btnInicio.getStyleClass().clear();
btnEstante.getStyleClass().clear();
btnPratileira.getStyleClass().clear();
btnPasta.getStyleClass().add("butCriar");
btnPauta.getStyleClass().clear();
btnRegistar.getStyleClass().clear();
btnRegistar.getStyleClass().add("begin");
pnInicio.toFront();
pnPesquisa.getChildren().clear();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.load(getClass().getResource("/view/ListaPasta.fxml").openStream());
AnchorPane root = fxmlLoader.getRoot();
ListaPastaController listPastCont = fxmlLoader.getController();
listPastCont.scrollBtnPasta("", "");
pnInicio.getChildren().clear();
pnInicio.getChildren().add(root);
} catch (Exception e) {
}
}));
timeline.play();
}
use of javafx.animation.KeyFrame in project arquivoProject by fader-azevedo.
the class PaginaInicialController method criarEstantePane.
private void criarEstantePane() {
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
try {
btnInicio.getStyleClass().clear();
btnEstante.getStyleClass().clear();
btnPratileira.getStyleClass().clear();
btnPasta.getStyleClass().clear();
btnPauta.getStyleClass().clear();
btnRegistar.getStyleClass().add("butCriar");
pnInicio.getChildren().clear();
pnPesquisa.getChildren().clear();
pnCarregador.toFront();
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.load(getClass().getResource("/view/CriarEstante.fxml").openStream());
AnchorPane root = fxmlLoader.getRoot();
pnCarregador.getChildren().clear();
pnCarregador.getChildren().add(root);
} catch (IOException ex) {
Logger.getLogger(PaginaInicialController.class.getName()).log(Level.SEVERE, null, ex);
}
}));
timeline.play();
}
use of javafx.animation.KeyFrame in project arquivoProject by fader-azevedo.
the class PaginaInicialController method criarPratileiraPane.
private void criarPratileiraPane() {
Timeline timeline = new Timeline(new KeyFrame(Duration.millis(250), ev -> {
try {
btnInicio.getStyleClass().clear();
btnEstante.getStyleClass().clear();
btnPratileira.getStyleClass().clear();
btnPasta.getStyleClass().clear();
btnPauta.getStyleClass().clear();
btnRegistar.getStyleClass().add("butCriar");
pnInicio.getChildren().clear();
pnPesquisa.getChildren().clear();
pnCarregador.toFront();
Parent root = FXMLLoader.load(getClass().getResource("/view/CriarPratileira.fxml"));
pnCarregador.getChildren().clear();
pnCarregador.getChildren().add(root);
} catch (IOException ex) {
Logger.getLogger(PaginaInicialController.class.getName()).log(Level.SEVERE, null, ex);
}
}));
timeline.play();
}
use of javafx.animation.KeyFrame in project bisq-desktop by bisq-network.
the class Transitions method blur.
public void blur(Node node, int duration, double brightness, boolean removeNode, double blurRadius) {
if (removeEffectTimeLine != null)
removeEffectTimeLine.stop();
node.setMouseTransparent(true);
GaussianBlur blur = new GaussianBlur(0.0);
Timeline timeline = new Timeline();
KeyValue kv1 = new KeyValue(blur.radiusProperty(), blurRadius);
KeyFrame kf1 = new KeyFrame(Duration.millis(getDuration(duration)), kv1);
ColorAdjust darken = new ColorAdjust();
darken.setBrightness(0.0);
blur.setInput(darken);
KeyValue kv2 = new KeyValue(darken.brightnessProperty(), brightness);
KeyFrame kf2 = new KeyFrame(Duration.millis(getDuration(duration)), kv2);
timeline.getKeyFrames().addAll(kf1, kf2);
node.setEffect(blur);
if (removeNode)
timeline.setOnFinished(actionEvent -> UserThread.execute(() -> ((Pane) (node.getParent())).getChildren().remove(node)));
timeline.play();
}
use of javafx.animation.KeyFrame in project Board-Instrumentation-Framework by intel.
the class DynamicTransition method cube.
/**
* Cube transition between front- and backimage
*
* @param FRONT_IMAGE
* @param BACK_IMAGE
* @param INTERPOLATOR spline that is used for the animation
* @param DURATION oneSecond for the transition
* @param DELAY delay in milliseconds between each tile animation
*/
private void cube(final Image FRONT_IMAGE, final Image BACK_IMAGE, final Interpolator INTERPOLATOR, final Duration DURATION, final int DELAY) {
adjustTilesVisibility(1);
viewPorts.clear();
final Rectangle2D VIEW_PORT = new Rectangle2D(0, 0, FRONT_IMAGE.getWidth(), FRONT_IMAGE.getHeight());
for (int i = 0; i < (noOfTilesX * noOfTilesY); i++) {
imageViewsFront.get(i).setViewport(VIEW_PORT);
imageViewsBack.get(i).setViewport(VIEW_PORT);
}
imageViewsFront.get(0).setImage(FRONT_IMAGE);
imageViewsBack.get(0).setImage(BACK_IMAGE);
imageViewsFront.get(0).setTranslateZ(-0.5 * FRONT_IMAGE.getWidth());
imageViewsBack.get(0).setTranslateX(0.5 * FRONT_IMAGE.getWidth());
imageViewsBack.get(0).setRotationAxis(Rotate.Y_AXIS);
// imageViewsBack.get(0).setRotate(90);
// to grid would be reversed if didn't do this
imageViewsBack.get(0).setRotate(270);
Rotate rotateY = new Rotate(0, Rotate.Y_AXIS);
rotateY.setPivotX(FRONT_IMAGE.getWidth() * 0.5);
rotateY.setPivotZ(FRONT_IMAGE.getWidth() * 0.5);
rotateY.angleProperty().addListener((ov, oldAngle, newAngle) -> {
if (73 < newAngle.intValue()) {
imageViewsBack.get(0).toFront();
}
});
Translate translateZ = new Translate(0, 0, FRONT_IMAGE.getWidth() * 0.5);
tiles.get(0).getTransforms().setAll(rotateY, translateZ);
KeyValue kvRotateBegin = new KeyValue(rotateY.angleProperty(), 0, INTERPOLATOR);
KeyValue kvRotateEnd = new KeyValue(rotateY.angleProperty(), 90, INTERPOLATOR);
KeyValue kvOpacityFrontBegin = new KeyValue(imageViewsFront.get(0).opacityProperty(), 1.0, INTERPOLATOR);
KeyValue kvOpacityBackBegin = new KeyValue(imageViewsBack.get(0).opacityProperty(), 0.0, INTERPOLATOR);
KeyValue kvScaleXBegin = new KeyValue(tiles.get(0).scaleXProperty(), 1.0, INTERPOLATOR);
KeyValue kvScaleYBegin = new KeyValue(tiles.get(0).scaleYProperty(), 1.0, INTERPOLATOR);
KeyValue kvScaleXMiddle = new KeyValue(tiles.get(0).scaleXProperty(), 0.85, INTERPOLATOR);
KeyValue kvScaleYMiddle = new KeyValue(tiles.get(0).scaleYProperty(), 0.85, INTERPOLATOR);
KeyValue kvOpacityFrontMiddle = new KeyValue(imageViewsFront.get(0).opacityProperty(), 1.0, INTERPOLATOR);
KeyValue kvOpacityBackMiddle = new KeyValue(imageViewsBack.get(0).opacityProperty(), 1.0, INTERPOLATOR);
KeyValue kvScaleXEnd = new KeyValue(tiles.get(0).scaleXProperty(), 1.0, INTERPOLATOR);
KeyValue kvScaleYEnd = new KeyValue(tiles.get(0).scaleYProperty(), 1.0, INTERPOLATOR);
KeyValue kvOpacityFrontEnd = new KeyValue(imageViewsFront.get(0).opacityProperty(), 0.0, INTERPOLATOR);
KeyValue kvOpacityBackEnd = new KeyValue(imageViewsBack.get(0).opacityProperty(), 1.0, INTERPOLATOR);
KeyFrame kf0 = new KeyFrame(Duration.ZERO, kvRotateBegin, kvScaleXBegin, kvScaleYBegin, kvOpacityFrontBegin, kvOpacityBackBegin);
KeyFrame kf1 = new KeyFrame(DURATION.multiply(0.5), kvScaleXMiddle, kvScaleYMiddle, kvOpacityFrontMiddle, kvOpacityBackMiddle);
KeyFrame kf2 = new KeyFrame(DURATION, kvRotateEnd, kvScaleXEnd, kvScaleYEnd, kvOpacityFrontEnd, kvOpacityBackEnd);
timelines.get(0).setDelay(Duration.millis(DELAY));
timelines.get(0).getKeyFrames().setAll(kf0, kf1, kf2);
// Listen for the last timeline to finish and switch the images
timelines.get(0).setOnFinished(observable -> transitionFinished());
}
Aggregations