Question: write in java .. This assignment problem is to practice using existing Java library classes and creating your own graphical class. You are asked to
This assignment problem is to practice using existing Java library classes and creating your own graphical class. You are asked to implement a class Flower, that represented by three values x center, y center, and radius. The x center, and y center is the x, y coordination's of the center of a Flower class. The radius is the radius of the circle around the Flower Create a NetBeans project named HW1Yourld. Create a class named Flower stored in a file Flower.java, a component class to create Flower objects, and a tester class named HWI Yourld.java. Class Flower Definition: .Define three double instance variables to hold a Flower object x center, y center, and radius Provide the following as public interface of class Flower A constructor that receives three parameters to initialize the three instance variables. Flower (double x, double y, double radius) A constructor that receives two parameters; a Point parameter represent the center of the flower and the radius. Flower (Point center, double radius) You need to import java.awt Point before the definition of class Flower A mutator method to set the value of x center coordination A mutator method to set the value of y center coordination A mutator method to set the value of radius An accessor method to get the value of radius A scale method is a mutator method that receives a factor and changes the radius by multiplying the radius by a factor A translate method is a mutator method that receives x, and y distance values and changes the the x center, and y center by adding their values by the distances A draw method that draws the flower object. It receives a Graphics2D parameter Class HW1 Yourld: Includes only the main method Method main Sets a frame to show the application Create an object of FlowerComponent Class FlowerComponent Includes a paintComponent method Page 1 of 3 The paintComponent method creates and draw some flowers (at least 5 flowers should be drawn) It should test the methods translate, scale to draw your picture Figure 1 gives a sample output ta Figune Hint: Figure 2 gives drawing to draw a flower (note: biggest circle is not drawn but it has the radius of the flower) Figure 2 This assignment problem is to practice using existing Java library classes and creating your own graphical class. You are asked to implement a class Flower, that represented by three values x center, y center, and radius. The x center, and y center is the x, y coordination's of the center of a Flower class. The radius is the radius of the circle around the Flower Create a NetBeans project named HW1Yourld. Create a class named Flower stored in a file Flower.java, a component class to create Flower objects, and a tester class named HWI Yourld.java. Class Flower Definition: .Define three double instance variables to hold a Flower object x center, y center, and radius Provide the following as public interface of class Flower A constructor that receives three parameters to initialize the three instance variables. Flower (double x, double y, double radius) A constructor that receives two parameters; a Point parameter represent the center of the flower and the radius. Flower (Point center, double radius) You need to import java.awt Point before the definition of class Flower A mutator method to set the value of x center coordination A mutator method to set the value of y center coordination A mutator method to set the value of radius An accessor method to get the value of radius A scale method is a mutator method that receives a factor and changes the radius by multiplying the radius by a factor A translate method is a mutator method that receives x, and y distance values and changes the the x center, and y center by adding their values by the distances A draw method that draws the flower object. It receives a Graphics2D parameter Class HW1 Yourld: Includes only the main method Method main Sets a frame to show the application Create an object of FlowerComponent Class FlowerComponent Includes a paintComponent method Page 1 of 3 The paintComponent method creates and draw some flowers (at least 5 flowers should be drawn) It should test the methods translate, scale to draw your picture Figure 1 gives a sample output ta Figune Hint: Figure 2 gives drawing to draw a flower (note: biggest circle is not drawn but it has the radius of the flower) Figure 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
