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: 50% (2 reviews)
import javafxanimationAnimation import javafxanimationRotateTransition import javafxutilDuration oth...View the full answer
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...
-
What seems to be the mission of Medtronics as it relates to its business partners?
-
What are the two basic questions in inventory management discussed in the text? LO.1
-
Quick Company reports the following revenues and expenses in its pretax financial income for the year ended December 31, 2007: Revenues ........$229,600 Expenses ............(160,100) Pretax...
-
Sixx AM Manufacturing has a target debtequity ratio of 2.2. Its cost of equity is 0.11, and its pretax cost of debt is 0.07. If the tax rate is 0.40, what is the company's WACC? Enter the answer with...
-
A month has elapsed since Precision Computer Centres year-end. Tony Freedman will use four specialized journals for recording business transactions in the month of Septemberyou will find two in...
-
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?
-
What is the best way to answer the question, Tell me about yourself?
-
Critical Values. In Exercises 41-44, find the indicated critical value. Round results to two decimal places. 41. Z0.25 42. Z090 43. Z0.02 44. Z0.05
-
Case Study X Ltd. has 10 lakhs equity shares outstanding at the beginning of the accounting year 2016. The appropriate P/E ratio for the industry in which D Ltd. is 8.35. The earnings per share is...
-
Notation of 0 + Using the same survey described in Exercise 1, the probability of randomly selecting 50 speaking characters from movies and getting 40 females is expressed as 0+. Does 0+ indicate...
-
A simple random sample of 10 pages from a dictionary is obtained. The numbers of words defined on those pages are found, with the results n = 10, x = 66.4 words, s = 16.6 words. Given that this...
-
Question 3 58.5 Average global temperature 1880-2013 58.0 $ 57.5 57.0 56.5 1880 1900 1920 1940 1960 1980 2000 2020 Year The graph above indicates that global temperatures have Ovaried randomly over...
-
Relate the concept of stock turnover to the growth of mass merchandising. Use a simple example in your answer.
-
A sample statistic will not change from sample to sample. Determine whether the statement is true or false. If it is false, rewrite it as a true statement.
-
Your company produces a health magazine. Its sales data for 1 - year subscriptions are as follows: Year of Operation Subscriptions Sold % Expired at Year End 2 0 2 0 $ 3 0 0 , 0 0 0 5 2 0 2 1 $ 6 4 7...
-
Problem 3 - 2 0 ( Static ) Calculate profitability and liquidity measures LO 3 - 3 , 3 - 4 , 3 - 6 Presented here are the comparative balance sheets of Hames Incorporated at December 3 1 , 2 0 2 3...
-
3 Required information [The following information applies to the questions displayed below) John and Sandy Ferguson got married eight years ago and have a seven-year-old daughter. Samantha. In 2020,...
Study smarter with the SolutionInn App