import javax.swing.*;
import java.awt.*;

public class Outils extends JPanel {
    private Feuille feuille;
    public Outils(Feuille f) {
        this.feuille = f;
        //setLayout(new FlowLayout());
        //setLayout(new GridLayout(1, 3));

        this.add(new JLabel("Couleur"));
        Color[] listeCouleurs = { Color.BLACK, Color.BLUE, Color.GREEN, Color.GRAY, Color.PINK, Color.RED };
        JComboBox<Color> couleurs = new JComboBox<>(listeCouleurs);
        couleurs.addActionListener(e -> {
                feuille.couleur = (Color)couleurs.getSelectedItem();
            });
        this.add(couleurs);

        this.add(new JLabel("Rayon"));
        JTextField rayon = new JTextField("10");
        rayon.addActionListener(e -> {
                feuille.rayon = Integer.parseInt(rayon.getText());
            });
        this.add(rayon);

        JButton efface = new JButton("Effacer");
        efface.addActionListener(e -> {feuille.effacer(); feuille.repaint();});
        this.add(efface);
    }
}
