Be sure to call the new test method in the main method in PictureTester. ![]() Create a class (static) method to test this new method in the class Picture Tester. For example, write the method keepOnlyBlue so that will keep only the blue values that is, it will set the red and green values to zero. Using the zeroBlue method as a starting point, choose to write one of the following methods: keepOnlyBlue, keepOnlyRed, or keepOnlyGreen. comment out the ones you don't want to runĮxercises Complete the exercises using the Java files and then make note of the results in the 08.07 Worksheet. uncomment a call here to run a test and Picture canvas = new Picture("640x480.jpg") Picture temple = new Picture("temple.jpg") Picture caterpillar = new Picture("caterpillar.jpg") Picture beach = new Picture("beach.jpg") ** Method to test zeroBlue - Activity 5 */ } // this } is the end of class Picture, put all new methods before ![]() loop from 13 to just before the mirror pointįor (int col = 13 col < mirrorPoint col++) ** Mirror just part of a picture of a temple */ * vertical mirror in the center of the pictureįor (int row = 0 row < pixels.length row++)įor (int col = 0 col < width / 2 col++) ** Method that mirrors the picture around a String output = "Picture, filename " + getFileName() * a string with information about the picture such as * Method to return a string with information about this * Constructor that takes a buffered image * Constructor that takes a picture and creates a let the parent class handle this width and height * height the height of the desired picture * Constructor that takes the width and height let the parent class handle this fileName * fileName the name of the file to create the picture * Constructor that takes a file name and creates the picture ![]() * child constructors always call a parent constructor * not needed but use it to show students the implicit call to Public class Picture extends SimplePicture
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |