From 0667cec233abad0a1a05fb076d46bb5601370318 Mon Sep 17 00:00:00 2001 From: martins Date: Thu, 21 Apr 2022 22:17:57 +0200 Subject: [PATCH] ok --- main_ex.class | Bin 1216 -> 950 bytes main_ex.java | 30 +++++--------- nombreCollonnesLigneEtBombe.class | Bin 0 -> 1476 bytes nombreCollonnesLigneEtBombe.java | 65 ++++++++++++++++++++++++++++++ observateurChoix.class | Bin 888 -> 1161 bytes observateurChoix.java | 13 ++++-- 6 files changed, 85 insertions(+), 23 deletions(-) create mode 100644 nombreCollonnesLigneEtBombe.class create mode 100644 nombreCollonnesLigneEtBombe.java diff --git a/main_ex.class b/main_ex.class index 892d803a95518ffd61a56f733479ffe0a09905fc..a23bbc278749278e133bcbd290b5ed6f61018e76 100644 GIT binary patch delta 592 zcmY*WU2hUW6g|Tt!)^y!pt9IvtF~6?c3t}+Rs5<{nm|yWY(sonWP@0`TUl!RV)_Ss zA^Sf}d|47njL-cOHSt&YqTbO5<2;;u?wNbsEawEE7r*Xwz%>-dds$91ZM3aO5Oj{5=+kP~=_ zM-1sV_B;E;@{hZ2$Er8%meXU1c>4lda#m7qTlVq5qH$hdwm%lAU|U4-1l8a>+Y8!} z64Qt0+59d8Z+HDe&vzKqjx(t5^z8%U*+OynZF-YL-x)kVwBH_)7%S9jwIcN-NUYee z_B(y=$Za!Z3XT6x4dP0@r10@xt;5>=O}&8N%2fQKiS7MV`1U z{YYw*Vk`Kd%$ypr5Zs7{h>xK*jS;k`Mu>@(5TY?gqM1&PF!{`+f+=&1R5OKNiZVhv zM8+^fOz-{0e@B*)q~QYc)21*Ge%%S8%a@B*X_Q11%GYq?lW!5J8s>VtC%2MD$arYWNT$TuBl zTE{xR_~tM1S2*rTJ3@z-Jtw>0?tbUn?C-zde*(CTRSlzRNU0ii(4vgYv_{&?#T15h6K_o?r9j1&ifjMFe{OBGB>AUUd023 z$h_^?{zHb4k=|fX^6s`^=(B7`tkkPz;jQy>g*-}?+YZB!@!Hzwhdf*1&Te+i_i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nombreCollonnesLigneEtBombe.java @@ -0,0 +1,65 @@ +import java.awt.*; +import javax.swing.*; + +public class nombreCollonnesLigneEtBombe{ + private int collonne, ligne, bombe, max, min; + JFrame fenetre; + public nombreCollonnesLigneEtBombe(JFrame fenetre0){ + this.min=4; + // il y a au minimun 4 ligne et 4 collonnes + this.max=30; + // il y a 30 ligne et collonne au max + this.collonne=1; + this.ligne=3; + this.bombe=0; + this.fenetre=fenetre0; + } + public void setCollonne(int n){ + this.collonne=n; + if(this.collonnethis.max){ + this.collonne=this.max; + } + } + public void setLigne(int n){ + this.ligne=n; + if(this.lignethis.max){ + this.ligne=this.max; + } + } + public void setBombe(int n){ + this.bombe=n; + if(this.bombethis.max){ + this.bombe=this.max; + } + } + public int getMax(){ + return this.max; + } + public int getMin(){ + return this.min; + } + public int getLignes(){ + return this.ligne; + } + public int getCollonnes(){ + return this.collonne; + } + public JFrame getJFrame(){ + JFrame fen2 = new JFrame(); + GridLayout grille = new GridLayout(this.ligne, this.collonne, 5, 5); + fen2.setLayout(grille); + fen2.setSize(1000,800); + fen2.setLocation(0,0); + fen2.setVisible(true); + return fen2; + } +} \ No newline at end of file diff --git a/observateurChoix.class b/observateurChoix.class index f1523bcb6de5b9fd5f57723a6698dcd3113f9ad4..b14945b3d95681d8ad4a9ad567595f9bada59f66 100644 GIT binary patch literal 1161 zcmah{?M@R>5IwhF+in*qpUS6#g3DSc3MyJev6iH!q7g%)|F-Q_FSfhQ?iPqo;j5U? zl4#-s_#{4sab~O3AjUs4duQgHv-iyX_T%$c0Bb1f$Y3Fb0bJu?a#-YG>9~%pjwF^e zEOTDqkmInz;f9WzSmm&$;g*Km8tw?BYRZ$Lg4|Q? z7x^>KMBVwK6G)He(;>Wgqyj#5o6kMz`+V#Rn=fQt+TmH>bz5FlZYvfZbt}H~4(vd- zywH+mzOaD_tQ#1@uz?Yb8W_U`0~ax_;jV#u$Q#(ey1>xi?ijd_O#=@&Jj9lUM+OSm zGVquInX__KVvbzhCV!t*_GxDVQ(@`M<;%(sXf2*V)MN`1-F4Bb?OJUoTpbx~mbj)_V_x%=F2)@F9iTnkU09 zX6bEaATWp+BJ31B;|QA-X7Ve{WEtfI%}rpE;uM{>X)aEA!a9MlCfkTu**2oqQX4UA zJl0116Lkfqd4{k+A8GU>MSA_DH%w~d6zQ4Z(l5?BqQnYpSjR+ij7SFwO7RXf>kE>v zPLLvAt_()M4~mZ+=zNGqJ4o|KtOKK`Is=Wk#*n644AI)BNzbBxS*1JV=?(&yPnB0l zmz6U_6D68H&K>mk*!t<;K=VmL4PcJYv*)7;_Am52p%(~k5_;|w&EB%M=!vn_K$hZ_ N|BtQE*wv6@{wMmd-hu!C delta 524 zcmaix%}&BV6ot>Ur9;cekNj9HqNoV1pqLm}MBhRacP?CXLkwZh+GRt04HFZ=#D$4l zU&X|=E903$U}a1*=Vs>K@7z1nd*|Ce`}lc%18|BH7Y?=@q*2$ht!2kW1G_Hvu&<>l zaUju>XvbF+t7bsCHNKrGaRP@jC%aP8HnJzOqw`$YMV3`V^VR0EVq*fMgk}J}r%=(Qb z)mu<`5~ekSt>X-GMP_*!z~j}bZ0nQu7W5c=jd{}qC-)a#*FS`KgLrk>yh>v|vRHM~ S&jU26oBx(61g!HDliDwfd@(}+ diff --git a/observateurChoix.java b/observateurChoix.java index 72bbea4..10dfffe 100644 --- a/observateurChoix.java +++ b/observateurChoix.java @@ -3,21 +3,28 @@ //Class pour la selection du nombre de collone et ligne et de Mine a la souris import java.awt.*; import java.awt.event.*; +import javax.swing.*; public class observateurChoix implements MouseListener{ private int direction; private paintChoix pinceau; private nombre compte; - public observateurChoix(int direction0, paintChoix pinceau0, nombre compte0){ + private JFrame fenetre; + public observateurChoix(int direction0, paintChoix pinceau0, nombre compte0, JFrame fenetre0){ this.direction=direction0; // pour savoir si c'est l'observateur de la fleche de gauche ou droite this.pinceau=pinceau0; this.compte=compte0; + this.fenetre=fenetre0; } @Override public void mouseClicked(MouseEvent evenement){ - compte.addNombre(direction); - + this.compte.addNombre(direction); + this.fenetre.dispose(); + this.fenetre=new JFrame(); + this.fenetre.setSize(1000,400); + this.fenetre.setLocation(0,0); + this.fenetre.setVisible(true); } @Override // un bouton cliqué public void mouseEntered(MouseEvent evenement){