Package javafx.animation

Examples of javafx.animation.PauseTransition


    private void handleError(Exception e) {
        throw new RuntimeException("Unable to export to PDF", e);
    }

    public void doExport(final Profile profile, final int width, final int height) {
        final PauseTransition pt = new PauseTransition();
        pt.setDuration(Duration.millis(profile.getPause()));
        final AtomicInteger cpt = new AtomicInteger();
        final Document document = new Document(new Rectangle(width, height), 0, 0, 0, 0);
        try {
            PdfWriter.getInstance(document, new FileOutputStream(exportFile));
        } catch (DocumentException | FileNotFoundException e) {
            handleError(e);
            return;
        }
        document.open();
        profile.setDocument(document);
        pt.setOnFinished(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent actionEvent) {
                WritableImage image = browser.snapshot(null, null);
                BufferedImage bufferedImage = SwingFXUtils.fromFXImage(image, null);
                double scaler = ((document.getPageSize().getWidth() - document.leftMargin()
                        - document.rightMargin()) / image.getWidth()) * 100;

                try {
                    com.itextpdf.text.Image image2 =
                            com.itextpdf.text.Image.getInstance(bufferedImage, null);
                    image2.scalePercent((float) scaler);
                    document.add(image2);
                    document.newPage();
                    int current = cpt.incrementAndGet();
                    int nbSlides = profile.getSlideCount();
                    System.out.println("Exported slide " + current + (nbSlides > 0 ? "/" + nbSlides : ""));
                    if (!profile.isLastSlide(current)) {
                        profile.nextSlide();
                        pt.setDuration(Duration.millis(profile.getPause()));
                        pt.play();
                    } else {
                        profile.finish();
                        document.close();
                        System.out.println("Export complete.");
                        Platform.exit();
                    }
                } catch (IOException | DocumentException e) {
                    handleError(e);
                }
            }
        });
        webEngine.getLoadWorker().stateProperty().addListener(
                new ChangeListener<Worker.State>() {
                    public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) {
                        if (newState == Worker.State.SUCCEEDED) {
                            profile.setup();
                            profile.ready(new Runnable() { public void run() { pt.play(); } });
                        }
                    }
                });
    }
View Full Code Here


            // .interpolator(Interpolator.EASE_IN)
            // .build()
            // );
            i++;
        }
        final PauseTransition pt = PauseTransitionBuilder.create()
                .duration(Duration.seconds(1))
                .build();

        this.fullTransition = SequentialTransitionBuilder.create()
                .children(
View Full Code Here

        fadeUnitOut.setToValue(0.0);
        FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), value);
        fadeValueOut.setFromValue(1.0);
        fadeValueOut.setToValue(0.0);

        PauseTransition pause = new PauseTransition(Duration.millis(50));

        FadeTransition fadeUnitIn = new FadeTransition(Duration.millis(425), unit);
        fadeUnitIn.setFromValue(0.0);
        fadeUnitIn.setToValue(1.0);
        FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
View Full Code Here

        fadeUnitOut.setToValue(0.0);
        FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), value);
        fadeValueOut.setFromValue(1.0);
        fadeValueOut.setToValue(0.0);

        PauseTransition pause = new PauseTransition(Duration.millis(50));

        FadeTransition fadeUnitIn = new FadeTransition(Duration.millis(425), unit);
        fadeUnitIn.setFromValue(0.0);
        fadeUnitIn.setToValue(1.0);
        FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
View Full Code Here

       
        FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), value);
        fadeValueOut.setFromValue(1.0);
        fadeValueOut.setToValue(0.0);

        PauseTransition pause = new PauseTransition(Duration.millis(50));

        FadeTransition fadeInfoTextIn = new FadeTransition(Duration.millis(425), infoText);
        fadeInfoTextIn.setFromValue(0.0);
        fadeInfoTextIn.setToValue(1.0);
       
View Full Code Here

                        incrPos.setValue(0);                              

                        /*
                        * PAUSE BETWEEN ROTATIONS
                        */
                        pTrans=new PauseTransition();
                        if(content.getPostEffect().equals(Content.PostEffect.REPEAT)){
                            pTrans.setDuration(Duration.millis(10));
                        } else{
                            pTrans.setDuration(Duration.millis(content.getPause()));
                        }
View Full Code Here

       
        FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), value);
        fadeValueOut.setFromValue(1.0);
        fadeValueOut.setToValue(0.0);

        PauseTransition pause = new PauseTransition(Duration.millis(50));

        FadeTransition fadeInfoTextIn = new FadeTransition(Duration.millis(425), infoText);
        fadeInfoTextIn.setFromValue(0.0);
        fadeInfoTextIn.setToValue(1.0);
       
View Full Code Here

        fadeUnitOut.setToValue(0.0);
        FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), valueText);
        fadeValueOut.setFromValue(1.0);
        fadeValueOut.setToValue(0.0);

        PauseTransition pause = new PauseTransition(Duration.millis(50));

        FadeTransition fadeUnitIn = new FadeTransition(Duration.millis(425), unitText);
        fadeUnitIn.setFromValue(0.0);
        fadeUnitIn.setToValue(1.0);
        FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), valueText);
View Full Code Here

        fadeUnitOut.setToValue(0.0);
        FadeTransition fadeValueOut = new FadeTransition(Duration.millis(425), value);
        fadeValueOut.setFromValue(1.0);
        fadeValueOut.setToValue(0.0);

        PauseTransition pause = new PauseTransition(Duration.millis(50));

        FadeTransition fadeUnitIn = new FadeTransition(Duration.millis(425), unit);
        fadeUnitIn.setFromValue(0.0);
        fadeUnitIn.setToValue(1.0);
        FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
View Full Code Here

TOP

Related Classes of javafx.animation.PauseTransition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.