Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in Java please IN java please [CODE] Let's face it, your Facebook banner probably needs a little bit of a facelift. You're in luck because

in Java please image text in transcribedimage text in transcribed

IN java please

[CODE] Let's face it, your Facebook banner probably needs a little bit of a facelift. You're in luck because today you will write a Java application which generates for you both a psychedelic and personalized (custom) Facebook banner! You're project will use principles from abstract classes/methods and interfaces. You will also get a taste of 2D graphics (drawing images with ovals, rectangles, text and images). Your lab will involve 4 separate Java classes: ) Client.java You will only make small changes to this file to reflect your name(s) in the header and print statements. Examine the main() method, as well as the two other methods called from main(). This client class will generate two banners using the PersonalizedFbBanner class which you will create. The Create PsychedelicBanner() method creates a very colorful banner with your image in the center as seen in Figure 1. The CreateCustomBanner() creates a banner via a method which you will specifically write to your liking, as seen in Figure 2. Your program expects you to have an image file called myPic.jpg inside of your project folder in Windows/Macos. If you created your project as we normally do, you can place this file in your Java Project folder by dragging it from your desktop/window into the Project folder in Eclipse (where you normally drag the templates to) and clicking "Copy To (NOTE: Do NOT drag it into the "src" folder like you do the templates, but rather, one directory up). b) FbBanner.java YOU WILL NOT CHANGE THIS FILE AT ALL (do not even change the name). This class is the abstract Facebook banner super class. Please take a good look through it as it contains a lot of useful methods and instance variables that you can take advantage of. For instance: . getWidth() will return an integer with the width of a Facebook banner getHeight() will return an integer with the height of a Facebook banner writelmageToFile(String fileName) will create an image of your banner as fileName.jpg on your computer rotate Drawing Angle(double degrees) will rotate the angle at which things are drawn by your Graphics2D draw commands (explained later) . setRotationAngleToDefault() will reset the drawing angle to normal so your draw commands draw straight figures and text drawCentered Picture(String fileName WithExtension, int percentSize) draws the picture found at fileNameWithExtension (e.g., myPic.jpg) at the size dictated by percentSize in the middle of your banner g2d is a member variable of type Graphics2D (a Java library class). This member variable is essentially the graphics engine for your banner It also contains a method called drawCustomizedDecoration(), which you will override in another class. c) Random DrawMethods.java YOU WILL NOT CHANGE THIS FILE AT ALL (do not even change the name). Note that this is an interface, and thus, does not contain any real code. Rather, it contains three method headers, as well as a static member variable full of common colors (Color is another Java library class). These methods will need to be overridden in another class; however, this class contains in-depth details about how these classes should be used and explains how to use the Graphics2D g2d instance variable to draw shapes and text. d) PersonalizedFbBanner.java This is where your new code will go. This class must extend FbBanner and implement Random DrawMethods (yes, a single class can extend AND implement in a single header). Your class must provide implementations for each of the methods in RandomDraw Methods; again, see RandomDraw Methods.java for detailed method descriptions and hints of how to do this. Your class must also override the abstract method drawCustomizedDecoration(), found in FbBanner. This should be the last thing you do, after you've implemented Random DrawMethods and have gained a little experience with the Graphics2D engine. Your goal with this method is to create a custom banner that you enjoy. This doesn't need to be too incredibly complex. In my custom banner, seen in Figure 2, I simply use a nested FOR loop and draw ovals with Dr. Dan's alma mater's (the Cincinnati Bearcats) colors being alternated back and forth. [CODE] Let's face it, your Facebook banner probably needs a little bit of a facelift. You're in luck because today you will write a Java application which generates for you both a psychedelic and personalized (custom) Facebook banner! You're project will use principles from abstract classes/methods and interfaces. You will also get a taste of 2D graphics (drawing images with ovals, rectangles, text and images). Your lab will involve 4 separate Java classes: ) Client.java You will only make small changes to this file to reflect your name(s) in the header and print statements. Examine the main() method, as well as the two other methods called from main(). This client class will generate two banners using the PersonalizedFbBanner class which you will create. The Create PsychedelicBanner() method creates a very colorful banner with your image in the center as seen in Figure 1. The CreateCustomBanner() creates a banner via a method which you will specifically write to your liking, as seen in Figure 2. Your program expects you to have an image file called myPic.jpg inside of your project folder in Windows/Macos. If you created your project as we normally do, you can place this file in your Java Project folder by dragging it from your desktop/window into the Project folder in Eclipse (where you normally drag the templates to) and clicking "Copy To (NOTE: Do NOT drag it into the "src" folder like you do the templates, but rather, one directory up). b) FbBanner.java YOU WILL NOT CHANGE THIS FILE AT ALL (do not even change the name). This class is the abstract Facebook banner super class. Please take a good look through it as it contains a lot of useful methods and instance variables that you can take advantage of. For instance: . getWidth() will return an integer with the width of a Facebook banner getHeight() will return an integer with the height of a Facebook banner writelmageToFile(String fileName) will create an image of your banner as fileName.jpg on your computer rotate Drawing Angle(double degrees) will rotate the angle at which things are drawn by your Graphics2D draw commands (explained later) . setRotationAngleToDefault() will reset the drawing angle to normal so your draw commands draw straight figures and text drawCentered Picture(String fileName WithExtension, int percentSize) draws the picture found at fileNameWithExtension (e.g., myPic.jpg) at the size dictated by percentSize in the middle of your banner g2d is a member variable of type Graphics2D (a Java library class). This member variable is essentially the graphics engine for your banner It also contains a method called drawCustomizedDecoration(), which you will override in another class. c) Random DrawMethods.java YOU WILL NOT CHANGE THIS FILE AT ALL (do not even change the name). Note that this is an interface, and thus, does not contain any real code. Rather, it contains three method headers, as well as a static member variable full of common colors (Color is another Java library class). These methods will need to be overridden in another class; however, this class contains in-depth details about how these classes should be used and explains how to use the Graphics2D g2d instance variable to draw shapes and text. d) PersonalizedFbBanner.java This is where your new code will go. This class must extend FbBanner and implement Random DrawMethods (yes, a single class can extend AND implement in a single header). Your class must provide implementations for each of the methods in RandomDraw Methods; again, see RandomDraw Methods.java for detailed method descriptions and hints of how to do this. Your class must also override the abstract method drawCustomizedDecoration(), found in FbBanner. This should be the last thing you do, after you've implemented Random DrawMethods and have gained a little experience with the Graphics2D engine. Your goal with this method is to create a custom banner that you enjoy. This doesn't need to be too incredibly complex. In my custom banner, seen in Figure 2, I simply use a nested FOR loop and draw ovals with Dr. Dan's alma mater's (the Cincinnati Bearcats) colors being alternated back and forth

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

=+Will the guilt enhance the message?

Answered: 1 week ago

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

Which personal relationships influenced you the most?

Answered: 1 week ago