Add the abstract class Forme that Cercle and Segment extend.
[TP_POO.git] / TP2 / Cercle.java
1
2 class Cercle extends Forme {
3 private Point pOri;
4 private double rayon;
5
6 Cercle(Point pO, double r) {
7 pOri = pO;
8 rayon = r;
9 }
10
11 public void dessiner(Piletransformations pile) {
12 String className = this.getClass().getSimpleName();
13 Point pTrans = pile.getCurrentTransformation();
14 Point pOriTrans = pOri.additionner(pTrans);
15 System.out.println(className + " " + pOri.toString() + "->" + pOriTrans.toString() + " " + rayon);
16 }
17
18 public void deplacer(Point p) {
19 pOri = pOri.additionner(p);
20 }
21
22 }