X-Git-Url: https://git.piment-noir.org/?p=TP_POO.git;a=blobdiff_plain;f=TP2%2FCercle.java;h=68e62891de11e4f2e1566a5130ab9c03c9450364;hp=4bf743ffdee026a698b25de263e8df57eaaaf3b6;hb=c7c510eb1829b97b642bd584a8737103b07efeb7;hpb=4871c009775e280dcbe246f706b54e6e2498ac2b diff --git a/TP2/Cercle.java b/TP2/Cercle.java index 4bf743f..68e6289 100644 --- a/TP2/Cercle.java +++ b/TP2/Cercle.java @@ -1,19 +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; } - void dessiner(Piletransformations pile) { - + public void dessiner(Piletransformations pile) { + String className = this.getClass().getSimpleName(); + Point pTrans = pile.getCurrentTransformation(); + Point pOriTrans = super.getpOri().additionner(pTrans); + System.out.println(className + " " + super.getpOri().toString() + "->" + pOriTrans.toString() + " " + rayon); } - void deplacer(Point p) { - + public void afficher() { + String className = this.getClass().getSimpleName(); + System.out.println("---- " + className + " ----"); + System.out.println(super.getpOri().toString() + " " + rayon); } - + }