Commit 31a46d65 authored by Baptiste Fournier's avatar Baptiste Fournier

removed old files after refactor

parent e7865f3e
import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;
import java.awt.*;
public class GestionClavier implements KeyListener {
MonDessin localdessin ;
public GestionClavier(MonDessin dessin) {
localdessin = dessin;
}
public void keyPressed(KeyEvent e){
}
public void keyReleased(KeyEvent e){
char pressedKey = e.getKeyChar();
if (pressedKey == 'r'){
localdessin.changeColor(Color.red);
}
else if (pressedKey == 'o'){
localdessin.changeColor(Color.orange);
}
else if (pressedKey == 'v'){
localdessin.changeColor(Color.green);
}
}
public void keyTyped(KeyEvent e){
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.image.*;
import javax.imageio.*;
import java.io.*;
public class MonDessin extends JPanel {
Image myImage;
BufferedImage img = null;
Color rectangleColor = Color.red;
public MonDessin() {
try {
img = ImageIO.read(new File("logo-CS-blanc.png"));
} catch (IOException e) {
}
}
public void changeColor(Color newcolor){
rectangleColor = newcolor;
this.repaint();
}
public MonDessin(LayoutManager layout) {
super(layout);
// TODO Auto-generated constructor stub
}
public MonDessin(boolean isDoubleBuffered) {
super(isDoubleBuffered);
// TODO Auto-generated constructor stub
}
public MonDessin(LayoutManager layout, boolean isDoubleBuffered) {
super(layout, isDoubleBuffered);
// TODO Auto-generated constructor stub
}
}
......@@ -9,6 +9,7 @@ public class MonControleur {
MonImage image;
public MonControleur() {
couleur = new MaCouleur();
image = new MonImage();
}
public void changeColor(Color color){
......
package entity;
import javax.swing.*;
import java.awt.*;
......
......@@ -13,12 +13,15 @@ public class MonImage {
public MonImage(String path) {
try {
img = ImageIO.read(new File(path));
img = ImageIO.read(new File(path));
} catch (IOException e) {
}
}
public MonImage(){
}
public BufferedImage get(){
return img;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment