Compare commits

...

7 Commits

Author SHA1 Message Date
Simoes Lukas
2c3e150ec5 wow le tp là 2025-09-04 15:36:55 +02:00
Simoes Lukas
c16ef0985f JUnit 2025-05-26 12:07:58 +02:00
Simoes Lukas
2f94e24111 TP3 2025-03-31 17:29:54 +02:00
Simoes Lukas
fe693705bf TP 2025-03-27 13:35:54 +01:00
Simoes Lukas
376861b608 Controle machine 2025-03-19 10:18:41 +01:00
Simoes Lukas
42cc204dea Merge branch 'main' of grond.iut-fbleau.fr:simoes/DEV 2025-03-17 10:12:18 +01:00
Simoes Lukas
6f2ea4a30a Fin de tout 2025-03-17 10:11:05 +01:00
315 changed files with 5477 additions and 203 deletions

0
DEV1.1/TP19/sort.PY Normal file
View File

5
DEV1.1/TP19/sort.py Normal file
View File

@@ -0,0 +1,5 @@
t = [5,8,8,7,5,8,3,5,7,8,4,4,4,5,3,1,2,3,7]
t.sort()
print(t)

Binary file not shown.

View File

@@ -0,0 +1,13 @@
import java.awt.*;
public class Filtre {
public static String minusculesDansChaine(String chaine) {
String chaineFinale = "";
for (int i = 0; i != chaine.length(); i++) {
if(Character.isLowerCase(chaine.charAt(i))) {
chaineFinale += chaine.charAt(i);
}
}
return chaineFinale;
}
}

Binary file not shown.

View File

