Advertisement
puttepw

MVCController

May 19th, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. import java.awt.event.ActionEvent;
  2. import java.awt.event.ActionListener;
  3.  
  4.  
  5. public class GameController implements ActionListener
  6. {
  7.     private GameModel model;
  8.     public GameController(GameModel aModel)
  9.     {
  10.         model = aModel;
  11.     }
  12.  
  13.  
  14.     public void actionPerformed(ActionEvent e)
  15.     {
  16.         if(e.getActionCommand().contains("btn1"))
  17.         {
  18.             model.btn1ChangeFalse();
  19.         }
  20.        
  21.         else if(e.getActionCommand().contains("btn2"))
  22.         {
  23.             model.btn2ChangeFalse();
  24.         }
  25.        
  26.         else if(e.getActionCommand().contains("btn3"))
  27.         {
  28.             model.btn3ChangeFalse();
  29.         }
  30.        
  31.         else if(e.getActionCommand().contains("btn4"))
  32.         {
  33.             model.btn4ChangeFalse();
  34.         }
  35.         else if(e.getActionCommand().contains("btn5"))
  36.         {
  37.             model.btn5ChangeFalse();
  38.         }
  39.         else if(e.getActionCommand().contains("btn6"))
  40.         {
  41.             model.btn6ChangeFalse();
  42.         }
  43.         else if(e.getActionCommand().contains("btn7"))
  44.         {
  45.             model.btn7ChangeFalse();
  46.         }
  47.         else if(e.getActionCommand().contains("btn8"))
  48.         {
  49.             model.btn8ChangeFalse();
  50.         }
  51.         else if(e.getActionCommand().contains("btn9"))
  52.         {
  53.             model.btn9ChangeFalse();
  54.         }
  55.        
  56.     }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement