From 70c2cf6f542f05eb8c2fa0624f2332b9fbb4011d Mon Sep 17 00:00:00 2001 From: Vieira Date: Mon, 14 Feb 2022 11:02:04 +0100 Subject: [PATCH] Erwan Gay --- APL2.1/TP6/Formes/Formes.class | Bin 0 -> 609 bytes APL2.1/TP6/Formes/Formes.java | 16 ++++++++++++++ APL2.1/TP6/Formes/cercles.png | Bin 0 -> 1917 bytes APL2.1/TP6/Formes/dessiner.class | Bin 0 -> 1324 bytes APL2.1/TP6/Formes/dessiner.java | 32 +++++++++++++++++++++++++++ APL2.1/TP6/Sautoir/PaintFormes.java | 27 ++++++++++++++++++++++ APL2.1/TP6/Sautoir/Paintsablier.java | 23 +++++++++++++++++++ APL2.1/TP6/Sautoir/Sablier.java | 13 +++++++++++ 8 files changed, 111 insertions(+) create mode 100644 APL2.1/TP6/Formes/Formes.class create mode 100644 APL2.1/TP6/Formes/Formes.java create mode 100644 APL2.1/TP6/Formes/cercles.png create mode 100644 APL2.1/TP6/Formes/dessiner.class create mode 100644 APL2.1/TP6/Formes/dessiner.java create mode 100644 APL2.1/TP6/Sautoir/PaintFormes.java create mode 100644 APL2.1/TP6/Sautoir/Paintsablier.java create mode 100644 APL2.1/TP6/Sautoir/Sablier.java diff --git a/APL2.1/TP6/Formes/Formes.class b/APL2.1/TP6/Formes/Formes.class new file mode 100644 index 0000000000000000000000000000000000000000..7a8f9ca6734bb7508a14a857f2bea12682512b60 GIT binary patch literal 609 zcmYjOO;6iE5Ph3Cv2omD0tHG-`Dg(LBYbFYR6R6RBr3NYf+Dq?Hu07&ioIyaQ<3i*riWSh3~l58i1JH15Pj@vo(c~y@yf%N zfo<$CIElz}YOEQaOq=k_B6_cMB6Q4us!2g|yCN%u_7I@sVHY8Vs%8xSgRrCFnHUk> z&PCCezerLeI6O2uTNH`ah!;}Pb(U%OL44zranT*CTpXPX{V!z&Q+}N%2}38SZfyj0 zReG*6l5z0gB&vqhB&g;<=CT@F@U=6*1|HE9nXd*KE_}i{+O3jhWE;EJU{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fK1*v>mbLU&@B=(ORMh{9eo$=&aLPTf=+%+Axq3BL#0}XT7lp^6cjoDp0Gs;e4fJAiR7EJebLXdyWWvfEur&HD5dIErNg4wr1wp)vx3*TQprRB}LBJ{(1r)(+XhVsFrY0%)TSp(k86QJO zgCjHkc6!_M@a-95YC?)i34e*XRT9l!|q`XLwIVu^(p@ z^dha0bdHzvtoE_g&&vf?FGiu`5=#RtU1sTugh7RrjD#T>R~58lnC;hOT<84;FC!90 zCEOHe zfA`lgKFsWh+(<)|gSH(Td zs+hyPiu=4gz=Dd0SX8mZ(j%50V}S~&wUq$U9Zj%{lf}+S{~>h4k$PO7uGD4k1K&-8Szy_L@bx^n&T%G*^tW?bmG` z@x(5jH7j*TCf7=*1WwfWwhhWU=ev|V(-2edXU;VZpJ?9Oh`3V^Lt5TU$#_{N7i#$u zQ9(IIsAC1!DHrnsvBtm(XB_33)O_MkpuM5-)no2DSGr*3{nZL=Rv=1-Tc%Z5r5npD zmTk|PITEFKmVT8{8=1UMv(Ye<^<;V1*sQuoCT7RRrfUc@8-`62%Lok6^&dv6ClXa# z?Q5)|ShiFqRAKxog;XaiHIDlmysLy}v%77v_{mfs&djoBx*MjONi5+Qz0(8q#08po zR!M3inWmc7qokcjh$KKyZb2l!qA3;%5dMP5M=}Zu2U^JmkPwCp4N=;AaJ&}&3(ceh z@6H5ho=OIgKA<~AyBr{z3WZ2g=)Wg`n)-wmHp;R#pbZ3QB|{qQChXd?OB|jsg2 H)YJa}@3kl7 literal 0 HcmV?d00001 diff --git a/APL2.1/TP6/Formes/dessiner.java b/APL2.1/TP6/Formes/dessiner.java new file mode 100644 index 0000000..3f4ef0a --- /dev/null +++ b/APL2.1/TP6/Formes/dessiner.java @@ -0,0 +1,32 @@ +import javax.swing.*; +import java.awt.*; + +public class dessiner extends JComponent { + private Image image; + public dessiner() { + super(); + this.image = Toolkit.getDefaultToolkit().getImage("cercles.png"); + } + @Override + protected void paintComponent(Graphics pinceau) { + Graphics secondPinceau = pinceau.create(); + if (this.isOpaque()) { + // on change couleur de fond + secondPinceau.setColor(this.getBackground()); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + // rectangle zebi + secondPinceau.setColor(Color.BLUE); + secondPinceau.drawRect(5, 5, 55, 55); + // Bleu + secondPinceau.setColor(Color.GREEN); + secondPinceau.fillOval(75, 5, 50, 50); + // Vert + secondPinceau.setColor(new Color(150, 131, 236)); + Font fonte = new Font("Gras", Font.BOLD, 24); + secondPinceau.setFont(fonte); + secondPinceau.drawString(">o<", 130, 30); + + secondPinceau.drawImage(this.image, 200, 10, this); + } +} \ No newline at end of file diff --git a/APL2.1/TP6/Sautoir/PaintFormes.java b/APL2.1/TP6/Sautoir/PaintFormes.java new file mode 100644 index 0000000..6e9d4dc --- /dev/null +++ b/APL2.1/TP6/Sautoir/PaintFormes.java @@ -0,0 +1,27 @@ +import javax.swing.*; +import java.awt.*; + +public class Paintformes extends JComponent { + private Image image; + public Paintformes() { + super(); + this.image = Toolkit.getDefaultToolkit().getImage("image.png"); + } + @Override + protected 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.BLUE); + secondPinceau.fillRect(5, 5, 55, 55); + secondPinceau.setColor(Color.GREEN); + secondPinceau.fillOval(75, 5, 50, 50); + secondPinceau.setColor(new Color(150, 131, 236)); + Font fonte = new Font("Gras", Font.BOLD, 24); + secondPinceau.setFont(fonte); + secondPinceau.drawString(">o<", 130, 30); + secondPinceau.drawImage(this.image, 200, 10, this); + } +} \ No newline at end of file diff --git a/APL2.1/TP6/Sautoir/Paintsablier.java b/APL2.1/TP6/Sautoir/Paintsablier.java new file mode 100644 index 0000000..b5b3c17 --- /dev/null +++ b/APL2.1/TP6/Sautoir/Paintsablier.java @@ -0,0 +1,23 @@ +import javax.swing.*; +import java.awt.*; + +public class Paintsablier extends JComponent { + private Image image; + public Paintsablier() { + super(); + } + @Override + protected 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.CYAN); + for (int i=0; i<(this.getWidth()/50); i++) { + for (int j=0; j<(this.getHeight()/50); j++) { + secondPinceau.fillPolygon(new int[] {25+i*50,50+i*50,25+i*50,0+i*50},new int[] {-25+j*50,0+j*50,25+j*50,0+j*50},4); + } + } + } +} \ No newline at end of file diff --git a/APL2.1/TP6/Sautoir/Sablier.java b/APL2.1/TP6/Sautoir/Sablier.java new file mode 100644 index 0000000..51682d3 --- /dev/null +++ b/APL2.1/TP6/Sautoir/Sablier.java @@ -0,0 +1,13 @@ +import javax.swing.*; +import java.awt.*; +public class Sablier { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(500, 500); + fenetre.setLocation(100, 100); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + Paintsablier draw = new Paintsablier(); + fenetre.add(draw, BorderLayout.CENTER); + fenetre.setVisible(true); + } +} \ No newline at end of file