This commit is contained in:
2023-10-23 13:23:36 +02:00
parent 667dae6f1a
commit 322b22f9bf
5711 changed files with 72953 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ActionFenetre implements WindowListener{
private JFrame fenetre;
ActionFenetre(JFrame fenetre){
this.fenetre = fenetre;
}
@Override
public void windowActivated(WindowEvent evenement){
}
@Override
public void windowClosed(WindowEvent evenement){
}
@Override
public void windowClosing(WindowEvent evenement){
}
@Override
public void windowDeactivated(WindowEvent evenement){
}
@Override
public void windowDeiconified(WindowEvent evenement){
}
@Override
public void windowIconified(WindowEvent evenement){
this.fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
@Override
public void windowOpened(WindowEvent evenement){
System.out.println("Edouard");
}
}

Binary file not shown.

View File

@@ -0,0 +1,37 @@
//Wamster Alexis
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ActionSouris implements MouseListener{
private JFrame fenetre;
private int rayon;
public ActionSouris(JFrame fenetre, int rayon){
this.fenetre = fenetre;
this.rayon = rayon;
}
public int RecupereRayon(){
return this.rayon;
}
@Override
public void mouseClicked(MouseEvent e){
this.rayon += 15;
fenetre.repaint();
}
@Override
public void mouseEntered(MouseEvent e){
}
@Override
public void mouseExited(MouseEvent e){
}
@Override
public void mousePressed(MouseEvent e){
}
@Override
public void mouseReleased(MouseEvent e){
}
}

View File

@@ -0,0 +1,37 @@
//Wamster Alexis
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ActionSouris implements MouseListener{
private JFrame fenetre;
private int rayon;
public ActionSouris(JFrame fenetre, int rayon){
this.fenetre = fenetre;
this.rayon = rayon;
}
public int RecupereRayon(){
return this.rayon;
}
@Override
public void mouseClicked(MouseEvent e){
this.rayon += 15;
repaint();
}
@Override
public void mouseEntered(MouseEvent e){
}
@Override
public void mouseExited(MouseEvent e){
}
@Override
public void mousePressed(MouseEvent e){
}
@Override
public void mouseReleased(MouseEvent e){
}
}

Binary file not shown.

View File

@@ -0,0 +1,22 @@
//Wamster Alexis
import javax.swing.*;
import java.awt.*;
public class Q4Main{
public static void main(String[] args) {
JFrame fenetre = new JFrame("Directions");
fenetre.setSize(300, 200);
fenetre.setLocation(700, 300);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.setBackground(new Color(115,194,251));
ActionSouris detectClic = new ActionSouris(fenetre, 60);
fenetre.addMouseListener(detectClic);
Soleil dessinSoleil = new Soleil(detectClic);
fenetre.add(dessinSoleil);
fenetre.setVisible(true);
}
}

View File

Binary file not shown.

View File

@@ -0,0 +1,23 @@
//Wamster Alexis
import javax.swing.JComponent;
import java.awt.*;
public class Soleil extends JComponent {
private ActionSouris detectClic;
public Soleil(ActionSouris detectClic){
this.detectClic = detectClic;
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
secondPinceau.setColor(new Color(115,194,251));
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
int rayon = detectClic.RecupereRayon();
secondPinceau.setColor(Color.YELLOW);
secondPinceau.fillOval(this.getWidth()/2-rayon,this.getHeight()-rayon, rayon*2, rayon*2);
}
}

View File