/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ package textimagepatternbug; import com.sun.javafx.runtime.VersionInfo; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.image.Image; import javafx.scene.paint.Color; import javafx.scene.paint.ImagePattern; import javafx.scene.shape.Ellipse; import javafx.scene.shape.Rectangle; /** * * @author Aleksandr Sakharuk */ public class EllipseImagePatternNotBug extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { Image image = new Image("file:resources/square.png"); ImagePattern pattern = new ImagePattern(image, 100, 50, 300, 200, false); Group root = new Group(); Ellipse e = new Ellipse(400, 150, 300, 100); e.setFill(pattern); root.getChildren().add(e); Rectangle r = new Rectangle(0, 300, 800, 300); r.setFill(pattern); root.getChildren().add(r); Ellipse e2 = new Ellipse(400, 450, 300, 100); e2.setFill(Color.BLUE); root.getChildren().add(e2); Scene scene = new Scene(root, 800, 600); primaryStage.setTitle("Hello World!"); primaryStage.setScene(scene); primaryStage.show(); System.out.println(VersionInfo.getRuntimeVersion()); } }