Package javafx.scene.paint

Examples of javafx.scene.paint.ImagePattern


                determinateProgressTransition.fractionProperty().addListener(new ChangeListener<Number>() {

                    @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                        StackPane bar = ((StackPane) getSkinnable().lookup(".bar"));
                        int start = 1 - (int) ((38 * bar.getHeight() / 20) * newValue.doubleValue());
                        ImagePattern pattern = new ImagePattern(image, start, 0, (38 * bar.getHeight() / 20), bar.getHeight(), false);

                        BackgroundFill backkgroudFill = new BackgroundFill(pattern, new CornerRadii(0), new Insets(0));

                        bar.setBackground(new Background(backkgroudFill));
                    }
                });
                determinateProgressTransition.play();
            }
        } else {
            StackPane bar = ((StackPane) getSkinnable().lookup(".bar"));
            ImagePattern pattern = new ImagePattern(image, 0, 0, (38 * bar.getHeight() / 20), bar.getHeight(), false);
            BackgroundFill backkgroudFill = new BackgroundFill(pattern, new CornerRadii(0), new Insets(0));
            bar.setBackground(new Background(backkgroudFill));
        }
    }
View Full Code Here


    public ImagePattern apply(final Shape SHAPE) {
        double x      = SHAPE.getLayoutBounds().getMinX();
        double y      = SHAPE.getLayoutBounds().getMinY();
        double width  = SHAPE.getLayoutBounds().getWidth();
        double height = SHAPE.getLayoutBounds().getHeight();
        return new ImagePattern(getImage(width, height), x, y, width, height, false);
    }
View Full Code Here

            bar.setRadiusY(RADIUS);
   
            if (getSkinnable().isBarGradientEnabled()) {
                recalculateBarGradient();
                Image image = barGradient.getImage(size, size);
                bar.setFill(new ImagePattern(image, 0, 0, size, size, false));
            } else {
                bar.setFill(new RadialGradient(0, 0,
                                               centerX, centerY,
                                               RADIUS, false, CycleMethod.NO_CYCLE,
                                               new Stop(0.0, barColor),
View Full Code Here

TOP

Related Classes of javafx.scene.paint.ImagePattern

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.