diff --git a/Patrones2/src/paintables/Circle.java b/Patrones2/src/paintables/Circle.java index eafe41b..2805bf6 100644 --- a/Patrones2/src/paintables/Circle.java +++ b/Patrones2/src/paintables/Circle.java @@ -7,15 +7,14 @@ public class Circle extends PaintableBase { - public Circle(int x1, int y1, int x2, int y2) { - super(x1, y1, x2, y2); - } + public Circle(int x1, int y1, int x2, int y2) { + super(x1, y1, x2, y2); + } - // -------------------------------------------------------------------------------- - - @Override - public void draw(Graphics2D g2d) { - g2d.setColor(Color.BLACK); - g2d.drawOval(x1, y1, x2 - x1, y2 - y1); - } + // -------------------------------------------------------------------------------- + @Override + public void draw(Graphics2D g2d) { + g2d.setColor(Color.BLACK); + g2d.drawOval(x1, y1, x2 - x1, y2 - y1); + } } diff --git a/Patrones2/src/paintables/DrawnFace.java b/Patrones2/src/paintables/DrawnFace.java index 7a48b42..d413d16 100644 --- a/Patrones2/src/paintables/DrawnFace.java +++ b/Patrones2/src/paintables/DrawnFace.java @@ -46,6 +46,23 @@ public DrawnFace(int x1, int y1, int x2, int y2, int state) { x = (int) (x1 + (x2 - x1) * 0.55); paintableList.add(new Circle(x, y, x + w, y + h)); + + // ---------------------------------------- + // Pupila Ojo Izq + // ---------------------------------------- + x = (int) (x1 + (x2 - x1) * 0.27); + y = (int) (y1 + (y2 - y1) * 0.33); + w = (int) ((x1 + 15) - x1); + h = (int) ((y1 + 15) - y1); + paintableList.add(new Circle(x, y, x + w, y + h)); + + // ---------------------------------------- + // Pupila Ojo Der + // ---------------------------------------- + + x = (int) (x1 + (x2 - x1) * 0.63); + w = (int) ((x1 + 15) - x1); + paintableList.add(new Circle(x, y, x + w, y + w)); // ---------------------------------------- // Sonrisa diff --git a/Patrones2/src/tools/sad/SadPaintableFactory.java b/Patrones2/src/tools/sad/SadPaintableFactory.java index d96083c..27499dd 100644 --- a/Patrones2/src/tools/sad/SadPaintableFactory.java +++ b/Patrones2/src/tools/sad/SadPaintableFactory.java @@ -15,7 +15,7 @@ public Paintable create(int x1, int y1, int x2, int y2) { if (useImage) { return new SadImageFace(x1, y1, x2, y2); } else { - return new DrawnFace(x1, y1, x2, y2,SmileConstants.SMILE_UP); + return new DrawnFace(x1, y1, x2, y2,SmileConstants.SMILE_DW); //¿Qué pasa si le asigno un numero en lugar de SmileConstants.SMILE_UP? //¿Porqué no genera error? }