update
This commit is contained in:
34
DEV/DEV2.1/CM1/Q4_Debut/ActionFenetre.java~
Normal file
34
DEV/DEV2.1/CM1/Q4_Debut/ActionFenetre.java~
Normal 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");
|
||||
}
|
||||
}
|
||||
BIN
DEV/DEV2.1/CM1/Q4_Debut/ActionSouris.class
Executable file
BIN
DEV/DEV2.1/CM1/Q4_Debut/ActionSouris.class
Executable file
Binary file not shown.
37
DEV/DEV2.1/CM1/Q4_Debut/ActionSouris.java
Normal file
37
DEV/DEV2.1/CM1/Q4_Debut/ActionSouris.java
Normal 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){
|
||||
}
|
||||
}
|
||||
37
DEV/DEV2.1/CM1/Q4_Debut/ActionSouris.java~
Normal file
37
DEV/DEV2.1/CM1/Q4_Debut/ActionSouris.java~
Normal 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){
|
||||
}
|
||||
}
|
||||
BIN
DEV/DEV2.1/CM1/Q4_Debut/Q4Main.class
Executable file
BIN
DEV/DEV2.1/CM1/Q4_Debut/Q4Main.class
Executable file
Binary file not shown.
22
DEV/DEV2.1/CM1/Q4_Debut/Q4Main.java
Normal file
22
DEV/DEV2.1/CM1/Q4_Debut/Q4Main.java
Normal 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);
|
||||
}
|
||||
}
|
||||
0
DEV/DEV2.1/CM1/Q4_Debut/Q4Main.java~
Normal file
0
DEV/DEV2.1/CM1/Q4_Debut/Q4Main.java~
Normal file
BIN
DEV/DEV2.1/CM1/Q4_Debut/Soleil.class
Executable file
BIN
DEV/DEV2.1/CM1/Q4_Debut/Soleil.class
Executable file
Binary file not shown.
23
DEV/DEV2.1/CM1/Q4_Debut/Soleil.java
Normal file
23
DEV/DEV2.1/CM1/Q4_Debut/Soleil.java
Normal 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);
|
||||
}
|
||||
}
|
||||
0
DEV/DEV2.1/CM1/Q4_Debut/Soleil.java~
Normal file
0
DEV/DEV2.1/CM1/Q4_Debut/Soleil.java~
Normal file
Reference in New Issue
Block a user