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...
-
The April 25, 2012, edition of the Wall Street Journal contains an article by Spencer Jakab entitled Amazons Valuation Is Hard to Justify. Instructions Read the article and answer the following...
-
Prior to the Tax Cuts and Jobs Act of 2018 (TCJA), multinational firms domiciled in the United States did not have to pay U.S. income taxes on foreign earnings, unless those earnings were returned...
-
With the growing popularity of casual surf print clothing, two recent MBA graduates decided to broaden this casual surf concept to encompass a surf lifestyle for the home. With limited capital, they...
-
Explain the difference between co-payment and co-insurance. Describe what a deductible is and how it's used
-
The marketing manager of Drexel-Hall is considering two alternative advertising strategies, each of which would cost $15,000 per month. One strategy is to advertise the name Drexel-Hall, which is...
-
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?
-
Working in small groups, plan a presentation to different audiences. Imagine that youre the management team of a moving company and are announcing the acquisition of a storage company. The storage...
-
A large dairy firm, the Cow and Buffalo Company, buys bins every year, which it uses in the warehousing of its bottled products. A local vender has offered the following discount schedule for bins...
-
What is the payback period method, briefly explain. What is the payback criterion decision rule? Moss fashions imposes a payback period method for its below international investment projects. If a...
-
In a joint processing operation, Nolen Company manufactures three grades of sugar from a common input, sugar cane. Joint processing costs up to the split-off point total $40,500 per year. The company...
-
Lara Ballbat Company buys ballbats from a manufacturer for $ 1 0 each. Lara expects to evenly sell 9 0 , 0 0 0 bats during the upcoming year. Lara's cost of capital is 1 0 % . The total relevant...
-
10 8 9 11 2 3 4 5 6 7 12 1 13 14 15 16 17 18 19 20 21 22 23 Accounts payable Accounts receivable Buildings, net of accumulated depreciation Cash Common stock Land Long-term debt Prepaid insurance...
-
What does the term activity-based management mean?
-
An example of prescriptive analytics is when an action is recommended based on previously observed actions. For example, an analysis might help determine procedures to follow when new accounts are...
-
I need the answer on paper not on excel... thanks
-
A box containing 1,000 coins is shaken , and the coins are emptied onto a table . Only the coins that land heads up are returned to the box , and then the process is repeated . The accompanying table...
-
Positive and Negative impact of covid on supply chain Please Provide references as well
Study smarter with the SolutionInn App