update
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class Q3Main{
|
||||
public static void main(String[] args){
|
||||
JFrame fenetre = new JFrame();
|
||||
Tuile paterne = new Tuile("tuile.jpg");
|
||||
//GridLayout grille = new GridLayout(10, 10);
|
||||
//fenetre.setLayout(gestionnaire);
|
||||
fenetre.setSize(500, 500);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
fenetre.add(paterne);
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
BIN
DEV/DEV2.1/Controle_Machine_blanc/Q4_Modelisation/Q4Main.class
Normal file
BIN
DEV/DEV2.1/Controle_Machine_blanc/Q4_Modelisation/Q4Main.class
Normal file
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class Q4Main{
|
||||
public static void main(String[] args){
|
||||
JFrame fenetre = new JFrame();
|
||||
Tuile paterne = new Tuile("tuile.jpg");
|
||||
fenetre.setSize(500, 500);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
fenetre.add(paterne);
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class Q3Main{
|
||||
public static void main(String[] args){
|
||||
JFrame fenetre = new JFrame();
|
||||
Tuile paterne = new Tuile("tuile.jpg");
|
||||
fenetre.setSize(500, 500);
|
||||
fenetre.setLocation(0, 0);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
fenetre.add(paterne);
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
BIN
DEV/DEV2.1/Controle_Machine_blanc/Q4_Modelisation/Tuile.class
Normal file
BIN
DEV/DEV2.1/Controle_Machine_blanc/Q4_Modelisation/Tuile.class
Normal file
Binary file not shown.
28
DEV/DEV2.1/Controle_Machine_blanc/Q4_Modelisation/Tuile.java
Normal file
28
DEV/DEV2.1/Controle_Machine_blanc/Q4_Modelisation/Tuile.java
Normal file
@@ -0,0 +1,28 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Tuile extends JComponent {
|
||||
private Image texture;
|
||||
private int longueur;
|
||||
private int hauteur;
|
||||
|
||||
public Tuile(String cheminImage) {
|
||||
super();
|
||||
this.texture = Toolkit.getDefaultToolkit().getImage(cheminImage);
|
||||
this.longueur = 512;
|
||||
this.hauteur = 512;
|
||||
}
|
||||
@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());
|
||||
}
|
||||
for (int y=0; y<this.getHeight(); y+=this.hauteur){
|
||||
for (int x=0; x<this.getWidth(); x+=this.longueur){
|
||||
secondPinceau.drawImage(this.texture, x, y, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
DEV/DEV2.1/Controle_Machine_blanc/Q4_Modelisation/tuile.jpg
Normal file
BIN
DEV/DEV2.1/Controle_Machine_blanc/Q4_Modelisation/tuile.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Reference in New Issue
Block a user