Modify the DrawStars example so that all the stars have Rotate transition animations that execute indefinitelythat is,
Question:
Modify the DrawStars example so that all the stars have Rotate transition animations that execute indefinitely—that is, set each animation’s cycle count to Animation.INDEFINITE.
DrawStars example
Transcribed Image Text:
// Fig. 22.7: DrawStarsController.java 2 // Create a circle of stars using Polygons and Rotate transforms import java.security. SecureRandom; import javafx.fxml.FXML; 2345 5 import javafx.scene.layout. Pane; 6 import javafx.scene.paint.Color; 7 import javafx.scene.shape. Polygon; 8 import javafx.scene.transform. Transform; 9. 10 11 12 13 14 15 16 17 18 19 20 21 22222222 public class DrawStars Controller { 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 } @FXML private Pane pane; private static final SecureRandom random = new SecureRandom(); public void initialize() { // points that define a five-pointed star shape Double[] points (205.0,150.0, 217.0, 186.0, 259.0,186.0, 223.0,204.0, 233.0,246.0, 205.0,222.0, 177.0,246.0, 187.0,204.0, 151.0,186.0, 193.0,186.0}; // create 18 stars for (int count = 0; count <18; ++count) { } // create a new Polygon and copy existing points into it Polygon newStar = new Polygon(); newStar.getPoints().addAll(points); // create random Color and set as newStar's fill newStar.setStroke (Color.GREY); newStar.setFill(Color.rgb(random.nextInt(255), random.nextInt(255), random.nextInt(255), random.nextDouble())); // apply a rotation to the shape newStar.getTransforms().add( Transform.rotate(count 20, 150, 150)); pane.getChildren().add(newStar); Draw Stars
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (QA)
Answered By
Rukhsar Ansari
I am professional Chartered accountant and hold Master degree in commerce. Number crunching is my favorite thing. I have teaching experience of various subjects both online and offline. I am online tutor on various online platform.
5.00+
4+ Reviews
17+ Question Solved
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Question Posted:
Students also viewed these Computer science questions
-
Briefly describe ASCII and Unicode and draw attention to any relationship between them. [3 marks] (b) Briefly explain what a Reader is in the context of reading characters from data. [3 marks] A...
-
ttth Suppose that the sequence of bags {Bn | n N} is recursively enumerated by the computable function e(n, x) = fn(x), [7 marks] Hence prove that the set of all recursive bags cannot be recursively...
-
Portray in words what transforms you would have to make to your execution to some degree (a) to accomplish this and remark on the benefits and detriments of this thought.You are approached to compose...
-
Consider two farmers, A and B, produce farm products and sell in the same market. Assume that the supply of the two farmers products are the same but the demand for Farmer Bs product is relatively...
-
The affiliation structure for Pad Corporation and its subsidiaries is diagrammed as follows: The incomes and dividends for the affiliates for 2016 are (in thousands): ADDITIONAL INFORMATION 1. Axe...
-
Ed Butler is the production manager for the Bilco Corporation, which produces three types of spare parts for automobiles. The manufacture of each part requires processing on each of two machines,...
-
Explain how emissions trading schemes are likely to affect financial reporting.
-
Income statements are presented for the Elf Corporation for the years ending December 31, 2010, 2009, and 2008. Required: Write a one-paragraph analysis of Elf Corporation's profit performance for...
-
In the space provided, 150- to 350-word summary of your financial analysis from Part 2: Financial Ratio Calculations. Include the following in your summary: Make final recommendations as to whether...
-
Rewrite the Account class to store the balance as a BigDecimal object and to perform all calculations using BigDecimals. Account class 2 3 4 5 6 7 // Fig. 7.8: Account.java // Account class with a...
-
It is best for a country never to borrow from foreign lenders. Do you agree or disagree? Why?
-
Show that the coefficient pd (n) of xn in the formal power series expansion of (1 + x) (1 + x2) (1 + x3) equals the number of partitions of n into distinct parts, that is, the number of ways to...
-
Would the cross price elasticity of demand between broccoli and asparagus be positive or negative?
-
In detail compare and contrast monopolistic competition and perfect competition.
-
The current code includes two classes that represent the APIs for Google and AWS services, but only a subset of the methods implemented are required for application. Because we want to expose the...
-
Explain i n periods of high rates of inflation money is a good store of value. since many forms of money do not earn interest, people's demand for money is unaffected by changes in interest rates.
-
How is Conversion Cycle related with other transaction cycles?
-
Suppose the incline is frictionless for the system described in Problem 54 (Fig. P8.54). The block is released from rest with the spring initially unstretched. (a) How far does it move down the...
-
What services are provided by the provincial and territorial governments?
-
Kindly use the video link below to answer all four questions. Below is the video link: https://www.ted.com/talks/hugh_herr_how_we_ll_become_cyborgs_and_extend_human_potential/transcript 1. reasons...
-
Solve the following equations in the interval [0,2): a) tan + 3=0 b) sin(30) = 1 c) 8 12sin20 = 4cos20 d) sin cos 0 = 1 e) csc0 = 1
-
Verify the following identities: a) cosx csc x- csc x = - sin x b) (1 tan x)(1- cot x) = 2 c) cos20-tan20 sin20 = cot20sec 20 d) 4sin20+2cos20 = 4 - 2cos20 e) f) 1+secz secr cos(a+3) sin a cos 3 sin...
Study smarter with the SolutionInn App