-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodo.java
More file actions
58 lines (46 loc) · 1.01 KB
/
Nodo.java
File metadata and controls
58 lines (46 loc) · 1.01 KB
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
56
57
58
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class Nodo {
private int x, y, r;
boolean seleccionado = false;
boolean radio = false;
public static int d;
public Nodo(int x, int y) {
this.x = x;
this.y = y;
this.d = 120;
}
public Nodo(int x, int y, int r) {
this.x = x;
this.y = y;
this.r = r;
this.radio = true;
this.d = r * 2;
}
public void setPintado(boolean e) {
this.seleccionado = e;
}
public void pintar(Graphics g){
g.fillArc( this.x-10, this.y-10, 20, 20, 0, 360);
if(radio) {
g.setColor(Color.BLUE);
g.drawOval(this.x - d/2, this.y - d/2, d, d);
}
}
public static int getD() {
return d;
}
public int getX(){
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY(){
return y;
}
public void setY(int y) {
this.y = y;
}
}