Ceate a class mickymouse according to the uml -


Programming Assignment

MickeyMouse
- x : int
- y : int
- size : int
-color: Color
+ MickeyMouse():
+ setLocation (x: int, y: int): void
+ setSize (size: int): void
+ setColor(color: Color):void
+ draw(canvas: Graphics2D) : void

Write a graphical Mickey Mouse program. It will consist of three parts. A MickeyMouse class that encapsulates the drawing of the head and ears of Mickey. Second, a MikeyMouseClubhouse that extends JComponent that is responsible for drawing several Mickey's. Finally, a MikeyMouseClubhouseViewer that will create a window frame to show your creation.

166_Figure.jpg

MickeyMouse

- x : int

- y : int

- size : int

-color: Color

+ MickeyMouse():

+ setLocation (x: int, y: int): void

+ setSize (size: int): void

+ setColor(color: Color):void

+ draw(canvas: Graphics2D) : void

Create a class MickyMouse according to the UML.
- Create a constructorthat sets the x, y, and size instance variables to zero. Set the color to Color.BLACK.
- setLocation should assign the (x,y) coordinate location by assigning the input parameters to their respective instance variables.
- setSize should set a new size by assigning the input parameter to their respective instance variables.
- setColor should update the color instance variable color.
- draw should display the head and ears of MickeyMouse on the provided Graphics2D input parameter accordingly:
o The LEFT ear should be at (x,y) with a diameter of size * 2
o The RIGHT ear should be at (x + size*4, y) with a diameter of size * 2
o The HEAD should be at (x + size, y + size) with a diameter of size * 4

Author a MickeyMouseClubhouse class that extends JComponent, within paintComponent method to draw:
- Construct a MickeyMouse object at (10,10) with size 10 and color green, draw a MickeyMouse
- Move your MickeyMouse object to (400, 10) (use setLocation), then draw another MickeyMouse of color blue.
- Move your MickeyMouse object to (100,150), set size to 50, color black, and then draw again.

Finally, create a MikeyMouseClubhouseViewer that
- Implements the main method and create a JFrame object.
- Instantiate a MickeyMouseClubhouse and attach it to the frame.
- Display the title of the JFrame, i.e. "Welcome to the Mickey Mouse Clubhouse"
- Remember to consistently indent your code and descriptively name your variables.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Ceate a class mickymouse according to the uml -
Reference No:- TGS01604699

Expected delivery within 24 Hours