X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=exo4%2FCercle.java;fp=exo4%2FCercle.java;h=ba4e103e8ff5670294aea770fccd2ef67343dd8c;hb=6e9d7383782604a43e73e50a66a805dbf3205781;hp=0000000000000000000000000000000000000000;hpb=2b29b63e80b9df1d9dfeb952a804a1dd4c3fa3bf;p=Project_POO.git diff --git a/exo4/Cercle.java b/exo4/Cercle.java new file mode 100644 index 0000000..ba4e103 --- /dev/null +++ b/exo4/Cercle.java @@ -0,0 +1,27 @@ + +@ClassPreamble ( + author = "Jérôme Benoit", + date = "01/03/2001" +) +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); + } + +}