diff --git a/APL1.2/SCR1.2/TP15/tp15-reponses.txt b/APL1.2/SCR1.2/TP15/tp15-reponses.txt new file mode 100644 index 0000000..ad49775 --- /dev/null +++ b/APL1.2/SCR1.2/TP15/tp15-reponses.txt @@ -0,0 +1,7 @@ +1- C'est le fichier /etc/resolv.conf +2- dig -x 172.16.1.158 +II +1- tshark -i -f "host and not arp and port domain +4- L'affichage de dif flags qr aa rd ra quand le flag qr est à 1, nous sommes dans un message dns qui est une réponse +5 - par le flag aa +6 - ici un ttl de 1h a été communiqué pour le RR de type 1. Si le resolver grade cette donnée dans un cache, elle disparaitre du cadre au bout d'une heure \ No newline at end of file diff --git a/APL2.1/TP6/Acceuil/Accueil.class b/APL2.1/TP6/Acceuil/Accueil.class index 6f1a7ac..936fe52 100644 Binary files a/APL2.1/TP6/Acceuil/Accueil.class and b/APL2.1/TP6/Acceuil/Accueil.class differ diff --git a/APL2.1/TP6/Acceuil/Accueil.java b/APL2.1/TP6/Acceuil/Accueil.java index 771f9ce..18857e4 100644 --- a/APL2.1/TP6/Acceuil/Accueil.java +++ b/APL2.1/TP6/Acceuil/Accueil.java @@ -1,52 +1,47 @@ -import javax.swing.*; -import java.awt.*; + import java.awt.*; + import javax.swing.*; -public class Accueil extends JComponent{ - - private Image logScreen; - - public Accueil(){ - super(); - this.logScreen = Toolkit.getDefaultToolkit().getImage("logScreen.jpg"); - } - - @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()); + public class Accueil extends JComponent + { + private Image login; + public Accueil() + { + super(); + this.login = Toolkit.getDefaultToolkit().getImage("/export/home/an21/vieirae/APL/APL2.1/TP6/Acceuil/login.jpg"); + } + @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.drawImage(this.login, 0, 0, this.getWidth(), this.getHeight(), this); + } + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(300, 300); + fenetre.setLocation(100, 100); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + Accueil acc = new Accueil(); + + JTextField log = new JTextField(""); + log.setLocation(140, 140); + log.setSize(100, 25); + + JTextField mdp = new JTextField(""); + mdp.setLocation(140, 200); + mdp.setSize(100, 25); + + + fenetre.add(log); + fenetre.add(mdp); + fenetre.add(acc); + + fenetre.setVisible(true); } - secondPinceau.drawImage(this.logScreen,0,0, this); } - - public static void main(String[] args){ - - - JFrame fenetre = new JFrame(); - - fenetre.setSize(295, 223); - fenetre.setMinimumSize(new Dimension(295, 223)); - fenetre.setLocation(100, 100); - fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - fenetre.setLayout(null); - - - Accueil login = new Accueil(); - login.setLocation(0,0); - login.setSize(278,183); - fenetre.add(login); - - JTextField loginArea = new JTextField(); - loginArea.setLocation(110, 90); - loginArea.setSize(150, 25); - fenetre.add(loginArea); - - JTextField passwordArea = new JTextField(); - passwordArea.setLocation(110, 130); - passwordArea.setSize(150, 25); - fenetre.add(passwordArea); - - fenetre.setVisible(true); - } -} \ No newline at end of file diff --git a/APL2.1/TP6/Acceuil/login.jpg b/APL2.1/TP6/Acceuil/login.jpg new file mode 100644 index 0000000..139f222 Binary files /dev/null and b/APL2.1/TP6/Acceuil/login.jpg differ diff --git a/APL2.1/TP7/Moyenne/Main.java b/APL2.1/TP7/Moyenne/Main.java index e69de29..3372dca 100644 --- a/APL2.1/TP7/Moyenne/Main.java +++ b/APL2.1/TP7/Moyenne/Main.java @@ -0,0 +1,10 @@ +public class Main { + public static void main(String[] args) { + double nb1 = 5.5; + int nb2 = 5; + Moyenne moy = new Moyenne(); + moy.add(nb1); + moy.add(nb2); + System.out.println(moy.getAverage()); + } +} \ No newline at end of file diff --git a/APL2.1/TP7/PolyLigne/Etoile.class b/APL2.1/TP7/PolyLigne/Etoile.class index 606ae45..f419c49 100644 Binary files a/APL2.1/TP7/PolyLigne/Etoile.class and b/APL2.1/TP7/PolyLigne/Etoile.class differ diff --git a/APL2.1/TP7/PolyLigne/Etoile.java b/APL2.1/TP7/PolyLigne/Etoile.java index 0ad95e9..d35149f 100644 --- a/APL2.1/TP7/PolyLigne/Etoile.java +++ b/APL2.1/TP7/PolyLigne/Etoile.java @@ -1,25 +1,38 @@ -import java.awt.Point; -public class Etoile implements ProducteurDePoints { - private static final int xCentre = 100; - private static final int yCentre = 100; - private static final double rayon = 90.0; - private static final double angleDepart = Math.PI/4.0; - private static final double angleIncrement = (4.0*Math.PI)/5.0; - private double numero; - public Etoile() { - this.numero = 0.0; - } - public Point suivant() { - Point p = null; - if (this.numero < 6.0) { - double angle = Etoile.angleDepart+this.numero*Etoile.angleIncrement; - p = new Point((int) (Etoile.rayon*Math.cos(angle)), - (int) (Etoile.rayon*Math.sin(angle))); - p.translate(Etoile.xCentre, Etoile.yCentre); - this.numero++; - } else { - this.numero = 0.0; + import java.awt.Point; + import java.util.Objects; + + public class Etoile implements ProducteurDePoints { + private static final int xCentre = 100; + private static final int yCentre = 100; + private static final double rayon = 90.0; + private static final double angleDepart = Math.PI/4.0; + private static final double angleIncrement = (4.0*Math.PI)/5.0; + private double numero; + public Etoile() { + this.numero = 0.0; + } + public Point suivant() { + Point p = null; + if (this.numero < 6.0) { + double angle = Etoile.angleDepart+this.numero*Etoile.angleIncrement; + p = new Point((int) (Etoile.rayon*Math.cos(angle)), + (int) (Etoile.rayon*Math.sin(angle))); + p.translate(Etoile.xCentre, Etoile.yCentre); + this.numero++; + } else { + this.numero = 0.0; + } + return p; + } + + static public void main(String[] args) + { + Etoile e = new Etoile(); + Point p = e.suivant(); + while (!Objects.isNull(p)) + { + System.out.println("point: " + p); + p = e.suivant(); + } + } } - return p; - } -} \ No newline at end of file diff --git a/APL2.1/TP8/'y('(y b/APL2.1/TP8/'y('(y deleted file mode 100644 index 490de6b..0000000 --- a/APL2.1/TP8/'y('(y +++ /dev/null @@ -1 +0,0 @@ -gzegazeg \ No newline at end of file diff --git a/APL2.1/TP8/Fond.class b/APL2.1/TP8/Fond.class new file mode 100644 index 0000000..0f646dd Binary files /dev/null and b/APL2.1/TP8/Fond.class differ diff --git a/APL2.1/TP8/Fond.java b/APL2.1/TP8/Fond.java new file mode 100644 index 0000000..8ff3bc7 --- /dev/null +++ b/APL2.1/TP8/Fond.java @@ -0,0 +1,48 @@ + import java.awt.*; + import java.awt.event.*; + import javax.swing.*; + + public class Fond implements ActionListener + { + public static JButton bouton1, bouton2, bouton3; + private JPanel panneau; + public Fond() { + JFrame fenetre = new JFrame(); + fenetre.setSize(300, 300); + fenetre.setLocation(100, 100); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + panneau = new JPanel(); + bouton1 = new JButton("Cyan"); + bouton1.addActionListener(this); + bouton2 = new JButton("Magenta"); + bouton2.addActionListener(this); + bouton3 = new JButton("Jaune"); + bouton3.addActionListener(this); + panneau.add(bouton1); + panneau.add(bouton2); + panneau.add(bouton3); + fenetre.add(panneau); + fenetre.setVisible(true); + } + public void actionPerformed(ActionEvent e) + { + Object source = e.getSource(); + if (source == bouton1) + { + panneau.setBackground(Color.CYAN); + } + else if (source == bouton2) + { + panneau.setBackground(Color.MAGENTA); + } + else if (source == bouton3) + { + panneau.setBackground(Color.YELLOW); + } + panneau.repaint(); + } + public static void main(String[] args) + { + new Fond(); + } + }