From c367c35d944c793b52c0c76b0c2b1081cece5334 Mon Sep 17 00:00:00 2001 From: stiti Date: Mon, 4 Mar 2024 15:06:25 +0100 Subject: [PATCH] Test --- BUT1/DEV2.1/TD/Td.java | 21 +++++++++++++ .../TP2-ComposantsGraphique/EXO4/exo4.java | 2 +- .../TP4-ClassesEtObjets/EXO1/compteur.java | 3 +- BUT1/DEV2.1/TP5-Heritage/EXO2 | 9 ------ BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class | Bin 0 -> 640 bytes BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java | 28 ++++++++++++++++++ BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java | 16 ++++++++++ BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class | Bin 0 -> 651 bytes BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.java | 20 +++++++++++++ 9 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 BUT1/DEV2.1/TD/Td.java delete mode 100644 BUT1/DEV2.1/TP5-Heritage/EXO2 create mode 100644 BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class create mode 100644 BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java create mode 100644 BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java create mode 100644 BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class create mode 100644 BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.java diff --git a/BUT1/DEV2.1/TD/Td.java b/BUT1/DEV2.1/TD/Td.java new file mode 100644 index 0000000..af1d874 --- /dev/null +++ b/BUT1/DEV2.1/TD/Td.java @@ -0,0 +1,21 @@ +public interface FileFilter{ + boolean accept(File f); +} + + +public class DirectoryFilter implements FileFilter{ + @Override + public boolean accept(File f){ + return f.isDirectory(); + } +} + +public class Exemple{ + public static void main(String[] args){ + File home = new File(System.getProperty("user.home")); + File[] liste = home.listFiles(new DirectoryFilter()); + for(File f : liste){ + System.out.println(f); + } + } +} \ No newline at end of file diff --git a/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java b/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java index 7947ca6..52b7ec9 100644 --- a/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java +++ b/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java @@ -7,7 +7,7 @@ public class exo4 { JFrame fenetre = new JFrame(); // on configure la fenetre - fenetre.setSize(1200, 1000); + fenetre.setPreferredSize(1200, 1000); fenetre.setLocation(100, 100); fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); diff --git a/BUT1/DEV2.1/TP4-ClassesEtObjets/EXO1/compteur.java b/BUT1/DEV2.1/TP4-ClassesEtObjets/EXO1/compteur.java index 533c24d..e666cef 100644 --- a/BUT1/DEV2.1/TP4-ClassesEtObjets/EXO1/compteur.java +++ b/BUT1/DEV2.1/TP4-ClassesEtObjets/EXO1/compteur.java @@ -15,4 +15,5 @@ public class compteur { return Integer.toBinaryString(this.compte); } -} \ No newline at end of file +} + diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO2 b/BUT1/DEV2.1/TP5-Heritage/EXO2 deleted file mode 100644 index 90e1d11..0000000 --- a/BUT1/DEV2.1/TP5-Heritage/EXO2 +++ /dev/null @@ -1,9 +0,0 @@ -import javax.swing.*; -import java.awt.*; - -public class Gris extends Color { - // Constructeurs - public Gris(int a){ - super(a,a,a); - } -} \ No newline at end of file diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class b/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class new file mode 100644 index 0000000000000000000000000000000000000000..a3da4aa7303290f280711d2d40e2927055ae5dd8 GIT binary patch literal 640 zcmZ8eT~8B16g|_HE?u_J(gM}`g(B{DDSh!pFeX}qsVQhuQ-eMYbR?tOU9#N@@n89} zO>E*1;P?1!JVP~#o6XGJuXE15_u}Wb?*N{nX(NNIg`9&q2$olg?WKxlXc!2o$2tT^>QzkLuJE)Z9o z5||^%ELL`~jEX>wvFGZ890y4|h(_wwsfuNyqfj8{Uh=K*^&-|I8&#|shKhx2|7&Qw*6=h6RhaC0 z|Cau7nl3jS+{dPXO|rfo>7#&+=G=E)pI18?&|2#1P#uhiM=E|JXYrxbY;o0nKZ6Y< zC)rD44wRY*){DmRvD(uHtYF&THp(fp%7vLP1CA3Fo)2hkAb07XZ`AAc3B*_W1YDkG z!Jteo4h48<{H}^VVq3f5$5B@0}KcAvBMfI?BKEdk#6g4JXKWJ{HsQb+n qx8M4?6!-peY!Vq*AcNUz5o_H0I!a_KW1F6bRQ(7mWcHbt!PYN`2Y)dD literal 0 HcmV?d00001 diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java b/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java new file mode 100644 index 0000000..5b0180b --- /dev/null +++ b/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java @@ -0,0 +1,28 @@ +import javax.swing.*; +import java.awt.*; + +public class Gris extends Color { + // Constructeurs + public Gris(int a){ + super(a,a,a); + } + + public static void main(String args[]){ + // Création d'une fenêtre + configuration + JFrame fenetre = new JFrame(); + fenetre.setSize(500, 500); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + // Création d'une variable de type couleur avec les données d'un gris + Color couleur = new Gris(120); + + // Création d'un panneau + ajout de la couleur de fond gris + JPanel panneau = new JPanel(); + panneau.setBackground(couleur); + // Ajout du panneau à la fenêtre + fenetre.add(panneau); + + // Affichage de la fenêtre + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java b/BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java new file mode 100644 index 0000000..cc39a9d --- /dev/null +++ b/BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java @@ -0,0 +1,16 @@ +public class PaperEnCm extends Paper { + + // Attributs + private double Width_A4 = 8.27; + private double Height_A4 = 11.69; + private double Margin = 0.590551; // 1.5 cm to inches + + // Constructeur + public PaperEnCm() { + Paper papier = new Paper(); + setSize(Width_A4, Height_A4); + setImageableArea(Margin, Margin,Width_A4,Height_A4); + } + + public double getMetric() +} diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class b/BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class new file mode 100644 index 0000000000000000000000000000000000000000..56d97b1af29aa39add8383ff4e521759c2947166 GIT binary patch literal 651 zcmZuuYj4vq6g_UUHp{Yg3v?Tg!5$3K1}J%a6^7M_pYvA2)u?qeh{RAc zR9;CX^=pQ*-{@6gGk6B{wUu8;g1tY?_*mF*80>Dr)liDeK^3lHTxO{Ioomixozb6z zM$aH>E>^L|u$c?}R(#<_qT5NDi=&CixR$A6u>5x>=dGJLKXN4!2c9W?{pMqb4@6>P zlVSfvRTSqc3galsm~LCNGujuL zGq7)TV0c2Sc?K*j!bgM71}add2=H=_YTsL&VW|^TrdXN7>(6le!yNU#w=u(=Zt!f1 qyPtw79t74DJJ+zaHz5+O1XjnHN3zYC2JC