Understanding this will be like understanding the Tester classes. It's going to take a while, but once you do follow what's going on, it shouldn't be so bad.
You have provided the following classes.
To that end, this overview explains what's happening in the classes. Realize that for some courses (especially systems courses in the 410s) may have you look at code and try to figure out what it does with very little documentation. So, the skill is useful.
To get membership, you pass in the payment, how many years the person has been a member, a coupon type, whether the person has a referral or not, and a reference to an error number.
The method will determine what membership, if any, that a member can get. This is where the other class, Status, is used.
In Java, one way to define a constant is to create static objects, and force the default and copy constructor to be private, and to make the assignment operator also private. In effect, this makes the static objects "singletons". A "singleton" is a class where you have a limited number of objects and you can't create any more objects beyond the initial set created.
Interestingly, static objects can be created using private constructors. However, regular objects can only be created with public constructors. This prevents new objects of type Status from being created.
There are three dynamically allocated objects: GOLD, SILVER, and BRONZE. The user applies for membership (using apply()), and gets one of these three objects back (or NULL, if the user fails to get membeship).
If the user fails to get membership, the error number is set. See ApplyManager.cpp to see what the error numbers mean.
Again, look at the header file to see what Widget looks like. It's rahter simple.
In this project, there are only two kinds of GUI objects: Buttons and TextFieldss. They are derived from Widget.
TextField do not generate any events. You can read more about events when reading about Buttons.
By looking at the header file, the most important methods you will need to use are numLines() and getLineAt(). This will tell you how many lines a text field has, and allow you to retrieve individual lines. Most of the times, there will only be one line of text.
Each Button has zero or more listener objects that have been associated with the button. When it is pressed, an event occurs. The event causes the action() method to run on each listener object associated with that Button object. This is taken care of by main.cpp and the EventManager object. You don't have to do this, since it's done for you.
Basically, what you need to do is to write derived classes from ActionListener for each of the buttons. This will be discussed momentarily.
You will need to add the widgets to the GUI. So, if you have four buttons and three text fields, each of these must be added using the addWidget() method. This should be done in the constructor of the GUI object.
The reason for adding the widget? It's the mechanism used to let the EventManager object to know these widgets exist.
If you look at main(), one of the earliest things that happens is that a Gui object is declared (only one!).
This causes each widget to be added to the Gui object (again, look at the constructor code).
When an event occurs (i.e., a button is "pressed"), the action() event of each ActionListener object is run.
However, since ActionListener is abstract, you need to derive classes from ActionListener. There's two ways to do this. Either you derive a single ActionListener class, and have action() determine the label of the button in a large if-else statement, or you can write one derived ActionListener class for each button, and define action() for each. It's up to you to decide how you want to implement this.
TestActionListener is one example of a derived class from ActionListener.
You don't have to do anything with this class.
The next step is to modify Gui so that there are as many button and text field objects (you can remove the ones that are already there, or rename them) as specified in the project description (to appear shortly).
The main purpose of Gui is to call addWidget() on each widget and then to set up the ActionListener objects for each of the Button and add it to the appropriate Button object.
In addition, you will probably want to create a class called DataManager. This will be a data member of Gui and have all the information needed by the Gui.
You should then begin to write code for each button. The ActionListener object needs to be able to access the TextField objects in Gui (which is why they were made public---to make that easier to do).
So, when a Button object is pressed, an event occurs. The appropriate listener code is run, that handles the event. Typically, this involves reading the appropriate TextField objects of Gui, and uses this information to carry out whatever the button is supposed to do.