exo4: Add the code skeleton coming from TP2.
[Project_POO.git] / exo4 / Cercle.java
diff --git a/exo4/Cercle.java b/exo4/Cercle.java
new file mode 100644 (file)
index 0000000..68e6289
--- /dev/null
@@ -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);
+    }
+
+}