Revised: Wed Jun 29 13:31:10 CDT 2016
This page is included in the following Books:
Table of contents
- Table of contents
- Preface
- Preview
- General background information
- Discussion and sample code
- Run the programs
- Complete program listings
- Miscellaneous
Preface
This lesson is one of a series of lessons designed to teach you about Object-Oriented Programming (OOP) using Java.
Before embarking on the material in this lesson, you should have studied and should understand all of the material in the lessons identified as Java1600 through Java1630 in the section of this book titled Essence of OOP . You should have studied and should understand the material in the lesson titled Java3002: Creating and Manipulating Turtles and Pictures in a World Object . You should also have studied and should understand all of the material in the following books:
The program described in this lesson requires the use of the Guzdial-Ericson multimedia class library. You will find download, installation, and usageinstructions for the library at Java OOP: The Guzdial-Ericson Multimedia Class Library .
Viewing tip
I recommend that you open another copy of this lesson in a separate browser window and use the following links to easily find and view the Figuresand Listings while you are reading about them.
Figures
- Figure 1 . Two turtles in a World object.
- Figure 2 . Graph of a cubic function.
- Figure 3 . Program output for Line01.
- Figure 4 . Line01 output with different scaling.
- Figure 5 . Program output for Line01 for a 400x150 world.
- Figure 6 . Graphic output from the program named Parabola01.
- Figure 7 . Parabola with zero offsets.
- Figure 8 . A parabola with offsets.
- Figure 9 . Graphic output from the program named Cubic01.
- Figure 10 . Graphic output from the program named Circle01.
- Figure 11 . Graphic output from the program named Circle02.
- Figure 12 . Graphic output from the program named Cosine01.
Listings
- Listing 1 . Beginning of the class named Line01Runner.
- Listing 2 . The method named function for Line01.
- Listing 3 . Draw the BLUE line.
- Listing 4 . The method named drawLine.
- Listing 5 . Repeat the process to draw two more lines.
- Listing 6 . The method named function for Parabola01.
- Listing 7 . Drawing parameters for Parabola01.
- Listing 8 . Draw the parabolic function in BLUE.
- Listing 9 . The variable named rVal.
- Listing 10 . The method named function for Circle01.
- Listing 11 . Draw half the circle in BLUE.
- Listing 12 . Picture and Pixel references.
- Listing 13 . Translate the origin and set the pixel color.
- Listing 14 . The method named function for Cosine01.
- Listing 15 . The program named Line01.
- Listing 16 . The program named Parabola01.
- Listing 17 . The program named Cubic01.
- Listing 18 . The program named Circle01.
- Listing 19 . The program named Circle02.
- Listing 20 . The program named Cosine01.