-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRectangulo.java
executable file
·55 lines (45 loc) · 1.11 KB
/
Rectangulo.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
55
package MP;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
import java.awt.geom.*;
public abstract class Rectangulo extends Figuras{
public int rxi, ryi, w, h;
public Rectangulo(){
}
public abstract void pintar(Graphics2D grafico, Color color, int a, Color color2,Lienzo l );
public void dimenciones (){
if (xi>xf){
if (yi>yf){
rxi = xf;
ryi = yf;
w = xi-xf;
h = yi-yf;
}
else{
rxi = xf;
ryi = yi;
w = xi-xf;
h = yf-yi;
}
}
else{
if (yi>yf){
rxi = xi;
ryi = yf;
w = xf-xi;
h = yi-yf;
}
else{
rxi = xi;
ryi = yi;
w = xf-xi;
h = yf-yi;
}
}
}
public String toString(){
return "Rectangulo";
}
}