Question: import java.awt.*; import java.awt.font.*; import java.awt.geom.*; import java.text.*; /** * A class that represents a picture. This class inherits from * SimplePicture and allows the

import java.awt.*; import java.awt.font.*; import java.awt.geom.*; import java.text.*;

/** * A class that represents a picture. This class inherits from * SimplePicture and allows the student to add functionality to * the Picture class. * * Copyright Georgia Institute of Technology 2004-2005 * @author Barbara Ericson ericson@cc.gatech.edu */ public class Picture extends SimplePicture { ///////////////////// constructors ////////////////////////////////// /** * Constructor that takes no arguments */ public Picture () { /* not needed but use it to show students the implicit call to super() * child constructors always call a parent constructor */ super(); } /** * Constructor that takes a file name and creates the picture * @param fileName the name of the file to create the picture from */ public Picture(String fileName) { // let the parent class handle this fileName super(fileName); } /** * Constructor that takes the width and height * @param width the width of the desired picture * @param height the height of the desired picture */ public Picture(int width, int height) { // let the parent class handle this width and height super(width,height); } /** * Constructor that takes a picture and creates a * copy of that picture */ public Picture(Picture copyPicture) { // let the parent class do the copy super(copyPicture); } ////////////////////// methods /////////////////////////////////////// /** * Method to return a string with information about this picture. * @return a string with information about the picture such as fileName, * height and width. */ public String toString() { String output = "Picture, filename " + getFileName() + " height " + getHeight() + " width " + getWidth(); return output; } } // end of class Picture, put all new methods before this

Add a static main method to the Picture class, and inject code into it that demonstrates the operation of the all of the methods that you subsequently add to the Picture class, as specified below.

Add the increaseRed method shown in the book.

Overload the increaseRed method with an increaseRed method that accepts a number that specifies an increase factor.

Add an increaseGreen method.

Overload the increaseGreen method with an increaseGreen method that accepts a number that specifies an increase factor. Add an increaseBlue method.

Overload the increaseBlue method with an increaseBlue method that accepts a number that specifies an increase factor.

Add a blurr method that blurrs within a specified rectangle. You should have x, y, width, and height arguments, where the x and y arguments represent the upper-left point of origin.

Add another method of your own devising, that does something interesting.

Be sure to remove any unnecessarily duplicated code that you may have added.

Submit the Picture.java file, along with the jpeg picture that you used. Submit these two files together as a single zipped attachment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!