reglage du bug save

This commit is contained in:
AlgaLaptop
2025-12-30 21:25:46 +01:00
parent f6f0eca79f
commit 2e0f44d28d
27 changed files with 239 additions and 79 deletions
@@ -1,9 +1,12 @@
package fr.iutfbleau.sae.vconverter;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Map;
import java.awt.*;
import javax.swing.*;
import fr.iutfbleau.sae.ConverterController;
import fr.iutfbleau.sae.ExportButtonListener;
/**
* Fenêtre principale du convertisseur.
*
@@ -41,7 +44,9 @@ public class ConverterWindow extends JFrame {
this.setSize(900, 600);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null); // Centre la fenêtre
this.setResizable(true); // on autorise le resize
this.setResizable(true); // on autorise le
this.setLayout(new BorderLayout());
// Initialisation des panels
@@ -78,8 +83,8 @@ public class ConverterWindow extends JFrame {
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.getVerticalScrollBar().setUnitIncrement(16); // scroll plus adouci fluide
this.add(scrollPane);
this.setVisible(true); // toi meme tu sais
this.add(scrollPane, BorderLayout.CENTER);
this.setVisible(true);
}
@@ -133,4 +138,24 @@ public class ConverterWindow extends JFrame {
Map<Integer, String> codesBleu) {
codeTablePanel.updateCanonicalCodes(codesRouge, codesVert, codesBleu);
}
public void addSaveButton(ConverterController controller) {
JButton saveBtn = new JButton("Exporter en .pif");
ExportButtonListener ecouteur =new ExportButtonListener(controller);
saveBtn.addActionListener(ecouteur);
// panneau du bas
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
bottomPanel.add(saveBtn);
// ajoute au bas de la fenêtre
this.add(bottomPanel, BorderLayout.SOUTH);
// rafraîchir l'affichage
this.revalidate();
this.repaint();
}
}