X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=exo4%2FCercle.java;fp=exo4%2FCercle.java;h=68e62891de11e4f2e1566a5130ab9c03c9450364;hb=c05c228927b2d9141cbc27e467e252e5e83263cf;hp=0000000000000000000000000000000000000000;hpb=01bad5b37bf95f027f583e1b1da607e074050651;p=Project_POO.git diff --git a/exo4/Cercle.java b/exo4/Cercle.java new file mode 100644 index 0000000..68e6289 --- /dev/null +++ b/exo4/Cercle.java @@ -0,0 +1,23 @@ + +class Cercle extends Forme { + private double rayon; + + Cercle(Point pO, double r) { + super(pO); + rayon = r; + } + + 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); + } + + public void afficher() { + String className = this.getClass().getSimpleName(); + System.out.println("---- " + className + " ----"); + System.out.println(super.getpOri().toString() + " " + rayon); + } + +}