public void ajouterAllActionListener(ActionListener actionListener) { for (int i = 0; i < model.getTableauBijou().length; i++) { for (int j = 0; j < model.getTableauBijou()[i].length; j++) { tableauBijouButton[i][j].addActionListener(actionListener); } } }
public void initAttribut(Model model) { this.model = model; tableauBijouButton = new Bijou[model.getTableauBijou().length][model.getTableauBijou()[0].length]; for (int i = 0; i < model.getTableauBijou().length; i++) { for (int j = 0; j < model.getTableauBijou()[i].length; j++) { tableauBijouButton[i][j] = new Bijou(model.getTableauBijou()[i][j], new Coord(i, j)); tableauBijouButton[i][j].setIcon( model.getTextures()[model.getTableauBijou()[i][j].getIndex()]); tableauBijouButton[i][j].setBackground(Color.white); } } menuOption = new JMenu("Options"); menuScore = new JMenuItem("Meilleurs Scores"); menuNouvellePartie = new JMenuItem("Nouvelle Partie"); hint = new JButton("hint"); pause = new JButton("pause"); progressBar = new TheProgressBar(this); contentPane = new JPanel(); }
public void actualiserTableau() { for (int i = 0; i < tableauBijouButton.length; i++) { for (int j = 0; j < tableauBijouButton[i].length; j++) { tableauBijouButton[i][j].setType(model.getTableauBijou()[i][j]); tableauBijouButton[i][j].setIcon( model.getTextures()[tableauBijouButton[i][j].getTypeBijou().getIndex()]); if (tableauBijouButton[i][j].getBackground() == Color.BLACK) { tableauBijouButton[i][j].setBackground(Color.WHITE); } } // coloreCoupPossible(); } }
public void actualiserCase(Coord coord) { tableauBijouButton[coord.getX()][coord.getY()].setIcon( model.getTextures()[model.getTableauBijou()[coord.getX()][coord.getY()].getIndex()]); }