repositories
/
TP_POO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TP2: Finally make all Affichable implemented classes uniform.
[TP_POO.git]
/
TP2
/
Cercle.java
diff --git
a/TP2/Cercle.java
b/TP2/Cercle.java
index f13be696a5bd3966dd1226c0de8a53524cd22fac..68e62891de11e4f2e1566a5130ab9c03c9450364 100644
(file)
--- a/
TP2/Cercle.java
+++ b/
TP2/Cercle.java
@@
-1,22
+1,23
@@
class Cercle extends Forme {
class Cercle extends Forme {
- private Point pOri;
private double rayon;
Cercle(Point pO, double r) {
private double rayon;
Cercle(Point pO, double r) {
-
pOri = pO
;
+
super(pO)
;
rayon = r;
}
public void dessiner(Piletransformations pile) {
String className = this.getClass().getSimpleName();
Point pTrans = pile.getCurrentTransformation();
rayon = r;
}
public void dessiner(Piletransformations pile) {
String className = this.getClass().getSimpleName();
Point pTrans = pile.getCurrentTransformation();
- Point pOriTrans =
pOri
.additionner(pTrans);
- System.out.println(className + " " +
pOri
.toString() + "->" + pOriTrans.toString() + " " + rayon);
+ Point pOriTrans =
super.getpOri()
.additionner(pTrans);
+ System.out.println(className + " " +
super.getpOri()
.toString() + "->" + pOriTrans.toString() + " " + rayon);
}
}
- public void deplacer(Point p) {
- pOri = pOri.additionner(p);
+ public void afficher() {
+ String className = this.getClass().getSimpleName();
+ System.out.println("---- " + className + " ----");
+ System.out.println(super.getpOri().toString() + " " + rayon);
}
}
}
}