Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Observable;
- public class GameModel extends Observable
- {
- private boolean btn1 = true;
- private boolean btn2 = true;
- private boolean btn3 = true;
- private boolean btn4 = true;
- private boolean btn5 = true;
- private boolean btn6 = true;
- private boolean btn7 = true;
- private boolean btn8 = true;
- private boolean btn9 = true;
- public void btn1ChangeFalse()
- {
- btn1=false;
- setChanged();
- notifyObservers();
- }
- public void btn2ChangeFalse()
- {
- btn2=false;
- setChanged();
- notifyObservers();
- }
- public void btn3ChangeFalse()
- {
- btn3=false;
- setChanged();
- notifyObservers();
- }
- public void btn4ChangeFalse()
- {
- btn4=false;
- setChanged();
- notifyObservers();
- }
- public void btn5ChangeFalse()
- {
- btn5=false;
- setChanged();
- notifyObservers();
- }
- public void btn6ChangeFalse()
- {
- btn6=false;
- setChanged();
- notifyObservers();
- }
- public void btn7ChangeFalse()
- {
- btn7=false;
- setChanged();
- notifyObservers();
- }
- public void btn8ChangeFalse()
- {
- btn8=false;
- setChanged();
- notifyObservers();
- }
- public void btn9ChangeFalse()
- {
- btn9=false;
- setChanged();
- notifyObservers();
- }
- public void btn1ChangeTrue()
- {
- btn1=true;
- }
- public void btn2ChangeTrue()
- {
- btn2=true;
- }
- public void btn3ChangeTrue()
- {
- btn3=true;
- }
- public void btn4ChangeTrue()
- {
- btn4=true;
- }
- public void btn5ChangeTrue()
- {
- btn5=true;
- }
- public void btn6ChangeTrue()
- {
- btn6=true;
- }
- public void btn7ChangeTrue()
- {
- btn7=true;
- }
- public void btn8ChangeTrue()
- {
- btn8=true;
- }
- public void btn9ChangeTrue()
- {
- btn9=true;
- }
- public boolean btn1State()
- {
- return btn1;
- }
- public boolean btn2State()
- {
- return btn2;
- }
- public boolean btn3State()
- {
- return btn3;
- }
- public boolean btn4State()
- {
- return btn4;
- }
- public boolean btn5State()
- {
- return btn5;
- }
- public boolean btn6State()
- {
- return btn6;
- }
- public boolean btn7State()
- {
- return btn7;
- }
- public boolean btn8State()
- {
- return btn8;
- }
- public boolean btn9State()
- {
- return btn9;
- }
- public static void main(String[]args)
- {
- GameModel model = new GameModel();
- GameController controller = new GameController(model);
- GameView view = new GameView(controller, model);
- GameView view2 = new GameView(controller, model);
- model.addObserver(view2);
- model.addObserver(view);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement