-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNode.pde
More file actions
77 lines (60 loc) · 1.3 KB
/
Node.pde
File metadata and controls
77 lines (60 loc) · 1.3 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//Copyright 2005 Sean McCullough
//banksean at yahoo
public class Node {
Vector3D position;
float h = 20;
float w = 20;
String label = "";
Graph g;
int delayCounter=0;
public Node() {
position= new Vector3D();
}
public void setGraph(Graph h) {
g = h;
}
public void setLabel(String s) {
label = s;
}
public String getLabel(){
return label;
}
public void setDelayCounter(int theDelay){
delayCounter=theDelay;
}
public void reduceDelayCounter(){
if(delayCounter>0)
delayCounter--;
}
public boolean containsPoint(float x, float y) {
float dx = position.getX()-x;
float dy = position.getY()-y;
return (abs(dx) < w/0.2 && abs(dy)<h/0.2);
}
public Node(Vector3D v) {
position = v;
}
public Vector3D getPosition() {
return position;
}
public void setPosition(Vector3D v) {
position = v;
}
public void setXPosition(float X){
position.setX(X);
}
public void setYPosition(float Y){
position.setY(Y);
}
public float getX() {
return position.getX();
}
public float getY() {
return position.getY();
}
public void draw(float xOffset,float yOffset,float zoom,PFont font,boolean withText) {
stroke(0);
fill(255);
ellipse(getX(), getY(), h, w);
}
}