fin
This commit is contained in:
BIN
DEV2.1/Dessin/Forme.class
Normal file
BIN
DEV2.1/Dessin/Forme.class
Normal file
Binary file not shown.
22
DEV2.1/Dessin/Forme.java
Normal file
22
DEV2.1/Dessin/Forme.java
Normal file
@@ -0,0 +1,22 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import formegeo.*;
|
||||
|
||||
public class Forme extends JComponent{
|
||||
public static void main(String[] args) {
|
||||
JFrame fenetre = new JFrame();
|
||||
fenetre.setSize(500, 300);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
GridLayout gestionnaire = new GridLayout(2, 2);
|
||||
fenetre.setLayout(gestionnaire);
|
||||
Carre carre = new Carre();
|
||||
Disque disque = new Disque();
|
||||
Texte texte = new Texte();
|
||||
Tag tag = new Tag();
|
||||
fenetre.add(carre);
|
||||
fenetre.add(disque);
|
||||
fenetre.add(texte);
|
||||
fenetre.add(tag);
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/Dessin/Sautoir.class
Normal file
BIN
DEV2.1/Dessin/Sautoir.class
Normal file
Binary file not shown.
19
DEV2.1/Dessin/Sautoir.java
Normal file
19
DEV2.1/Dessin/Sautoir.java
Normal file
@@ -0,0 +1,19 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import formesable.Sablier;
|
||||
|
||||
public class Sautoir {
|
||||
public static void main(String[] args) {
|
||||
JFrame fenetre = new JFrame();
|
||||
fenetre.setSize(500, 500);
|
||||
GridLayout gestionnaire = new GridLayout(5, 5);
|
||||
gestionnaire.setVgap(-15);
|
||||
fenetre.setLayout(gestionnaire);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
for (int i=0; i<25; i++){
|
||||
Sablier sablier = new Sablier();
|
||||
fenetre.add(sablier);
|
||||
}
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/Dessin/formegeo/Carre.class
Normal file
BIN
DEV2.1/Dessin/formegeo/Carre.class
Normal file
Binary file not shown.
13
DEV2.1/Dessin/formegeo/Carre.java
Normal file
13
DEV2.1/Dessin/formegeo/Carre.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package formegeo;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
|
||||
public class Carre extends JComponent {
|
||||
@Override
|
||||
public void paintComponent(Graphics pinceau) {
|
||||
Graphics secondPinceau = pinceau.create();
|
||||
secondPinceau.setColor(Color.BLUE);
|
||||
secondPinceau.drawRect(10,10,50, 50);
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/Dessin/formegeo/Disque.class
Normal file
BIN
DEV2.1/Dessin/formegeo/Disque.class
Normal file
Binary file not shown.
13
DEV2.1/Dessin/formegeo/Disque.java
Normal file
13
DEV2.1/Dessin/formegeo/Disque.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package formegeo;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
|
||||
public class Disque extends JComponent {
|
||||
@Override
|
||||
public void paintComponent(Graphics pinceau) {
|
||||
Graphics secondPinceau = pinceau.create();
|
||||
secondPinceau.setColor(Color.GREEN);
|
||||
secondPinceau.fillOval(10,10,50, 50);
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/Dessin/formegeo/Tag.class
Normal file
BIN
DEV2.1/Dessin/formegeo/Tag.class
Normal file
Binary file not shown.
21
DEV2.1/Dessin/formegeo/Tag.java
Normal file
21
DEV2.1/Dessin/formegeo/Tag.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package formegeo;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.*;
|
||||
|
||||
public class Tag extends JComponent {
|
||||
private Image cercle;
|
||||
public Tag() {
|
||||
super();
|
||||
this.cercle = Toolkit.getDefaultToolkit().getImage("formegeo/cercles.png");
|
||||
}
|
||||
@Override
|
||||
public 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.cercle, 10, 20, this);
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/Dessin/formegeo/Texte.class
Normal file
BIN
DEV2.1/Dessin/formegeo/Texte.class
Normal file
Binary file not shown.
17
DEV2.1/Dessin/formegeo/Texte.java
Normal file
17
DEV2.1/Dessin/formegeo/Texte.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package formegeo;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
|
||||
public class Texte extends JComponent {
|
||||
@Override
|
||||
public void paintComponent(Graphics pinceau) {
|
||||
Graphics secondPinceau = pinceau.create();
|
||||
if (this.isOpaque()) {
|
||||
secondPinceau.setColor(this.getBackground());
|
||||
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
}
|
||||
secondPinceau.setColor(Color.MAGENTA);
|
||||
secondPinceau.drawString(">o<", 10, 10);
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/Dessin/formegeo/cercles.png
Normal file
BIN
DEV2.1/Dessin/formegeo/cercles.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
DEV2.1/Dessin/formesable/Sablier.class
Normal file
BIN
DEV2.1/Dessin/formesable/Sablier.class
Normal file
Binary file not shown.
17
DEV2.1/Dessin/formesable/Sablier.java
Normal file
17
DEV2.1/Dessin/formesable/Sablier.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package formesable;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
|
||||
public class Sablier extends JComponent {
|
||||
@Override
|
||||
public void paintComponent(Graphics pinceau) {
|
||||
Graphics secondPinceau = pinceau.create();
|
||||
secondPinceau.setColor(Color.CYAN);
|
||||
int[] x = null;
|
||||
y = new int[] {90,0,0,90};
|
||||
int[] y = null;
|
||||
x = new int[] {100,0,100,0};
|
||||
secondPinceau.fillPolygon(x,y,4);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user