diff --git a/src/Accueil.class b/src/Accueil.class new file mode 100644 index 0000000..dd23616 Binary files /dev/null and b/src/Accueil.class differ diff --git a/src/Boutons.class b/src/Boutons.class new file mode 100644 index 0000000..56c2c4b Binary files /dev/null and b/src/Boutons.class differ diff --git a/src/Boutons.java b/src/Boutons.java index 69aeb4c..b831f2b 100644 --- a/src/Boutons.java +++ b/src/Boutons.java @@ -87,4 +87,4 @@ public class Boutons extends JPanel { public JButton getImporterGrille() { return importerGrille; } -} \ No newline at end of file +} diff --git a/src/Fenetre.class b/src/Fenetre.class new file mode 100644 index 0000000..a2c928b Binary files /dev/null and b/src/Fenetre.class differ diff --git a/src/GridPanel$1.class b/src/GridPanel$1.class new file mode 100644 index 0000000..3410bec Binary files /dev/null and b/src/GridPanel$1.class differ diff --git a/src/GridPanel$2.class b/src/GridPanel$2.class new file mode 100644 index 0000000..e056613 Binary files /dev/null and b/src/GridPanel$2.class differ diff --git a/src/GridPanel$3.class b/src/GridPanel$3.class new file mode 100644 index 0000000..14356fb Binary files /dev/null and b/src/GridPanel$3.class differ diff --git a/src/GridPanel$4.class b/src/GridPanel$4.class new file mode 100644 index 0000000..dbddc37 Binary files /dev/null and b/src/GridPanel$4.class differ diff --git a/src/GridPanel$5.class b/src/GridPanel$5.class new file mode 100644 index 0000000..4089a33 Binary files /dev/null and b/src/GridPanel$5.class differ diff --git a/src/GridPanel$6.class b/src/GridPanel$6.class new file mode 100644 index 0000000..4f09c1f Binary files /dev/null and b/src/GridPanel$6.class differ diff --git a/src/GridPanel.class b/src/GridPanel.class new file mode 100644 index 0000000..a46f2f9 Binary files /dev/null and b/src/GridPanel.class differ diff --git a/src/GridPanel.java b/src/GridPanel.java index 2ef76da..ff9ad4a 100644 --- a/src/GridPanel.java +++ b/src/GridPanel.java @@ -4,8 +4,6 @@ import java.util.Random; import java.awt.event.*; public class GridPanel extends JPanel { - private static final long serialVersionUID = 1L; - private int gridSize = 10; private int cellSize = 50; private Color[][] gridColors; @@ -21,7 +19,7 @@ public class GridPanel extends JPanel { public GridPanel() { setPreferredSize(new Dimension(gridSize * cellSize, gridSize * cellSize)); setBackground(Color.WHITE); - + gridColors = new Color[gridSize][gridSize]; Random rand = new Random(); for (int i = 0; i < gridSize; i++) { @@ -29,7 +27,8 @@ public class GridPanel extends JPanel { gridColors[i][j] = rand.nextBoolean() ? Color.BLACK : Color.WHITE; } } - + + addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { int row = e.getY() / cellSize; @@ -46,13 +45,13 @@ public class GridPanel extends JPanel { } } }); - + editButton = new JButton("Enlever/Ajouter Murs"); editButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { editMode = !editMode; if (editMode) { - editButton.setText("Mode Dessin"); + editButton.setText("Mode Auditeur"); placeJoueurButton.setEnabled(false); placeTButton.setEnabled(false); } else { @@ -63,41 +62,42 @@ public class GridPanel extends JPanel { } }); add(editButton); - - placeJoueurButton = new JButton("Placer Joueur"); + + placeJoueurButton = new JButton("Placer Thésée"); placeJoueurButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { placeJoueurMode = !placeJoueurMode; if (placeJoueurMode) { - placeJoueurButton.setText("Mode Dessin"); + placeJoueurButton.setText("Mode Auditeur"); editButton.setEnabled(false); placeTButton.setEnabled(false); } else { - placeJoueurButton.setText("Placer Joueur"); + placeJoueurButton.setText("Placer Thésée"); editButton.setEnabled(true); placeTButton.setEnabled(true); } } }); add(placeJoueurButton); - - placeTButton = new JButton("Placer Lettre T"); + + placeTButton = new JButton("Placer Sortie"); placeTButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { placeTMode = !placeTMode; if (placeTMode) { - placeTButton.setText("Mode Dessin"); + placeTButton.setText("Mode Auditeur"); editButton.setEnabled(false); placeJoueurButton.setEnabled(false); } else { - placeTButton.setText("Placer Lettre T"); + placeTButton.setText("Placer Sortie"); editButton.setEnabled(true); placeJoueurButton.setEnabled(true); } } }); - add(placeTButton); + add(placeTButton); } + public void paintComponent(Graphics g) { super.paintComponent(g); @@ -144,13 +144,5 @@ public static void main(String[] args) { frame.getContentPane().add(gridPanel.getComponents()[0], BorderLayout.NORTH); frame.pack(); frame.setVisible(true); - - Timer timer = new Timer(100, new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - gridPanel.repaint(); - } - }); - timer.start(); } }