Control_Class

  1| //NTC Java Programming 152-116
  2| //Instructor: John Heckendorf
  3| //Student: Jan Young & Keith Gallistel
  4| //Lab ID:
  5| 
  6| public class Control_Class extends View_Class
  7| {
  8|     final static long serialVersionUID = 5;
  9| 
10|     final int iBT = 9;
11| 
12|     Money_Class oMoney = new Money_Class();
13| 
14|     //Control Class
15|     public Control_Class()
16|     {
17|         //Use Case 1 - Enter Money
18|         Money_Event_Class oMEC = new Money_Event_Class(this);
19|         jtxtMoney.addActionListener(oMEC);
20| 
21|         //Use Case 2 - Make Selection
22|         Dispense_Class oDC = new Dispense_Class(this);
23|         //For loop for generated buttons
24|         for(int x= 0; x < iBT; x++)
25|         {
26|             oBT[x].addActionListener(oDC);
27|         }
28| 
29|         //Use Case 3 - Take Product
30|         Take_Product_Event_Class oTPC = new Take_Product_Event_Class(this);
31|         jbtnProductBin.addActionListener(oTPC);
32| 
33|         //Use Case 4 - Take Change
34|         Take_Change_Event_Class oTCC = new Take_Change_Event_Class(this);
35|         jbtnChangeBin.addActionListener(oTCC);
36| 
37| 
        //Use Case 5 - Cancel Purchase
38|         Refund_Event_Class oREC = new Refund_Event_Class(this);
39|         jbtnCancel.addActionListener(oREC);
40| 
41|         //End Of Job Class
42|         EOJ_Class oEOJ = new EOJ_Class(this);
43|         this.addWindowListener(oEOJ);
44|     }
45| }