Today we continue working on the pumpkin and the next homework before turning our attention to searching, sorting and algorithm analysis next week.
Populating the project
There is a lot of Java to get ready.
In new browswer tabs, open up the following web pages.
Now start up a new NetBeans project and add the following three classes.
- A main class
Home10Starterdownloaded as the Home10Starter.java file
ProcessingDrawable2Dinterface downloaded as the ProcessingDrawable2D.java
- Your latest
RotatedRectangleimplementation or the RotatedRectangle.java file used to start Homework 9
Now add two more files.
- A redimentary
Home10Sketchclass that extends
PAppletand is similar to the
Halloweenclass of the Pumpkin lab
- A copy of your
Pumpkinclass from the Pumpkin lab
Implementing the interface
Pumpkin class this should be nothing more than
implements ProcessingDrawable2D to the class header.
RotatedRectangle you will need to implement the
draw method. For starters, you may want to draw the
rectangle without rotation.
Later you might consider using the
beginShape() method of the
PApplet with the iterator
Doing something in the sketch
has some very specific requirements.
Get started by creating one
Pumpkin object in the
Use the mutator methods to initialize the fields of these objects.
startup and place these two objects in it.
draw method of the sketch, draw both of these