diff --git a/DEV3.1/TP2:Transitions/Changement.class b/DEV3.1/TP2:Transitions/Changement.class new file mode 100644 index 0000000..5c8e05d Binary files /dev/null and b/DEV3.1/TP2:Transitions/Changement.class differ diff --git a/DEV3.1/TP2:Transitions/Changement.java b/DEV3.1/TP2:Transitions/Changement.java new file mode 100644 index 0000000..f6accfa --- /dev/null +++ b/DEV3.1/TP2:Transitions/Changement.java @@ -0,0 +1,29 @@ +import java.awt.*; +import javax.swing.*; +import java.util.*; +import java.io.*; + +public class Changement{ + + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + InputStream file = loader.getResourceAsStream("Main.java"); + InputStream file2 = loader.getResourceAsStream("Listeimage.java"); + static public void fenetreCliquer(int LR){ + Main.fenetre.remove(Main.pan); + Main.pan.remove(Listeimage.liste[Listeimage.index]); + if (LR==1){ + Listeimage.index=Listeimage.index+1; + if(Listeimage.index>4){ + Listeimage.index=0; + } + }else { + Listeimage.index=Listeimage.index-1; + if(Listeimage.index<0){ + Listeimage.index=4; + } + } + Main.pan.add(Listeimage.liste[Listeimage.index]); + Main.fenetre.setContentPane(Main.pan); + Main.fenetre.repaint(); + } +} \ No newline at end of file diff --git a/DEV3.1/TP2:Transitions/Galerie.class b/DEV3.1/TP2:Transitions/Galerie.class new file mode 100644 index 0000000..fb14a7f Binary files /dev/null and b/DEV3.1/TP2:Transitions/Galerie.class differ diff --git a/DEV3.1/TP2:Transitions/Galerie/Galerie.java b/DEV3.1/TP2:Transitions/Galerie.java similarity index 79% rename from DEV3.1/TP2:Transitions/Galerie/Galerie.java rename to DEV3.1/TP2:Transitions/Galerie.java index 7585119..9260e69 100644 --- a/DEV3.1/TP2:Transitions/Galerie/Galerie.java +++ b/DEV3.1/TP2:Transitions/Galerie.java @@ -2,9 +2,13 @@ import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.util.*; +import java.io.*; public class Galerie extends JPanel implements MouseListener{ + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + InputStream file = loader.getResourceAsStream("Changement.java"); + public Galerie(){ super(); } diff --git a/DEV3.1/TP2:Transitions/Galerie/Changement.class b/DEV3.1/TP2:Transitions/Galerie/Changement.class deleted file mode 100644 index bdf31cf..0000000 Binary files a/DEV3.1/TP2:Transitions/Galerie/Changement.class and /dev/null differ diff --git a/DEV3.1/TP2:Transitions/Galerie/Changement.java b/DEV3.1/TP2:Transitions/Galerie/Changement.java deleted file mode 100644 index fd699ac..0000000 --- a/DEV3.1/TP2:Transitions/Galerie/Changement.java +++ /dev/null @@ -1,23 +0,0 @@ -import java.awt.*; -import javax.swing.*; -import java.util.*; - -public class Changement{ - - static public void fenetreCliquer(int LR){ - Main.pan.remove(Listeimage.liste[Listeimage.index]); - if (LR==1){ - Listeimage.index+=1; - if(Listeimage.index==-1){ - Listeimage.index=5; - } - }else { - Listeimage.index-=1; - if(Listeimage.index==6){ - Listeimage.index=0; - } - } - Main.pan.add(Listeimage.liste[Listeimage.index]); - Main.pan.repaint(); - } -} \ No newline at end of file diff --git a/DEV3.1/TP2:Transitions/Galerie/Galerie.class b/DEV3.1/TP2:Transitions/Galerie/Galerie.class deleted file mode 100644 index 9f50586..0000000 Binary files a/DEV3.1/TP2:Transitions/Galerie/Galerie.class and /dev/null differ diff --git a/DEV3.1/TP2:Transitions/Galerie/Listeimage.class b/DEV3.1/TP2:Transitions/Galerie/Listeimage.class deleted file mode 100644 index 72dd0d9..0000000 Binary files a/DEV3.1/TP2:Transitions/Galerie/Listeimage.class and /dev/null differ diff --git a/DEV3.1/TP2:Transitions/Galerie/Listeimage.java b/DEV3.1/TP2:Transitions/Galerie/Listeimage.java deleted file mode 100644 index 04c5d5b..0000000 --- a/DEV3.1/TP2:Transitions/Galerie/Listeimage.java +++ /dev/null @@ -1,15 +0,0 @@ -import java.awt.*; -import javax.swing.*; -import java.awt.event.*; -import java.util.*; - -public class Listeimage{ - - static JLabel image1 = new JLabel(new ImageIcon("image1.jpg")); - static JLabel image2 = new JLabel(new ImageIcon("image2.jpg")); - static JLabel image3 = new JLabel(new ImageIcon("image3.jpg")); - static JLabel image4 = new JLabel(new ImageIcon("image4.jpg")); - static JLabel image5 = new JLabel(new ImageIcon("image5.jpg")); - static JLabel[] liste = {image1, image2, image3, image4, image5}; - static int index=0; -} \ No newline at end of file diff --git a/DEV3.1/TP2:Transitions/Galerie/Main.class b/DEV3.1/TP2:Transitions/Galerie/Main.class deleted file mode 100644 index 6431783..0000000 Binary files a/DEV3.1/TP2:Transitions/Galerie/Main.class and /dev/null differ diff --git a/DEV3.1/TP2:Transitions/Listeimage.class b/DEV3.1/TP2:Transitions/Listeimage.class new file mode 100644 index 0000000..ad3f6c4 Binary files /dev/null and b/DEV3.1/TP2:Transitions/Listeimage.class differ diff --git a/DEV3.1/TP2:Transitions/Listeimage.java b/DEV3.1/TP2:Transitions/Listeimage.java new file mode 100644 index 0000000..1209bb6 --- /dev/null +++ b/DEV3.1/TP2:Transitions/Listeimage.java @@ -0,0 +1,18 @@ +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; +import java.util.*; +import java.io.*; + +public class Listeimage{ + + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + + static JLabel image1 = new JLabel(new ImageIcon("./img/image1.jpg")); + static JLabel image2 = new JLabel(new ImageIcon("./img/image2.jpg")); + static JLabel image3 = new JLabel(new ImageIcon("./img/image3.jpg")); + static JLabel image4 = new JLabel(new ImageIcon("./img/image4.jpg")); + static JLabel image5 = new JLabel(new ImageIcon("./img/image5.jpg")); + static JLabel[] liste = {image1, image2, image3, image4, image5}; + static int index=0; +} \ No newline at end of file diff --git a/DEV3.1/TP2:Transitions/Main.class b/DEV3.1/TP2:Transitions/Main.class new file mode 100644 index 0000000..5c4f015 Binary files /dev/null and b/DEV3.1/TP2:Transitions/Main.class differ diff --git a/DEV3.1/TP2:Transitions/Galerie/Main.java b/DEV3.1/TP2:Transitions/Main.java similarity index 68% rename from DEV3.1/TP2:Transitions/Galerie/Main.java rename to DEV3.1/TP2:Transitions/Main.java index 9dc9a82..c7742f3 100644 --- a/DEV3.1/TP2:Transitions/Galerie/Main.java +++ b/DEV3.1/TP2:Transitions/Main.java @@ -1,15 +1,18 @@ import java.awt.*; import javax.swing.*; import java.util.*; +import java.io.*; public class Main{ static JFrame fenetre = new JFrame(); static Galerie pan = new Galerie(); - + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + InputStream file = loader.getResourceAsStream("Galerie.java"); + public static void main(String[] args) { - pan.add(Listeimage.image1); + pan.add(Listeimage.liste[Listeimage.index]); fenetre.setSize(250, 250); fenetre.setLocation(250, 250); fenetre.addMouseListener(pan); diff --git a/DEV3.1/TP2:Transitions/Galerie/image1.jpg b/DEV3.1/TP2:Transitions/img/image1.jpg similarity index 100% rename from DEV3.1/TP2:Transitions/Galerie/image1.jpg rename to DEV3.1/TP2:Transitions/img/image1.jpg diff --git a/DEV3.1/TP2:Transitions/Galerie/image2.jpg b/DEV3.1/TP2:Transitions/img/image2.jpg similarity index 100% rename from DEV3.1/TP2:Transitions/Galerie/image2.jpg rename to DEV3.1/TP2:Transitions/img/image2.jpg diff --git a/DEV3.1/TP2:Transitions/Galerie/image3.jpg b/DEV3.1/TP2:Transitions/img/image3.jpg similarity index 100% rename from DEV3.1/TP2:Transitions/Galerie/image3.jpg rename to DEV3.1/TP2:Transitions/img/image3.jpg diff --git a/DEV3.1/TP2:Transitions/Galerie/image4.jpg b/DEV3.1/TP2:Transitions/img/image4.jpg similarity index 100% rename from DEV3.1/TP2:Transitions/Galerie/image4.jpg rename to DEV3.1/TP2:Transitions/img/image4.jpg diff --git a/DEV3.1/TP2:Transitions/Galerie/image5.jpg b/DEV3.1/TP2:Transitions/img/image5.jpg similarity index 100% rename from DEV3.1/TP2:Transitions/Galerie/image5.jpg rename to DEV3.1/TP2:Transitions/img/image5.jpg diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/Changement.class b/DEV3.1/TP4:OrganisationCode/Galerie/Changement.class new file mode 100644 index 0000000..5c8e05d Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/Changement.class differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/Changement.java b/DEV3.1/TP4:OrganisationCode/Galerie/Changement.java new file mode 100644 index 0000000..f6accfa --- /dev/null +++ b/DEV3.1/TP4:OrganisationCode/Galerie/Changement.java @@ -0,0 +1,29 @@ +import java.awt.*; +import javax.swing.*; +import java.util.*; +import java.io.*; + +public class Changement{ + + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + InputStream file = loader.getResourceAsStream("Main.java"); + InputStream file2 = loader.getResourceAsStream("Listeimage.java"); + static public void fenetreCliquer(int LR){ + Main.fenetre.remove(Main.pan); + Main.pan.remove(Listeimage.liste[Listeimage.index]); + if (LR==1){ + Listeimage.index=Listeimage.index+1; + if(Listeimage.index>4){ + Listeimage.index=0; + } + }else { + Listeimage.index=Listeimage.index-1; + if(Listeimage.index<0){ + Listeimage.index=4; + } + } + Main.pan.add(Listeimage.liste[Listeimage.index]); + Main.fenetre.setContentPane(Main.pan); + Main.fenetre.repaint(); + } +} \ No newline at end of file diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/Galerie.class b/DEV3.1/TP4:OrganisationCode/Galerie/Galerie.class new file mode 100644 index 0000000..fb14a7f Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/Galerie.class differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/Galerie.java b/DEV3.1/TP4:OrganisationCode/Galerie/Galerie.java new file mode 100644 index 0000000..9260e69 --- /dev/null +++ b/DEV3.1/TP4:OrganisationCode/Galerie/Galerie.java @@ -0,0 +1,36 @@ +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; +import java.util.*; +import java.io.*; + +public class Galerie extends JPanel implements MouseListener{ + + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + InputStream file = loader.getResourceAsStream("Changement.java"); + + public Galerie(){ + super(); + } + + public void mouseClicked(MouseEvent e){ + int x = e.getX(); + if (x <= this.getWidth()/5){ + Changement.fenetreCliquer(0); + }else if(x >= (this.getWidth()/5)*4){ + Changement.fenetreCliquer(1); + } + } + + public void mouseEntered(MouseEvent evenement){ + } + + public void mouseExited(MouseEvent evenement){ + } + + public void mousePressed(MouseEvent evenement){ + } + + public void mouseReleased(MouseEvent evenement){ + } +} diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/Listeimage.class b/DEV3.1/TP4:OrganisationCode/Galerie/Listeimage.class new file mode 100644 index 0000000..d7f0963 Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/Listeimage.class differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/Listeimage.java b/DEV3.1/TP4:OrganisationCode/Galerie/Listeimage.java new file mode 100644 index 0000000..b2ee998 --- /dev/null +++ b/DEV3.1/TP4:OrganisationCode/Galerie/Listeimage.java @@ -0,0 +1,23 @@ +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; +import java.util.*; +import java.io.*; + +public class Listeimage{ + + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + InputStream file = loader.getResourceAsStream("img/image1.jpg"); + InputStream file2 = loader.getResourceAsStream("img/image2.jpg"); + InputStream file3 = loader.getResourceAsStream("img/image3.jpg"); + InputStream file4 = loader.getResourceAsStream("img/image4.jpg"); + InputStream file5 = loader.getResourceAsStream("img/image5.jpg"); + + static JLabel image1 = new JLabel(new ImageIcon("./img/image1.jpg")); + static JLabel image2 = new JLabel(new ImageIcon("./img/image2.jpg")); + static JLabel image3 = new JLabel(new ImageIcon("./img/image3.jpg")); + static JLabel image4 = new JLabel(new ImageIcon("./img/image4.jpg")); + static JLabel image5 = new JLabel(new ImageIcon("./img/image5.jpg")); + static JLabel[] liste = {image1, image2, image3, image4, image5}; + static int index=0; +} \ No newline at end of file diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/Main.class b/DEV3.1/TP4:OrganisationCode/Galerie/Main.class new file mode 100644 index 0000000..7eda3c6 Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/Main.class differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/Main.java b/DEV3.1/TP4:OrganisationCode/Galerie/Main.java new file mode 100644 index 0000000..2ca8688 --- /dev/null +++ b/DEV3.1/TP4:OrganisationCode/Galerie/Main.java @@ -0,0 +1,25 @@ +import java.awt.*; +import javax.swing.*; +import java.util.*; +import java.io.*; + +public class Main{ + + static JFrame fenetre = new JFrame(); + static Galerie pan = new Galerie(); + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + InputStream file = loader.getResourceAsStream("Galerie.java"); + InputStream file2 = loader.getResourceAsStream("Listeimage.java"); + InputStream file3 = loader.getResourceAsStream("Changement.java"); + + public static void main(String[] args) { + + pan.add(Listeimage.liste[Listeimage.index]); + fenetre.setSize(250, 250); + fenetre.setLocation(250, 250); + fenetre.addMouseListener(pan); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + fenetre.setContentPane(pan); + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/galerie.jar b/DEV3.1/TP4:OrganisationCode/Galerie/galerie.jar new file mode 100644 index 0000000..a74d067 Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/galerie.jar differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/img/image1.jpg b/DEV3.1/TP4:OrganisationCode/Galerie/img/image1.jpg new file mode 100644 index 0000000..d402162 Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/img/image1.jpg differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/img/image2.jpg b/DEV3.1/TP4:OrganisationCode/Galerie/img/image2.jpg new file mode 100644 index 0000000..f0b6b06 Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/img/image2.jpg differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/img/image3.jpg b/DEV3.1/TP4:OrganisationCode/Galerie/img/image3.jpg new file mode 100644 index 0000000..b823066 Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/img/image3.jpg differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/img/image4.jpg b/DEV3.1/TP4:OrganisationCode/Galerie/img/image4.jpg new file mode 100644 index 0000000..939d686 Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/img/image4.jpg differ diff --git a/DEV3.1/TP4:OrganisationCode/Galerie/img/image5.jpg b/DEV3.1/TP4:OrganisationCode/Galerie/img/image5.jpg new file mode 100644 index 0000000..2f97128 Binary files /dev/null and b/DEV3.1/TP4:OrganisationCode/Galerie/img/image5.jpg differ