Problem Set #8
Part 1
Hand in: p1.class
Change at least one thing about the problem 4/ps7 of the colleague that occurs after your name (as has been done before). Inside the java file, be sure to add your commentary preceded by a few '*' (asterisks) to make it clear what you are adding/removing.
Part 2
Hand in: p2.class
This problem is about preparing a place to draw. Given that mx varies between 0 and 1, the goal is to define a clean, white page to draw upon whose size varies with mx. First black out your drawing square completely. Then draw a white area that defines your drawing space. 0 and 1 don't necessarily have to imply big or small, just a continuum of values.
Part 3
Hand in: p3.class
Now you will consider drawing on your page of problem 2. Draw a 50% gray rectangle of size 4 by 4 pixels at the best position calculably possible on your variable drawing page. Remember that mx still varies the size of the page, and that your 50% gray rectangle may have to change position based upon how mx varies.
Part 4
Hand in: p4.class
Again drawing on your page of problem 2, this time draw five 50% gray horizontal lines of 20 pixels wide. These gray lines symbolize drawing text on the page. Choose a calculable place to put these 5 lines of faux text.
Part 5
Hand in: p5.class
Now for the real thing. Your text to set is I'm here. Yes, that is 9 characters including space, apostrophe, and period. Ignoring the page of problem 2, address the lovely square in front of you of 101 by 101. Given that mx varies from 0 to 1, where '1' signifies complete centeredness of text, and 0 signifies complete uncenteredness of text, center the text I'm here. according to the parameter mx. Background color should be white, foreground text color should be black. Text face should be Helvetica/Arial (asking for Helvetica seems to make JAVA ask for Arial correctly). Don't slip any randomness into this; make it all deterministic.