From edc92ac142d08c03de01ede95aab3f2aa273b664 Mon Sep 17 00:00:00 2001 From: stiti Date: Sat, 9 Mar 2024 16:05:37 +0100 Subject: [PATCH] Ajout --- .../SUJETA/EXO1/DeviseInfoPrinter.class | Bin 0 -> 1123 bytes .../Entrainement/SUJETA/EXO1/Monnaie.class | Bin 942 -> 578 bytes .../Entrainement/SUJETA/EXO1/Monnaie.java | 26 +++++++----- .../SUJETA/{EXO1 => EXO2}/Sudoku/Menu.class | Bin .../SUJETA/{EXO1 => EXO2}/Sudoku/Nuance.java | 0 .../Entrainement/SUJETB/EXO4/Ciel.class | Bin 0 -> 1713 bytes .../DEV2.1/Entrainement/SUJETB/EXO4/Ciel.java | 40 ++++++++++++++++++ .../Entrainement/SUJETB/EXO4/Soleil.java | 9 ++++ .../SUJETB/EXO4/SolutiondeGPT/Explication.txt | 3 ++ .../SUJETB/EXO4/SolutiondeGPT/Main.java | 12 ++++++ .../SUJETB/EXO4/SolutiondeGPT/SkyFrame.java | 22 ++++++++++ .../SUJETB/EXO4/SolutiondeGPT/SunPanel.java | 38 +++++++++++++++++ 12 files changed, 140 insertions(+), 10 deletions(-) create mode 100644 BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/DeviseInfoPrinter.class rename BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/{EXO1 => EXO2}/Sudoku/Menu.class (100%) rename BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/{EXO1 => EXO2}/Sudoku/Nuance.java (100%) create mode 100644 BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Ciel.class create mode 100644 BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Ciel.java create mode 100644 BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Soleil.java create mode 100644 BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/Explication.txt create mode 100644 BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/Main.java create mode 100644 BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/SkyFrame.java create mode 100644 BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/SunPanel.java diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/DeviseInfoPrinter.class b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/DeviseInfoPrinter.class new file mode 100644 index 0000000000000000000000000000000000000000..57d97b31c3f5bcb57e2edf5deecfa3ed6c263662 GIT binary patch literal 1123 zcmaJ=TTc@~6#j-H3(HEOfQSlKDOxU4?-z=q))1P2nw02+Pt#?Df$dD)oh9i%@o(q@ znm+gg{87d;yEUbuaW|RE*>m~6Z_oMtr~M1SE4*|ufQ*Ad4;L`RFn+{Ocq!oOp!BYO zBz(g#v>}x=FBme#r4KHKG2+1WFba<$m$=792Bk_IhC=x*hS39Iswy&E`GTQX-09}5 znNX^O@=|K*i7Ss_3|R-`9ww0MK~if)Ml=Y3jtS3n8Z33`JtZ@gQt(FE0-N$MjY|w; z1mJDl5TW!ddY>>5@@kIwUiL7HD-1IYek>|l`P_Vz=8#Snt%)dkvDyKbXwbpy;u_{0 z%zL0wyTTmm{b(5Xr~_>Byh_ym5{vwLo(f2oH2O=u$Xnhl)T9w*Qm3kv2rB`PA`v;*U|2lIsUK7aG)nXTccr0Ac_EJ? z4XAzWN+U{ru}r5q+L^U1{{Z_&2Zj||?Pp+|)>R5kUAOIoleMt&6VC2;TwFcHWE(TU zDXym18*MBm*KVd91}P>-B_}aO?*ffh26xCdfHjn8AEVPls&O}2?_-^8F5Sy`j!n$| E1@u269{>OV literal 0 HcmV?d00001 diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/Monnaie.class b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/Monnaie.class index a11dce71704454224634eec353f151d524f3b16a..742cff289d967045d9afbb4dd7f3ae38b48c22fb 100644 GIT binary patch delta 381 zcmYL_&r1S96vscatB$U_nf=hLEVB-3fmFvL2)YDHK_GPKu*D`Tv4x3O&mF^i*KR=_ z3JN-O3HqBNdgGx6=KFm!-}k=r-aP1!*x>8u^&Qw{#lgbX#9ZPe6yqJg@7FK-0!R<*f zV2L^D-z*DdCJ-#jsVJ<3CAjHU%xrO{`@!ra1W0Sj9|*ZRZQnGgKHYD8^~Zv zho$VS$`qA%Lmf8_+`^oWc@?&GENCccSY*g;3Ms-T3~77e4MS$zZ*qp=s*wCy)N1hH zmDBJjl4&_YGECU-s|U`JQ}!IWU#^FNkoy}7I9LxI_e0HT_v($h9|bPo6$)(Dd?_8l zR}|F5C<+>uOe|wXL)pY_++mpfx9wIWye1DAMinPZMlBwQj}f=lEfcG_Ymx}}mG{8J zL#%0dWMUl~3`V`vYWQAKxQR7}xf%~#VKwK4Y^oN46-jO#IUbJ!Yv(O>EbhGCD>7(3 zq6{Oabe=a3xEnGQ;!qR{ue==v0hexvVPKz!6?qss(xo4@?F-aNLT7NqvTs1Wa~Sd# zt-z0H%y?2S{PGJ@HzbX@(;`65X}7s-GA#dpNZ(d^@)2-|DAF!TJvZ4dt-8W6ZC4h~ zu{}lUp`Wam;gWs6kou0rdYt7+61Ej zkY!}ErDL$KEtt>meQ-$#qUVfz9Ib+nRmy?7IIx^ zOI_$);3qw?<=BDDgMd 0){ +public class Monnaie { + public static void main(String args[]) { + DeviseInfoPrinter deviseInfoPrinter = new DeviseInfoPrinter(); + + if (args.length > 0) { String nom_monnaie = args[0]; - Currency monnaie = Currency.getInstance(nom_monnaie); - System.out.println("Code numerique : "+monnaie.getNumericCode()); - System.out.println("Symbole : "+ monnaie.getSymbol()); - }else{ + deviseInfoPrinter.printDeviseInfo(nom_monnaie); + } else { System.out.println("Merci d'indiquer une valeur EX : \"EUR\""); } - } -} \ No newline at end of file +} + +class DeviseInfoPrinter { + public void printDeviseInfo(String nom_monnaie) { + Currency monnaie = Currency.getInstance(nom_monnaie); + System.out.println("Code numerique : " + monnaie.getNumericCode()); + System.out.println("Symbole : " + monnaie.getSymbol()); + } +} diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/Sudoku/Menu.class b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO2/Sudoku/Menu.class similarity index 100% rename from BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/Sudoku/Menu.class rename to BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO2/Sudoku/Menu.class diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/Sudoku/Nuance.java b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO2/Sudoku/Nuance.java similarity index 100% rename from BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO1/Sudoku/Nuance.java rename to BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO2/Sudoku/Nuance.java diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Ciel.class b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Ciel.class new file mode 100644 index 0000000000000000000000000000000000000000..187804eb7e12faa12ee547f55b86fd352c8631f7 GIT binary patch literal 1713 zcma)6YgZdp6y2AknUD?;pirQe0tFjV+Ejd-+6t+>8j2Dgg#y*u zKSMu+u68YdfXkoca=CAkLXfU5Cz;nh=j?ONK6~z;|GfMIz#Mb}9f(+n+PHw2z~B$^ znfxge9BKC;vy$^FRnJv!C=k1=T^-&Nh@_^s5{RSILc+#H*aE#KC?k);%%U%=WnB#D zU-Xp>mB2u1I)BcdO`sb+7Lqo4(I*hiY2^sSb+A^IKh_w=G`pR+gaHeKHZEgGp!)7*N@Hm+fet_LdI)}^rA$i8e$ z6E?0JQzuPJN*|O%gFR*AUEE;6zIL2-RU|!DYMICMRv%fNwvon7g7`I;jK1#Qk)(9J z=DKpvQLOP6Zd=IMxP$iuM%sBV81^?q?dVV|a(Pj^&%8sGC!g&4a;uHAc+*=J-WTX= z$5~nMWktpDAsa9RkIg%(mcT4NHq-vZ%%;gm1F8`EOq(^F%;GZ}S=?n`q_3cV=0Gm6 z!=~+?jr;gQV2HK{YG2lzFz0xITB|BwhT3D((Nx2?8xaGRv+)2NR793a0_ihjXbCLa zCXy4?k)&BH+E~J}K!Vw}bf8I|!QXAp?xBsm(QUFRw>h^|D0@eXn+%BNyb@h|^4e98 zYLz|ZZy4sOqpH*{MRB6-!M2KCE0{b8bQMBbJY1F4R%EooNHfwWZ{m&qj;!pJM=Rc=bD(!E7wGX%z)Xcaf-IAk%$-L(s)~ea_{j{x| z3EX&IRqgKo-`Gs~_SlvT+MCQt$0_JgWd-bI*HwPbkwKsW3nX>w94BvT&%%Mg=-XYn zWi`3LIET=|?-=|@sC&eCUFF+V-i29BA4B}c2Z2Yt8Z!{(Zw+7Z*|D}SNy_%9iOIS zb$tE`-8;va%coiT{B}B8$HFP>C@cmK6LN%m^A$dgvc_w;feFmudNN_8+e$S?Pjf_H oVC58{S=c3(F~D<^_6}@en|GUW-*D|Qc6b)KlHf`S`zT}hU*d+8iU0rr literal 0 HcmV?d00001 diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Ciel.java b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Ciel.java new file mode 100644 index 0000000..f200e8a --- /dev/null +++ b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Ciel.java @@ -0,0 +1,40 @@ +import javax.swing.JComponent; +import java.awt.Graphics; + +public class Ciel extends JComponent { + @Override + protected void paintComponent(Graphics pinceau) { + // obligatoire : on crée un nouveau pinceau pour pouvoir le modifier plus tard + Graphics secondPinceau = pinceau.create(); + // obligatoire : si le composant n'est pas censé être transparent + if (this.isOpaque()) { + // obligatoire : on repeint toute la surface avec la couleur de fond + secondPinceau.setColor(this.getBackground()); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + // maintenant on dessine ce que l'on veut + secondPinceau.setColor(this.getForeground()); + secondPinceau.drawString("Bonjour !", 10, 20); + } + + + public static void main(String[] args) { + SwingUtilities.invokeLater(() -> { + createAndShowGUI(); + }); + } + + private static void createAndShowGUI() { + JFrame fenetre = new JFrame("Ciel Bleu"); + fenetre.setSize(400, 400); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + // Ajout de votre composant Ciel dans la fenêtre + Ciel cielComponent = new Ciel(); + fenetre.add(cielComponent); + + // Assurez-vous que la fenêtre est visible + fenetre.setVisible(true); + } + +} \ No newline at end of file diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Soleil.java b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Soleil.java new file mode 100644 index 0000000..27063dd --- /dev/null +++ b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/Soleil.java @@ -0,0 +1,9 @@ +import javax.swing.JComponent; +import java.awt.Graphics; + +public class Soleil{ + + public Soleil(){ + + } +} \ No newline at end of file diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/Explication.txt b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/Explication.txt new file mode 100644 index 0000000..e40fa09 --- /dev/null +++ b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/Explication.txt @@ -0,0 +1,3 @@ +Main.java, SkyFrame.java et SunPanel.java on été générer par ChatGPT. + +Le code n'est pas forcément bon, c'est juste pour voir comment faire \ No newline at end of file diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/Main.java b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/Main.java new file mode 100644 index 0000000..f487001 --- /dev/null +++ b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/Main.java @@ -0,0 +1,12 @@ +import javax.swing.*; + +public class Main { + public static void main(String[] args) { + SwingUtilities.invokeLater(() -> { + SkyFrame skyFrame = new SkyFrame(); + skyFrame.setSize(800, 600); + skyFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + skyFrame.setVisible(true); + }); + } +} diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/SkyFrame.java b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/SkyFrame.java new file mode 100644 index 0000000..b09a3ff --- /dev/null +++ b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/SkyFrame.java @@ -0,0 +1,22 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class SkyFrame extends JFrame { + private SunPanel sunPanel; + + public SkyFrame() { + setTitle("Sky with Sun"); + setLayout(new BorderLayout()); + + sunPanel = new SunPanel(); + add(sunPanel, BorderLayout.CENTER); + + addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + sunPanel.increaseSunRadius(15); + } + }); + } +} diff --git a/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/SunPanel.java b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/SunPanel.java new file mode 100644 index 0000000..b74f54f --- /dev/null +++ b/BUT1/CONTROLE/DEV2.1/Entrainement/SUJETB/EXO4/SolutiondeGPT/SunPanel.java @@ -0,0 +1,38 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class SunPanel extends JPanel { + private int sunRadius; + + public SunPanel() { + sunRadius = 50; // Rayon initial du soleil + addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + increaseSunRadius(15); + } + }); + } + + public void increaseSunRadius(int increment) { + sunRadius += increment; + repaint(); + } + + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + + Graphics2D g2d = (Graphics2D) g; + g2d.setColor(new Color(115, 194, 251)); // Couleur du ciel + g2d.fillRect(0, 0, getWidth(), getHeight()); + + int sunX = getWidth() / 2 - sunRadius; + int sunY = getHeight() - sunRadius * 2; + + g2d.setColor(Color.YELLOW); // Couleur du soleil + g2d.fillOval(sunX, sunY, sunRadius * 2, sunRadius * 2); + } +}