1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
public class NuagePoints {
ArrayList<Integer> p = new ArrayList<Integer>();
Point point = new Point();
private int x;
private int y;
public NuagePoints() {
x = 0;
y = 0;
}
/*
* Fonction qui dessine le point sur la surface 2D.
*/
public void dessiner(Graphics2D graph) {
Point p = new Point();
p.dessiner(graph); //fonction de la classe Point qui dessine les coordonnées x,y
}
/*
* Fonction qui obtient les coordonnées du point à partir d'un flot d'entiers
*/
public void lire(Scanner reader) {
while (reader.hasNextLine()) {
x = reader.nextInt();
y = reader.nextInt();
}
}
} |
Partager