Question: In java Define a class named Frame which has the following behaviors: It can return the pixel that represents the Frame. Use the method signature:

In java Define a class named Frame which has the following behaviors:

  • It can return the pixel that represents the Frame. Use the method signature:
  • public Pixel getBottomLeft( )
  • It can change the pixel that represents the Frame. Use the method signature:
  • public void setBottomLeft( Pixel pi)
  • It can return the center (pixel) of the Frame. Use the method signature:
  • public Pixel getCenter( )
  • It can return the corners (pixel) of the Frame. Use the method signatures:
  • public Pixel getTopLeft( )
  • public Pixel getTopRight( )
  • public Pixel getBottomRight( )
  • Give the row and colomn number of the cell, it returns the pixel of that specific cell. Assume the first cell is row 1, colomn 1 and the top right cell is row 10, col 10. If the row and col values are outside the boundary of the Frame , the method returns null. Use the method signature:
  • public Cell getCell( int row, int colomn )
  • The class also has a constructor that accepts a Pixel as an argument. Use the following method signature: public Frame(Pixel pixel)
  • A default construction initializes the class with a Pixel value of 0, 0:

    public Frame()

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!