From e425718364bbb764518b70879212b7edba175dfd Mon Sep 17 00:00:00 2001 From: martins Date: Wed, 20 Apr 2022 00:33:31 +0200 Subject: [PATCH] =?UTF-8?q?test=20de=20d=C3=A9part=20(=20essaie=20selectio?= =?UTF-8?q?n=20ligne,=20collonne=20et=20mines)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_ex.class | Bin 0 -> 1216 bytes main_ex.java | 42 ++++++++++++++++++++++++++ nombre.class | Bin 0 -> 547 bytes nombre.java | 23 ++++++++++++++ observateurChoix.class | Bin 0 -> 888 bytes observateurChoix.java | 43 ++++++++++++++++++++++++++ paintChoix.class | Bin 0 -> 1279 bytes paintChoix.java | 67 +++++++++++++++++++++++++++++++++++++++++ test.class | Bin 0 -> 958 bytes test.java | 36 ++++++++++++++++++++++ 10 files changed, 211 insertions(+) create mode 100644 main_ex.class create mode 100644 main_ex.java create mode 100644 nombre.class create mode 100644 nombre.java create mode 100644 observateurChoix.class create mode 100644 observateurChoix.java create mode 100644 paintChoix.class create mode 100644 paintChoix.java create mode 100644 test.class create mode 100644 test.java diff --git a/main_ex.class b/main_ex.class new file mode 100644 index 0000000000000000000000000000000000000000..892d803a95518ffd61a56f733479ffe0a09905fc GIT binary patch literal 1216 zcmZWoTT|0e5dIELn>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_iSf3 zCld$w&W^pc$9F}3&$W-%xm}TI!$tr<%GTZ!GW&eV<5iJMzb-InYi`}!5=*wk>9YJA zaWo@~>o|`K3`u$K&SZ!!{Q6WSa&=Fl9_o06$2y+iF++bqjKBA@%bvY$@egj@mmrEi zMPA1O7IiFPS;rMzrTz!h(ht~5)FNr&xYe>pY`QyJyeuj@o`FbrM_zJAR2brJxhA|r z?h~v3^`7f^0ZT^_D-3Gqd4xSyZ?(KHwtR-cwnnEUJyR3D@B*u8}@Hb~)XGb*y5}YU>xYjPvd7qFb*C%dYvt5gx>Q z8bjs;GVfLoT!+xP4h8wdV<#@t5{%LU0U3^k!xW+>D^*i3}}Btl~iL|RZwN~DQs(VS`^W=0y&Or?P{<~Qh@ z$K@xeFrY&&TAbE!gtqV+l1S4Q&R`I?a1Qq|OmX@LJMF(Bj3{NjZK1cMG;!9FmoQz5 zE%cR|h_AGeC`~tzY@&ZoX<>kzgLB~)hDtr=bQ9<1B4&yx4NH$Q6?oLCluDkA*+6PD zlOnEk5ckw((RlC! z{3zpWi!sJ*GVi_F*O}>le!YJH*hMXe49Z!gv8bVv!xEMyq{NCqCL9ghV_!fV3#5kX zj?{h-2GIe>dgDUCJREg-UuXuQe>xeq{qebK56EOyw|hGK+N>Yz-Fz!jotqPNJ6o}$ zQ7ak;VNak`Z#4UAs&)n{?Cm7%othis.max){ + this.nombre=this.max; + } + } + @Override + public String toString(){ + return String.valueOf(this.nombre); + } +} \ No newline at end of file diff --git a/observateurChoix.class b/observateurChoix.class new file mode 100644 index 0000000000000000000000000000000000000000..f1523bcb6de5b9fd5f57723a6698dcd3113f9ad4 GIT binary patch literal 888 zcmah|Z*S5-9DWWu3grgO4F#Fgsnb%oF%#cy@eRR*1gDwC7rrZS(VNhcw&1>&iD2Rj zKY$;~_*~Ip%#3OJyWTy2uFvn>K*e7P`yia{Zd`0uX$s!+RQWu*kir!I;!Gi2eXK{sVW; zxM1VP8Nu-}x^d;grS4q%3*70b=cb6v;KDZf?)SRqeD}Ne=EKidZvh;_sW_78j-eTQ zrAWuogWfo`eNyyEvtMfar7)y9pdk}S69%P`)sWMW7trgLW0ic{b6u+@Ag&9<7VKKX zMSEHxGG@EBKQ5pe(*svHOnD2IKyt=*t+}P!^H%M$Iq%S;8rNmKxoX<3Kjq!7damXA z0`11kqIuUWn9F|QY|X4z>{5MHW+pEAX6e?fSq%U*6a?azyro*nI%7+~WCN+<+4u4i zLC1Cs>1aVpM=Q2*f{p_?sACw1bR5PJ9Y=9Y$8n747?olSCs@!1`;_N+HHk8=V*)2h z_m_cn%Dj7p`m*ho3+Fd2AhiMTr+fj$kSmCkYL@A<)HY+_ABz--+Vx`9ytBj<&R};F zWy_!Bs>?NR$z2d=-8?aB%>ER=YH99nQPpbz99oh^PnVownF@~!-2*ob5tPMvNp zz9nx3eL+eJpBvA=k_e^{Y_S2RDC;?rF6v0ah?LZ|O2c9SkvH)y>2*r6&4g({Q74z;k<#Q85KtwJs)NB@sb_B|Br*F$~}z;1`p z2_0SB>TY_{$WV@<7qjStiGFx6u#5pbVB`q~v4Sj~B8OGv@e&2R!w}x{K7PbOeBv?r z!W;P&NAL|tMFPh}3dcn|MnoE;!oZlw^KK4fT%5p!IL*sAi%INeB`pa5K#zvbO!_-q MK0F6|f@-^d1L6(%1poj5 literal 0 HcmV?d00001 diff --git a/paintChoix.java b/paintChoix.java new file mode 100644 index 0000000..2e3797f --- /dev/null +++ b/paintChoix.java @@ -0,0 +1,67 @@ +// Tom Monin et Clément Martins +// paintChoix V1 +// class pour l'affichage de la selection des lignes, collonnes et nombre de mines + +import java.awt.*; +import javax.swing.*; +import javax.swing.JComponent; + +public class paintChoix extends JComponent{ + private boolean selectionner; + private int direction; + + public paintChoix(int direction0){ + + this.selectionner=false; + //de base ce n'est pas selectionner + this.direction=direction0; + //initialser arbitrairement sur 0 + } + public void selectionner(boolean verif){ + this.selectionner=verif; + } + @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()); + } + if(selectionner==true){ + secondPinceau.setColor(new Color(0,255,255)); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + }else{ + secondPinceau.setColor(new Color(215,215,215)); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + if(this.direction==1){ + secondPinceau.setColor(new Color(0,0,0)); + secondPinceau.fillRect(this.getWidth()/5, this.getHeight()/3, this.getWidth()/5*4, this.getHeight()/3); + int[] x= new int[3]; + int[] y= new int[3]; + x[0]=this.getWidth()/5; + x[1]=0; + x[2]=x[0]; + y[0]=0; + y[1]=this.getHeight()/2; + y[2]=this.getHeight(); + secondPinceau.fillPolygon(x, y, 3); + } + if(this.direction==2){ + secondPinceau.setColor(new Color(0,0,0)); + secondPinceau.fillRect(0, this.getHeight()/3, this.getWidth()/5*4, this.getHeight()/3); + int[] x= new int[3]; + int[] y= new int[3]; + x[0]=this.getWidth()/5*4; + x[1]=this.getWidth(); + x[2]=x[0]; + y[0]=0; + y[1]=this.getHeight()/2; + y[2]=this.getHeight(); + secondPinceau.fillPolygon(x, y, 3); + } + } +} \ No newline at end of file diff --git a/test.class b/test.class new file mode 100644 index 0000000000000000000000000000000000000000..aa6eb49527029e2969fece00f61dfe4e34f9755e GIT binary patch literal 958 zcmZWo%Tg0T6g`ufye5Mr;UUT!5hocWKJXc26N(Zm$N~yPs;p{~CTS{}p(YbSzs9XQ z-3*pkZru4Leud?|6RN;sbGrNVx%ZxXd*=7w?>_-7V%fw1CX$#;Vah}d(+o2Vw-{y_ zZZpi8$m32DwuuZ1%oG_MK9V%k3z|>jZW0R`5=+We!LkP3E^KQsDqdY`=&veQzV5d7 zrN1TiTf`V`p)3ey;}7}Tb2uZYZ}Z=uj|+3s$yL_key(GGg}zMkcK?({|_V8%CFCDa@O@(RkCmo z_bohNc!)&{kMP*S6FjwW6Qfk&h&%_8AJ)^|Gd#CYW>~@tYKp6B$X;}`v41FQL=E+P zUuiSbkwMj~i9mTYjkvwG#?2>*-BcgB555;4ye{P!JgalixRcZWOA+u|o!m9EnPMdY77@{w0wrIIVONjo6 zNkv4Q&e{1Ziik