Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix version.
[graphlib_java.git] / Exemple1.java
1 public class Exemple1 {
2
3     public static void main(String[] args) {
4         // Création de la fenêtre
5         DrawingWindow w = new DrawingWindow("Exemple 1", 640, 480);
6
7         // Affichage d'un ensemble de lignes, du centre de la fenêtre
8         // vers les bords
9         final int cx = w.width / 2;
10         final int cy = w.height / 2;
11         final int delta = 5;
12         for (int x = 0; x < w.width; x += delta) {
13             w.drawLine(cx, cy, x, 0);
14             w.drawLine(cx, cy, w.width - 1 - x, w.height - 1);
15         }
16         for (int y = 0; y < w.height; y += delta) {
17             w.drawLine(cx, cy, 0, w.height - 1 - y);
18             w.drawLine(cx, cy, w.width - 1, y);
19         }
20
21     }
22 }