From bd443eec8f09abab2d4ca1ceeb28268dd11854a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 14 Feb 2018 11:54:22 +0100 Subject: [PATCH] Add the abstract class Forme that Cercle and Segment extend. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TP2/Cercle.java | 2 +- TP2/Forme.java | 7 +++++++ TP2/Makefile | 1 + TP2/Segment.java | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 TP2/Forme.java diff --git a/TP2/Cercle.java b/TP2/Cercle.java index fe17b44..f13be69 100644 --- a/TP2/Cercle.java +++ b/TP2/Cercle.java @@ -1,5 +1,5 @@ -class Cercle { +class Cercle extends Forme { private Point pOri; private double rayon; diff --git a/TP2/Forme.java b/TP2/Forme.java new file mode 100644 index 0000000..df9fc44 --- /dev/null +++ b/TP2/Forme.java @@ -0,0 +1,7 @@ + +abstract class Forme { + + abstract public void dessiner(Piletransformations pile); + abstract public void deplacer(Point p); + +} diff --git a/TP2/Makefile b/TP2/Makefile index 40b372f..14f1b59 100644 --- a/TP2/Makefile +++ b/TP2/Makefile @@ -47,6 +47,7 @@ JVM = java CLASSES = \ Point.java \ + Forme.java \ Segment.java \ Cercle.java \ Piletransformations.java \ diff --git a/TP2/Segment.java b/TP2/Segment.java index e169172..25dc5e4 100644 --- a/TP2/Segment.java +++ b/TP2/Segment.java @@ -1,5 +1,5 @@ -class Segment { +class Segment extends Forme { private Point pOri; private Point pDest; -- 2.34.1