Fix the Compactable implementation in Entiers and Listes classes.
[TP_POO.git] / TP2 / Cercle.java
index fe17b443d7d1d937ad322234b9cbc63a25030588..68e62891de11e4f2e1566a5130ab9c03c9450364 100644 (file)
@@ -1,22 +1,23 @@
 
-class Cercle {
-    private Point pOri;
+class Cercle extends Forme {
     private double rayon;
 
     Cercle(Point pO, double r) {
-        pOri = pO;
+        super(pO);
         rayon = r;
     }
 
     public void dessiner(Piletransformations pile) {
         String className = this.getClass().getSimpleName();
         Point pTrans = pile.getCurrentTransformation();
-        Point pOriTrans = pOri.additionner(pTrans);
-        System.out.println(className + " " + pOri.toString() + "->" + pOriTrans.toString() + " " + rayon);
+        Point pOriTrans = super.getpOri().additionner(pTrans);
+        System.out.println(className + " " + super.getpOri().toString() + "->" + pOriTrans.toString() + " " + rayon);
     }
 
-    public void deplacer(Point p) {
-        pOri = pOri.additionner(p);
+    public void afficher() {
+        String className = this.getClass().getSimpleName();
+        System.out.println("---- " + className + " ----");
+        System.out.println(super.getpOri().toString() + " " + rayon);
     }
 
 }