diff --git a/DEV.3.1/TP/TP2/Galerie.1/1./GFenetre.class b/DEV.3.1/TP/TP2/Galerie.1/1./GFenetre.class new file mode 100644 index 0000000..00ae360 Binary files /dev/null and b/DEV.3.1/TP/TP2/Galerie.1/1./GFenetre.class differ diff --git a/DEV.3.1/TP/TP2/Galerie.1/1./GFenetre.java b/DEV.3.1/TP/TP2/Galerie.1/1./GFenetre.java new file mode 100644 index 0000000..3a07233 --- /dev/null +++ b/DEV.3.1/TP/TP2/Galerie.1/1./GFenetre.java @@ -0,0 +1,19 @@ +import java.awt.*; +import javax.swing.*; + +public class GFenetre extends JFrame { + + public GFenetre() { + super("Galerie"); + this.setSize(1000, 600); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.setLayout(new GridLayout(1,1)); + + JLabel imgJLabel = new JLabel(new ImageIcon("MICHEL.gif")); + this.add(imgJLabel, BorderLayout.CENTER); + + this.add(imgJLabel); + this.addMouseListener(new GestionSouris(imgJLabel ,this)); + + } +} \ No newline at end of file diff --git a/DEV.3.1/TP/TP2/Galerie.1/1./GestionSouris.class b/DEV.3.1/TP/TP2/Galerie.1/1./GestionSouris.class new file mode 100644 index 0000000..8d60727 Binary files /dev/null and b/DEV.3.1/TP/TP2/Galerie.1/1./GestionSouris.class differ diff --git a/DEV.3.1/TP/TP2/Galerie.1/1./GestionSouris.java b/DEV.3.1/TP/TP2/Galerie.1/1./GestionSouris.java new file mode 100644 index 0000000..6a0232d --- /dev/null +++ b/DEV.3.1/TP/TP2/Galerie.1/1./GestionSouris.java @@ -0,0 +1,52 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseListener; +import java.awt.event.MouseEvent; + +public class GestionSouris implements MouseListener { + + private JLabel img; + private String[] images; + private int actuel; + private GFenetre gfenetre; + + public GestionSouris(JLabel img, GFenetre gfenetre) { + this.img = img; + this.gfenetre = gfenetre; + String[] temp = { + "MICHEL.gif", + "image1.jpeg", + "imag2.jpeg" + }; + + this.images = temp; + this.actuel = 0; + + } + + @Override + public void mouseClicked(MouseEvent evenement) { + if (evenement.getX() < this.gfenetre.getWidth()/2) { + this.actuel--; + if (this.actuel == -1) { + this.actuel = 3; + } + } + else { + this.actuel++; + if (this.actuel == 4) { + this.actuel = 0; + } + } + + this.gfenetre.getContentPane().removeAll(); + this.gfenetre.add(new JLabel(new ImageIcon(this.images[this.actuel]))); + this.gfenetre.revalidate(); + this.gfenetre.repaint(); + } + + public void mousePressed(MouseEvent e) {} + public void mouseReleased(MouseEvent e) {} + public void mouseEntered(MouseEvent e) {} + public void mouseExited(MouseEvent e) {} +} \ No newline at end of file diff --git a/DEV.3.1/TP/TP2/Galerie.1/1./MICHEL.gif b/DEV.3.1/TP/TP2/Galerie.1/1./MICHEL.gif new file mode 100644 index 0000000..e2268e8 Binary files /dev/null and b/DEV.3.1/TP/TP2/Galerie.1/1./MICHEL.gif differ diff --git a/DEV.3.1/TP/TP2/Galerie.1/1./Main.class b/DEV.3.1/TP/TP2/Galerie.1/1./Main.class new file mode 100644 index 0000000..1d0d7f3 Binary files /dev/null and b/DEV.3.1/TP/TP2/Galerie.1/1./Main.class differ diff --git a/DEV.3.1/TP/TP2/Galerie.1/Main.java b/DEV.3.1/TP/TP2/Galerie.1/1./Main.java similarity index 53% rename from DEV.3.1/TP/TP2/Galerie.1/Main.java rename to DEV.3.1/TP/TP2/Galerie.1/1./Main.java index fef9417..f910583 100644 --- a/DEV.3.1/TP/TP2/Galerie.1/Main.java +++ b/DEV.3.1/TP/TP2/Galerie.1/1./Main.java @@ -3,10 +3,6 @@ import javax.swing.*; public class Main { public static void main(String[] args) { - - ImageIcon[] images = {new ImageIcon("image1.jpeg"), new ImageIcon("image2.jpeg"), new ImageIcon("MICHEL.gif")}; - - GModel model = new GModel(images); GFenetre fenetre = new GFenetre(); fenetre.setVisible(true); diff --git a/DEV.3.1/TP/TP2/Galerie.1/1./imag2.jpeg b/DEV.3.1/TP/TP2/Galerie.1/1./imag2.jpeg new file mode 100644 index 0000000..a47ce0e Binary files /dev/null and b/DEV.3.1/TP/TP2/Galerie.1/1./imag2.jpeg differ diff --git a/DEV.3.1/TP/TP2/Galerie.1/1./image1.jpeg b/DEV.3.1/TP/TP2/Galerie.1/1./image1.jpeg new file mode 100644 index 0000000..ff96bc5 Binary files /dev/null and b/DEV.3.1/TP/TP2/Galerie.1/1./image1.jpeg differ diff --git a/DEV.3.1/TP/TP2/Galerie.1/2.CardLayout/GFenetre.java b/DEV.3.1/TP/TP2/Galerie.1/2.CardLayout/GFenetre.java new file mode 100644 index 0000000..e69de29 diff --git a/DEV.3.1/TP/TP2/Galerie.1/2.CardLayout/Gsouris.java b/DEV.3.1/TP/TP2/Galerie.1/2.CardLayout/Gsouris.java new file mode 100644 index 0000000..e69de29 diff --git a/DEV.3.1/TP/TP2/Galerie.1/2.CardLayout/Main.java b/DEV.3.1/TP/TP2/Galerie.1/2.CardLayout/Main.java new file mode 100644 index 0000000..e69de29 diff --git a/DEV.3.1/TP/TP2/Galerie.1/GFenetre.java b/DEV.3.1/TP/TP2/Galerie.1/GFenetre.java deleted file mode 100644 index d51c57a..0000000 --- a/DEV.3.1/TP/TP2/Galerie.1/GFenetre.java +++ /dev/null @@ -1,26 +0,0 @@ -import java.awt.*; -import javax.swing.*; - -public class GFenetre extends JFrame { - private JLabel imgJLabel; - - public GFenetre() { - super("Galerie"); - this.setSize(1000, 600); - this.setLocationRelativeTo(null); - this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - this.imgJLabel = new JLabel(); - this.add(this.imgJLabel, BorderLayout.CENTER); - - } - - public void afficherImage(ImageIcon image) { - this.imgJLabel.setIcon(image); - } - - public JLabel getImageLabel() { - return this.imgJLabel; - } - -} \ No newline at end of file diff --git a/DEV.3.1/TP/TP2/Galerie.1/GModel.java b/DEV.3.1/TP/TP2/Galerie.1/GModel.java deleted file mode 100644 index 3f16efb..0000000 --- a/DEV.3.1/TP/TP2/Galerie.1/GModel.java +++ /dev/null @@ -1,23 +0,0 @@ -import javax.swing.*; - -public class GModel { - private ImageIcon[] imgCarousel; - private int index; - - public GModel(ImageIcon[] imgCarousel) { - this.imgCarousel = imgCarousel; - this.index = 0; - } - - public ImageIcon getImageActuel() { - return this.imgCarousel[this.index]; - } - - public void imageSuivante() { - this.index = (this.index + 1) % imgCarousel.length; - } - - public void imagePrecedente() { - this.index = (this.index - 1 + this.imgCarousel.length) % imgCarousel.length; - } -} \ No newline at end of file diff --git a/DEV.3.1/TP/TP2/Galerie.1/GestionSouris.java b/DEV.3.1/TP/TP2/Galerie.1/GestionSouris.java deleted file mode 100644 index bb84df5..0000000 --- a/DEV.3.1/TP/TP2/Galerie.1/GestionSouris.java +++ /dev/null @@ -1,40 +0,0 @@ -import java.awt.*; -import javax.swing.*; -import java.awt.event.*; - -public class GestionSouris implements MouseListener { - - private GModel model; - private GFenetre gfenetre; - - public GestionSouris(GModel model, GFenetre gfenetre) { - this.model = model; - this.gfenetre = gfenetre; - this.gfenetre.getImageLabel().addMouseListener(this); - this.gfenetre.afficherImage(this.model.getImageActuel()); - - } - - @Override - public void mouseClicked(MouseEvent e) { - int x = e.getX(); - int width = this.gfenetre.getImageLabel().getWidth(); - - if(x < width / 2) { - this.model.imagePrecedente(); - } else { - this.model.imageSuivante(); - } - - this.gfenetre.remove(this.gfenetre.getImageLabel()); - this.gfenetre.getImageLabel().setIcon(this.model.getImageActuel()); - this.gfenetre.add(this.gfenetre.getImageLabel(), BorderLayout.CENTER); - this.gfenetre.revalidate(); - this.gfenetre.repaint(); - } - - public void mousePressed(MouseEvent e) {} - public void mouseReleased(MouseEvent e) {} - public void mouseEntered(MouseEvent e) {} - public void mouseExited(MouseEvent e) {} -} \ No newline at end of file diff --git a/DEV.3.1/TP/TP4/ex1/build/GFenetre.class b/DEV.3.1/TP/TP4/ex1/build/GFenetre.class new file mode 100644 index 0000000..00ae360 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1/build/GFenetre.class differ diff --git a/DEV.3.1/TP/TP4/ex1/build/GestionSouris.class b/DEV.3.1/TP/TP4/ex1/build/GestionSouris.class new file mode 100644 index 0000000..8d60727 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1/build/GestionSouris.class differ diff --git a/DEV.3.1/TP/TP4/ex1/build/Main.class b/DEV.3.1/TP/TP4/ex1/build/Main.class new file mode 100644 index 0000000..1d0d7f3 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1/build/Main.class differ diff --git a/DEV.3.1/TP/TP4/ex1/galerie.jar b/DEV.3.1/TP/TP4/ex1/galerie.jar new file mode 100644 index 0000000..1d591ed Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1/galerie.jar differ diff --git a/DEV.3.1/TP/TP4/ex1/res/MICHEL.gif b/DEV.3.1/TP/TP4/ex1/res/MICHEL.gif new file mode 100644 index 0000000..e2268e8 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1/res/MICHEL.gif differ diff --git a/DEV.3.1/TP/TP4/ex1/res/imag2.jpeg b/DEV.3.1/TP/TP4/ex1/res/imag2.jpeg new file mode 100644 index 0000000..a47ce0e Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1/res/imag2.jpeg differ diff --git a/DEV.3.1/TP/TP4/ex1/res/image1.jpeg b/DEV.3.1/TP/TP4/ex1/res/image1.jpeg new file mode 100644 index 0000000..ff96bc5 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1/res/image1.jpeg differ diff --git a/DEV.3.1/TP/TP4/ex1/src/GFenetre.java b/DEV.3.1/TP/TP4/ex1/src/GFenetre.java new file mode 100644 index 0000000..2080c54 --- /dev/null +++ b/DEV.3.1/TP/TP4/ex1/src/GFenetre.java @@ -0,0 +1,21 @@ +import java.awt.*; +import javax.swing.*; + +public class GFenetre extends JFrame { + + public GFenetre() { + super("Galerie"); + this.setSize(1000, 600); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.setLayout(new GridLayout(1,1)); + + JLabel imgJLabel = new JLabel(new ImageIcon("../res/MICHEL.gif")); + this.add(imgJLabel, BorderLayout.CENTER); + + this.add(imgJLabel); + this.addMouseListener(new GestionSouris(imgJLabel ,this)); + + } + + +} \ No newline at end of file diff --git a/DEV.3.1/TP/TP4/ex1/src/GestionSouris.java b/DEV.3.1/TP/TP4/ex1/src/GestionSouris.java new file mode 100644 index 0000000..c40d504 --- /dev/null +++ b/DEV.3.1/TP/TP4/ex1/src/GestionSouris.java @@ -0,0 +1,52 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseListener; +import java.awt.event.MouseEvent; + +public class GestionSouris implements MouseListener { + + private JLabel img; + private String[] images; + private int actuel; + private GFenetre gfenetre; + + public GestionSouris(JLabel img, GFenetre gfenetre) { + this.img = img; + this.gfenetre = gfenetre; + String[] temp = { + "../res/MICHEL.gif", + "../res/image1.jpeg", + "../res/imag2.jpeg" + }; + + this.images = temp; + this.actuel = 0; + + } + + @Override + public void mouseClicked(MouseEvent evenement) { + if (evenement.getX() < this.gfenetre.getWidth()/2) { + this.actuel--; + if (this.actuel == -1) { + this.actuel = 3; + } + } + else { + this.actuel++; + if (this.actuel == 4) { + this.actuel = 0; + } + } + + this.gfenetre.getContentPane().removeAll(); + this.gfenetre.add(new JLabel(new ImageIcon(this.images[this.actuel]))); + this.gfenetre.revalidate(); + this.gfenetre.repaint(); + } + + public void mousePressed(MouseEvent e) {} + public void mouseReleased(MouseEvent e) {} + public void mouseEntered(MouseEvent e) {} + public void mouseExited(MouseEvent e) {} +} \ No newline at end of file diff --git a/DEV.3.1/TP/TP4/ex1/src/Main.java b/DEV.3.1/TP/TP4/ex1/src/Main.java new file mode 100644 index 0000000..f910583 --- /dev/null +++ b/DEV.3.1/TP/TP4/ex1/src/Main.java @@ -0,0 +1,10 @@ +import java.awt.*; +import javax.swing.*; + +public class Main { + public static void main(String[] args) { + GFenetre fenetre = new GFenetre(); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV.3.1/TP/TP4/ex1_test/build/GFenetre.class b/DEV.3.1/TP/TP4/ex1_test/build/GFenetre.class new file mode 100644 index 0000000..00ae360 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1_test/build/GFenetre.class differ diff --git a/DEV.3.1/TP/TP4/ex1_test/build/GestionSouris.class b/DEV.3.1/TP/TP4/ex1_test/build/GestionSouris.class new file mode 100644 index 0000000..8d60727 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1_test/build/GestionSouris.class differ diff --git a/DEV.3.1/TP/TP4/ex1_test/build/Main.class b/DEV.3.1/TP/TP4/ex1_test/build/Main.class new file mode 100644 index 0000000..1d0d7f3 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1_test/build/Main.class differ diff --git a/DEV.3.1/TP/TP4/ex1_test/res/MICHEL.gif b/DEV.3.1/TP/TP4/ex1_test/res/MICHEL.gif new file mode 100644 index 0000000..e2268e8 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1_test/res/MICHEL.gif differ diff --git a/DEV.3.1/TP/TP4/ex1_test/res/imag2.jpeg b/DEV.3.1/TP/TP4/ex1_test/res/imag2.jpeg new file mode 100644 index 0000000..a47ce0e Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1_test/res/imag2.jpeg differ diff --git a/DEV.3.1/TP/TP4/ex1_test/res/image1.jpeg b/DEV.3.1/TP/TP4/ex1_test/res/image1.jpeg new file mode 100644 index 0000000..ff96bc5 Binary files /dev/null and b/DEV.3.1/TP/TP4/ex1_test/res/image1.jpeg differ diff --git a/DEV.3.1/TP/TP4/ex1_test/src/Controlleur.java b/DEV.3.1/TP/TP4/ex1_test/src/Controlleur.java new file mode 100644 index 0000000..b4193cd --- /dev/null +++ b/DEV.3.1/TP/TP4/ex1_test/src/Controlleur.java @@ -0,0 +1,35 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseListener; +import java.awt.event.MouseEvent; + +public class Controlleur implements MouseListener { + + private JLabel[] img; + private Fenetre fenetre; + private int actuel; + private CardLayout layout; + + public Controlleur(JLabel[] img, Fenetre fenetre, CardLayout layout) { + this.img = img; + this.fenetre = fenetre; + this.actuel = 0; + this.layout = layout; + } + + public void mouseClicked(MouseEvent evenement) { + if (evenement.getX() < this.fenetre.getWidth()/2) { + this.layout.previous(this.fenetre.getContentPane()); + } + else { + this.layout.next(this.fenetre.getContentPane()); + } + this.layout.show(this.fenetre.getContentPane(), "wow"); + } // un bouton cliqué + + + public void mouseEntered(MouseEvent evenement) {} // debut du survol + public void mouseExited(MouseEvent evenement) {} // fin du survol + public void mousePressed(MouseEvent evenement) {} // un bouton appuyé + public void mouseReleased(MouseEvent evenement) {} // un bouton relâché +} \ No newline at end of file diff --git a/DEV.3.1/TP/TP4/ex1_test/src/Fenetre.java b/DEV.3.1/TP/TP4/ex1_test/src/Fenetre.java new file mode 100644 index 0000000..96719f8 --- /dev/null +++ b/DEV.3.1/TP/TP4/ex1_test/src/Fenetre.java @@ -0,0 +1,27 @@ +import java.awt.*; +import javax.swing.*; + +public class Fenetre extends JFrame { + + public Fenetre() { + this.setSize(900, 450); + this.setLocation(100, 100); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + CardLayout layout = new CardLayout(); + this.setLayout(layout); + + JLabel img1 = new JLabel(new ImageIcon("img1.jpg")); + JLabel img2 = new JLabel(new ImageIcon("img2.jpg")); + JLabel img3 = new JLabel(new ImageIcon("img3.jpg")); + JLabel img4 = new JLabel(new ImageIcon("img4.jpg")); + + JLabel[] tableau = {img1, img2, img3, img4}; + + this.add(img1); + this.add(img2); + this.add(img3); + this.add(img4); + this.addMouseListener(new Controlleur(tableau, this, layout)); + } +} \ No newline at end of file diff --git a/DEV.3.1/TP/TP4/ex1_test/src/Main.java b/DEV.3.1/TP/TP4/ex1_test/src/Main.java new file mode 100644 index 0000000..2768c3d --- /dev/null +++ b/DEV.3.1/TP/TP4/ex1_test/src/Main.java @@ -0,0 +1,6 @@ +public class Main { + public static void main(String[] args) { + Fenetre fenetre = new Fenetre(); + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV.3.1/cours/4_Organisation_du_code.docx b/DEV.3.1/cours/4_Organisation_du_code.docx deleted file mode 100644 index d0cbb5d..0000000 Binary files a/DEV.3.1/cours/4_Organisation_du_code.docx and /dev/null differ diff --git a/DEV.3.1/cours/4_Organisation_du_code.odt b/DEV.3.1/cours/4_Organisation_du_code.odt new file mode 100644 index 0000000..561dec2 Binary files /dev/null and b/DEV.3.1/cours/4_Organisation_du_code.odt differ