@@ -0,0 +1,14 @@
public class Main {
public static void main(String[] args) {
// Tests de la méthode
/* String texte = "CeCi eSt uN TesT";
String texte2 = "mMiAnJuUsScCuUlLeEsS ";
System.out.println(Filtre.minusculesDansChaine(texte));
System.out.println(Filtre.minusculesDansChaine(texte2)); */
for (String chaine : args) {
System.out.println(Filtre.minusculesDansChaine(chaine));
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,16 @@
import java.awt.*;
import java.util.Random;
public class Exquis {
private String[] chaines;
public Exquis(String[] chaines) {
this.chaines = chaines;
}
public String toString() {
Random aleatoire = new Random();
return this.chaines[Math.abs(aleatoire.nextInt()) % this.chaines.length];
}
}

Binary file not shown.

View File

@@ -0,0 +1,35 @@
public class Main {
public static void main(String[] args) {
String[] sujets = {
"Siobhane",
"Lukas",
"Maxime",
"Nima",
"Mehdi"
};
String[] verbes = {
"mord",
"déteste",
"tue",
"mange",
"épouse"
};
String[] complements = {
"Sasha",
"les pommes",
"Elizabeth II",
"le capitalisme" // Je sais même pas si c'est un nom commun en vrai
};
Exquis sujet = new Exquis(sujets);
Exquis verbe = new Exquis(verbes);
Exquis complement = new Exquis(complements);
for (int i = 0; i != 5; i++) {
System.out.println(sujet + " " + verbe + " " + complement);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

View File

@@ -0,0 +1,31 @@
import java.awt.*;
import javax.swing.*;
public class Fenetre extends JFrame {
public Fenetre() {
this.setSize(250, 300);
this.setLocation(100, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new BorderLayout());
JPanel panneauHaut = new JPanel();
JPanel panneauBas = new JPanel();
JPanel panneauMilieu = new JPanel();
JButton boutonHaut = new JButton("\u25B2");
JButton boutonBas = new JButton("\u25BC");
Six imageSix = new Six();
boutonHaut.setHorizontalAlignment(JButton.CENTER);
boutonBas.setHorizontalAlignment(JButton.CENTER);
panneauHaut.add(boutonHaut);
panneauBas.add(boutonBas);
panneauMilieu.add(imageSix);
this.add(panneauHaut, BorderLayout.NORTH);
this.add(panneauBas, BorderLayout.SOUTH);
this.add(imageSix, BorderLayout.CENTER);
}
}

View File

@@ -0,0 +1,6 @@
public class Main {
public static void main(String[] args) {
Fenetre fenetre = new Fenetre();
fenetre.setVisible(true);
}
}

Binary file not shown.

View File

@@ -0,0 +1,19 @@
import java.awt.*;
import javax.swing.*;
public class Six extends JComponent {
@Override
public void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
if (this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
Image img = Toolkit.getDefaultToolkit().getImage("6.png");
// On place l'image au milieu de son composant puis on soustrait par la moitié des dimensions de l'image (55x80)
secondPinceau.drawImage(img, this.getWidth()/2 - 27 , this.getHeight()/2 - 40, this);
}
}

Binary file not shown.

View File

@@ -0,0 +1,19 @@
import java.awt.*;
import javax.swing.*;
public class Fenetre extends JFrame {
public Fenetre() {
this.setSize(300, 400);
this.setLocation(100, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new GridLayout(1, 1));
JPanel fond = new JPanel();
fond.setBackground(Color.BLACK);
this.add(fond);
GestionMolette molette = new GestionMolette(fond);
this.addMouseWheelListener(molette);
}
}

Binary file not shown.

View File

@@ -0,0 +1,21 @@
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class GestionMolette implements MouseWheelListener {
private JPanel fond;
public GestionMolette(JPanel fond) {
this.fond = fond;
}
public void mouseWheelMoved(MouseWheelEvent evenement) {
if (evenement.getWheelRotation() < 0) {
this.fond.setBackground(Color.WHITE);
}
else {
this.fond.setBackground(Color.BLACK);
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,6 @@
public class Main {
public static void main(String[] args) {
Fenetre fenetre = new Fenetre();
fenetre.setVisible(true);
}
}

19
DEV2.1/Menu.java Normal file
View File

@@ -0,0 +1,19 @@
import java.awt.*;
import javax.swing.*;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
public class Menu extends JFrame{
public Menu() {
this.setSize(800, 1000);
this.setLocation(500, 0);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
FondMenuPrincipale menu = new FondMenuPrincipale();
this.add(menu);
this.addMouseListener(new Quitter());
this.addMouseListener(new BoutonJouer(this));
}
}

1
DEV2.1/SAE21_2025 Submodule

Submodule DEV2.1/SAE21_2025 added at 9a2f651524

BIN
DEV2.1/Sudoku/Case.class Normal file

Binary file not shown.

26
DEV2.1/Sudoku/Case.java Normal file
View File

@@ -0,0 +1,26 @@
import java.awt.*;
import javax.swing.*;
public class Case extends JComponent {
@Override
public void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
if (this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.setColor(Color.BLACK);
secondPinceau.drawRect(0, 0, this.getWidth()-3, this.getHeight()-3);
secondPinceau.drawRect(1, 1, this.getWidth()-4, this.getHeight()-4);
secondPinceau.drawRect(2, 2, this.getWidth()-5, this.getHeight()-5);
for (int i = 0; i != 3; i++) {
for (int j = 0; j != 3; j++) {
secondPinceau.drawRect(this.getWidth()*i/3, this.getHeight()*j/3, this.getWidth()/3, this.getHeight()/3);
}
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,17 @@
import java.awt.*;
import javax.swing.*;
public class Graphique extends JFrame {
public Graphique() {
this.setSize(600, 600);
this.setLocation(100, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new GridLayout(9, 9));
for (int i = 0; i != 81; i++) {
this.add(new JTextField());
}
}
}

BIN
DEV2.1/Sudoku/Main.class Normal file

Binary file not shown.

6
DEV2.1/Sudoku/Main.java Normal file
View File

@@ -0,0 +1,6 @@
public class Main {
public static void main(String[] args) {
Graphique fenetre = new Graphique();
fenetre.setVisible(true);
}
}

BIN
DEV2.1/TDs/Fenetre.class Normal file

Binary file not shown.

0
DEV2.1/TDs/Fenetre.java Normal file
View File

BIN
DEV2.1/TDs/Flux.class Normal file

Binary file not shown.

25
DEV2.1/TDs/Flux.java Normal file
View File

@@ -0,0 +1,25 @@
import java.awt.*;
import java.io.*;
public class Flux {
public static void main(String[] args) {
FileOutputStream sortie;
DataOutputStream flux;
float[] tab = {1.0f, 2.0f, 1.5f};
try {
sortie = new FileOutputStream("reels.bin");
flux = new DataOutputStream(sortie);
} catch (IOException e1) {
}
for (float valeur : tab) {
try {
flux.writeFloat(valeur);
} catch (IOException e2) {
}
}
try {
flux.close();
} catch (IOException e3) {
}
}
}

BIN
DEV2.1/TDs/Img.class Normal file

Binary file not shown.

43
DEV2.1/TDs/Img.java Normal file
View File

@@ -0,0 +1,43 @@
import java.awt.*;
import javax.swing.*;
public class Img extends JComponent {
private Image img;
public Img() {
// Chargement de l'image
img = new ImageIcon("fond.png").getImage();
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (img != null) {
g.drawImage(img, 0, 0, this);
}
}
@Override
public Dimension getPreferredSize() {
return new Dimension(500, 500); // Ajustez à la taille de l'image
}
}
class Fenetre extends JFrame {
public Fenetre() {
this.setLocation(100, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Img imagePanel = new Img();
this.add(imagePanel);
this.pack(); // Ajuste la fenêtre à la taille du contenu
this.setVisible(true);
}
}
public class Main {
public static void main(String[] args) {
SwingUtilities.invokeLater(Fenetre::new);
}
}

BIN
DEV2.1/TDs/Main.class Normal file

Binary file not shown.

39
DEV2.1/TDs/Main.java Normal file
View File

@@ -0,0 +1,39 @@
import java.awt.*;
import javax.swing.*;
class Img extends JComponent {
private Image img;
public Img() {
// Chargement de l'image
img = Toolkit.getDefaultToolkit().getImage("triangles-1430105_1280.png");
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (img != null) {
g.drawImage(img, 0, 0, this);
}
}
}
class Fenetre extends JFrame {
public Fenetre() {
this.setLocation(100, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Img imagePanel = new Img();
this.add(imagePanel);
this.pack(); // Ajuste la fenêtre à la taille du contenu
}
}
public class Main {
public static void main(String[] args) {
Fenetre fenetre = new Fenetre();
fenetre.setVisible(true);
}
}

BIN
DEV2.1/TDs/Reels.class Normal file

Binary file not shown.

35
DEV2.1/TDs/Reels.java Normal file
View File

@@ -0,0 +1,35 @@
import java.awt.*;
import java.io.*;
public class Reels {
public static void main(String[] args) {
try {
FileWriter fichier = new FileWriter("reels.txt");
BufferedWriter flux = new BufferedWriter(fichier);
try {
flux.write("12.8391319");
flux.newLine();
flux.write("45.72");
flux.newLine();
flux.write("12.283939273718317174");
flux.newLine();
flux.write("1.0");
flux.newLine();
} catch (IOException e2 ) {
System.out.println("Erreur d'écriture");
}
try {
flux.close();
} catch (IOException e3) {
System.out.println("Erreur de femreture");
}
} catch (IOException e) {
System.out.println("Erreur d'ouverture");
}
}
}

BIN
DEV2.1/TDs/Somme.class Normal file

Binary file not shown.

9
DEV2.1/TDs/Somme.java Normal file
View File

@@ -0,0 +1,9 @@
import java.awt.*;
import java.io.*;
public class Somme {
public static void main(String[] args) {
InputStreamReader lecture = new InputStreamReader(System.in);
BufferedReader flux = new BufferedReader(lecture);
}
}

BIN
DEV2.1/TDs/fond.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB

4
DEV2.1/TDs/reels.bin Normal file
View File

@@ -0,0 +1,4 @@
12.8391319
45.72
12.283939273718317174
1.0

4
DEV2.1/TDs/reels.txt Normal file
View File

@@ -0,0 +1,4 @@
12.8391319
45.72
12.283939273718317174
1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB

Binary file not shown.

View File

@@ -36,9 +36,9 @@ public class Nuance extends JPanel {
for (String element : args) { for (String element : args) {
element = element.replaceAll("#", ""); element = element.replaceAll("#", "");
int[] couleurs = { int[] couleurs = {
Integer.parseInt(element.substring(0,2), 16), Integer.parseInt(element.substring(5,7), 16),
Integer.parseInt(element.substring(2,4), 16), Integer.parseInt(element.substring(7,9), 16),
Integer.parseInt(element.substring(4,6), 16) Integer.parseInt(element.substring(9,11), 16)
}; };
fenetre.add(new Nuance(couleurs)); fenetre.add(new Nuance(couleurs));
} }

Some files were not shown because too many files have changed in this diff Show More