Graphical representation of the field

On the previous pages you developed classes to represent crops and animals graphically. We also need a graphically representation of the field. The object diagram shows what is required:

Field object diagram

As you can see from the diagram, the same composition approach used for the crops and animals is required for the field.

The video below demonstrates this.

Task 4

Use the above video to create the class required to represent the field graphically.

Main Window

Now that we have classes that we can use to represent the crops, animals and the field it is time to think about the main window. The diagram below shows its structure:

Field main window

When constructing the main window it is important that you stick to the attribute names given in the above class diagram as these names will be used in the following sections. If you prefer, you can follow a video which demonstrates how to create the main window.

Focus on the graphics view and the push buttons, we will look at the toolbar in the next section.

Task 5

Use the above video to create the field simulation main window.