This commit is contained in:
2024-03-18 13:54:22 +01:00
parent eb581c8a31
commit a28bef01d7
69 changed files with 855 additions and 5 deletions

Binary file not shown.

View 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);
}
}

Binary file not shown.

View 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);
}
}

Binary file not shown.

View 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);
}
}

Binary file not shown.

View 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);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB