X-Git-Url: https://git.llucax.com/z.facultad/75.62/c2tp1.git/blobdiff_plain/a029fc8ee6d45bf165aaa8469cea034cc8e45c22..HEAD:/src/Angulo.java diff --git a/src/Angulo.java b/src/Angulo.java index 2abe424..61a8d44 100644 --- a/src/Angulo.java +++ b/src/Angulo.java @@ -1,19 +1,6 @@ +import java.util.*; -interface OperAng { - - public Angulo mas(Angulo f); - - public Angulo menos(Angulo f); - -} - -interface ComparaAng { - - public int compareTo(Angulo f); - -} - -class Angulo implements OperAng, ComparaAng { +public class Angulo extends Observable implements OperAng, ComparaAng { private int signo; private int grados; @@ -41,19 +28,27 @@ class Angulo implements OperAng, ComparaAng { signo = -1; else signo = 1; + setChanged (); + notifyObservers (); } public void setGrados(int g) { setSigno(g); grados = Math.abs(g % 360); + setChanged (); + notifyObservers (); } public void setMinutos(int m) { minutos = Math.abs(m % 60); + setChanged (); + notifyObservers (); } public void setSegundos(int s) { segundos = Math.abs(s % 60); + setChanged (); + notifyObservers (); } public Angulo() {