Package javafx.animation

Examples of javafx.animation.TranslateTransition


                selectedStateChanged();
        });
    }

    private void selectedStateChanged() {
        TranslateTransition transition = new TranslateTransition(Duration.millis(100), thumb);
        double thumbAreaWidth = snapSize(thumbArea.prefWidth(-1));
        double thumbWidth = snapSize(thumb.prefWidth(-1));

        if (!getSkinnable().isSelected())
            transition.setByX(-(thumbAreaWidth - thumbWidth));
        else {
            transition.setByX(thumbAreaWidth - thumbWidth);
        }
        transition.setCycleCount(1);
        transition.play();
    }
View Full Code Here


     * Build a sliding animation.
     *
     * @return a sliding animation
     */
    private Animation buildSliding() {
        return new TranslateTransition();
    }
View Full Code Here

        thumb.setStyle("-thumb-color: " + Util.colorToCss((Color) getSkinnable().getThumbColor()) + ";");

        pane = new Pane(background, selectedText, deselectedText, thumb);
        pane.getStyleClass().setAll("on-off-switch");

        moveToDeselected = new TranslateTransition(Duration.millis(180), thumb);
        moveToSelected = new TranslateTransition(Duration.millis(180), thumb);

        // Add all nodes
        getChildren().setAll(pane);
    }
View Full Code Here

        thumb.setMouseTransparent(true);

        pane = new Pane(background, symbol, text, thumb);
        pane.getStyleClass().setAll("icon-switch");

        moveToDeselected = new TranslateTransition(Duration.millis(180), thumb);
        moveToSelected = new TranslateTransition(Duration.millis(180), thumb);

        // Add all nodes
        getChildren().setAll(pane);
    }
View Full Code Here

    public static FadeTransition fadeIn(@Nonnull Node node) {
        return fadeIn(node, 1000);
    }

    public static ParallelTransition horizontalTransition(@Nonnull Node node, double start_x, double end_x, double mills) {
        TranslateTransition translate = new TranslateTransition(Duration.millis(mills));
        translate.setFromX(start_x);
        translate.setToX(end_x);
        ParallelTransition pt = new ParallelTransition(node, translate);
        return pt;
    }
View Full Code Here

        ParallelTransition pt = new ParallelTransition(node, translate);
        return pt;
    }

    public static ParallelTransition verticalTransition(@Nonnull Node node, double start_y, double end_y, double mills) {
        TranslateTransition translate = new TranslateTransition(Duration.millis(mills));
        translate.setFromY(start_y);
        translate.setToY(end_y);
        ParallelTransition pt = new ParallelTransition(node, translate);
        return pt;
    }
View Full Code Here

    public static FadeTransition fadeIn(@Nonnull Node node) {
        return fadeIn(node, 1000);
    }

    public static ParallelTransition horizontalTransition(@Nonnull Node node, double start_x, double end_x, double mills) {
        TranslateTransition translate = new TranslateTransition(Duration.millis(mills));
        translate.setFromX(start_x);
        translate.setToX(end_x);
        ParallelTransition pt = new ParallelTransition(node, translate);
        return pt;
    }
View Full Code Here

        ParallelTransition pt = new ParallelTransition(node, translate);
        return pt;
    }

    public static ParallelTransition verticalTransition(@Nonnull Node node, double start_y, double end_y, double mills) {
        TranslateTransition translate = new TranslateTransition(Duration.millis(mills));
        translate.setFromY(start_y);
        translate.setToY(end_y);
        ParallelTransition pt = new ParallelTransition(node, translate);
        return pt;
    }
View Full Code Here

        thumb.setStyle("-thumb-color: " + Util.colorToCss((Color) getSkinnable().getThumbColor()) + ";");

        pane = new Pane(background, selectedText, deselectedText, thumb);
        pane.getStyleClass().setAll("on-off-switch");

        moveToDeselected = new TranslateTransition(Duration.millis(180), thumb);
        moveToSelected = new TranslateTransition(Duration.millis(180), thumb);

        // Add all nodes
        getChildren().setAll(pane);
    }
View Full Code Here

        thumb.setMouseTransparent(true);

        pane = new Pane(background, symbol, text, thumb);
        pane.getStyleClass().setAll("icon-switch");

        moveToDeselected = new TranslateTransition(Duration.millis(180), thumb);
        moveToSelected = new TranslateTransition(Duration.millis(180), thumb);

        // Add all nodes
        getChildren().setAll(pane);
    }
View Full Code Here

TOP

Related Classes of javafx.animation.TranslateTransition

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.