Skip to content

Commit

Permalink
#4 Se realiza el punto número 1
Browse files Browse the repository at this point in the history
Se completo el diagrama vectorial del Proyecto de patrones 2, se agrego la pupila del ojo.
  • Loading branch information
jocastaneda5 committed Oct 31, 2017
1 parent fe1df34 commit 74b1987
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
19 changes: 9 additions & 10 deletions Patrones2/src/paintables/Circle.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
17 changes: 17 additions & 0 deletions Patrones2/src/paintables/DrawnFace.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Patrones2/src/tools/sad/SadPaintableFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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?
}
Expand Down

0 comments on commit 74b1987

Please sign in to comment.