Interface
Interface
  1. (10 pts) Work with last week's partner(or alone if partner not here or you were alone last week)

    Fish_AB.java:

    1. complete/correct your fish (do not change the name! should stay the same initials!).
      Fish Checklist
        Is it all inside the "red design frame"?
        Does it touch all sides of the "red design frame"?
        Did you remove the "red design frame" code?
        Does your draw method get called everywhere it should?
        Does your draw method PRESERVE the pen color of the method that called it?
      
    2. add an OVERLOADED constructor. This one should take 3 variables (x,y,s). 's' should be used for both width and height. There is an SHORT WAY and LONG WAY to do this. Guess which gets you full credit....

    3. implement the following interface which you should download now and DO NOT MODIFY. Ifc1.java

    FishClient.java:

    1. Declare two variables of type Ifc1 and assign to each a differently sized fish. Make sure one is noticably larger than the other.
    2. call setColor on the larger of the two fish (Did it work?!?)
    3. now animate both fish in the same animation loop. Use a for-loop similar to that in the provided code. Make sure when the animation completes both fish are still fully visible. There should be no constructions and no color changes inside the animation loop. Only mutations.

    BOTH Fish & FishClient should follow coding standards with following exceptions/modifications.

    • Both files header should contain i)names of all authors ii) the date
    • "big picture" description for Fish_AB.java should only be a list of the public method & public constructor headers in the code.
      Style should be similar to that found in the online doc's for any class.
    • Comments in the rest of your Fish_AB code can be very minimal except for clarifying notes in the draw method about how any tricky parts are being drawn/built.
    • Client only needs the header comments noted above.

    EMAIL ME YOUR FISH & CLIENT.
    I only want ONE EMAIL PER TEAM.
    If you have a partner, cc them.
    DO THIS NOW. Do not wait until end of lab.
    For credit, I must get both before 5pm today.


    Homework Assignment

    You are welcome/expected to work on this assignment in lab today until 5pm, so make good use of your lab time today!

    The programming exercises below will be submitted as homework next week, due before 5pm on Tues, Nov 23. Those of you leaving Sewanee early... are still subject to the same due date & time.

    Now that your Fish is complete, it is time for you and your partner, if any, to split up and start working individually on the homework. Move to a computer away from them so you are not tempted to confer. Since both of you fully understand the code you submitted together, that is no longer necessary. Your homework should be all your own work.

    In all of the below, "random" means using Math.random() to get values in whatever range is necessary.

    Use the filenames specified in each of the below except where ??? and "your initials / AB" should be replaced with specific values for your Java class & human name.

    1. (10 pts) Animation2Client.java
      1. Make an array of 10 fish where each is constructed at random x & y coordinates on the window.
        w & h are up to you.
        All 10 should be entirely visible.
      2. Animate all 10 inside a for-loop similar to the one in the animation example code from this morning. There should be no constructions and no color changes inside the animation loop. Only mutations.
        Make sure that when the fish stop moving, most of them are still visible.
      3. After the animation loop, construct a random color.
        Use this ONE random color to setColor on ALL 10 fish.
        They should all be the same color now.

    2. (10 pts) ???_AB.java (AB replaced with your initials; ??? replaced with name of your thing)

      Make a new shape (ie, not a fish!) of something you can draw that could logically be expected to move. Keep it simple but recognizable. Should satisfy the following

      1. A minimum of 5 parts that are readily apparent.
      2. A minimum of 3 different types of parts (ie, ellipse, rectangle, line, text, arc, ...)
      3. No partial things. Must be a "complete" thing. (ie, not a just a face of something)
      4. A constructor that takes x,y,w,h and draws your shape in the same "red design area" specified using x,y as upper left corner, w the entire width, h the entire height that we used to develop the fish.
      5. A constructor that takes x,y,s and uses s for both w & h
      6. implements Ifc1, Ifc2

        Ifc1.java

        Ifc2.java

      (Need ideas?)

    3. (10 pts) BorderClient.java
      1. Make a border for the window of alternating shapes (fish & ???), all the same size putting all of them in the SAME array. That's ONE ARRAY TOTAL. Shapes should all be visible and should not overlap one another. Assign a different random color to each of them. Each side of border should have at least 8 fish in it.
      2. Ask user (scanner time!) if they would like to animate them. If so, all shapes should move at the same speed in the same direction. No color changes!!! Stop the animation when there's only a single vertical line of shapes still visible. There should be no constructions and no color changes inside the animation loop. Only mutations.
      3. After the animation ends, change all the shapes to the same color.
        You can choose what color but they must all have the same color.

    4. (10 pts) RaggedClient.java
      1. Make a 2D ragged array of alternating rows of shapes. One shape per row. Row lengths start with 2 and go up to 8. (example)
      2. All shapes should be visible and none overlap.
      3. Every shape in a row has the same color but every row has a different color
      4. Animate the entire array (you can go any direction but once chosen should keep going that way. You MUST USE YOUR ACCESSING METHOD(S) and A WHILE LOOP for this animation. There should be no constructions and no color changes inside the animation loop. Only mutations.
      5. Stop when shape at [3][3] is still fully visible but one more translate would start it off the window. You MUST RECOGNIZE WHEN TO STOP BY HAVING USED YOUR ACCESSING METHOD(S).
        While your array will be of Ifc1 types, you will need to *also* assign the shape in array at [3][3] to an identifier of type Ifc2 so that you can use the accessor methods you need. Do not construct this shape more than once.
      6. After stop, setColor to all shapes in the array to Color.MAGENTA

    5. Follow coding standards in all files.

    Due Date: 23 Nov by 5pm

    HW Submssion should include:

    • Animation2Client.java
    • ???_AB.java
    • BorderClient.java
    • RaggedClient.java

    I definitely already have Ifc1 & Ifc2.
    And I _should_ already have your Fish already!

    • If by some misfortune you did not send me your Fish & Client before 5pm on Thur lab, include BOTH of these files as well.