-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCuadro.java
54 lines (41 loc) · 1017 Bytes
/
Cuadro.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import java.awt.Color;
public class Cuadro{
private Color color;
private int x,
y,
side;
public Cuadro(int x, int y){
this(x, y, 50);
}
public Cuadro(int x, int y, int size){
this.color = Color.decode("#F0DEC8"); //color cuadro
//Agregar imagen de cuadro
this.x = x;
this.y = y;
this.side = size;
}
public Color getColor(){
return this.color;
}
public void setColor(String color){
this.color = Color.decode(color);
}
public int getX(){
return this.x;
}
public int getY(){
return this.y;
}
public int getSide(){
return this.side;
}
}
class Pared extends Cuadro{
public Pared(int x, int y) {
this(x, y, 50);
}
public Pared(int x, int y, int size){
super(x, y, size);
this.setColor("#008000"); //color pared
}
}