-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrame.pde
More file actions
75 lines (65 loc) · 2.3 KB
/
Copy pathFrame.pde
File metadata and controls
75 lines (65 loc) · 2.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
class Frame{
//Fields
Bead[] fmBeads;
int fmRows;
int fmCols;
int totalBeads;
color beadColorFm;
color[] storeBeadColor;
boolean frameMousePos;
//Constructor
Frame(int tempFmRows, int tempFmCols, int tempTotalBeads){
fmRows = tempFmRows;
fmCols = tempFmCols;
totalBeads = tempTotalBeads;
fmBeads = new Bead[totalBeads];
storeBeadColor = new color[totalBeads];
int index=0;
for(int y = 0; y < fmRows; y++){
for(int x = 0; x < fmCols; x++){
fmBeads[index++] = new Bead(x*BeadSize,y*BeadSize,BeadSize);
}
}
}
//Methods
//Main method for drawing a frame consisting of sets of beads
color[] drawFrame(color beadColorFmNew, int HeaderHeightTemp){
for(int i = 0; i < totalBeads; i++){
if(mousePressed &&
mouseX > fmBeads[i].xLocB + BeadSize &&
mouseX < fmBeads[i].xLocB + BeadSize + fmBeads[i].sizeB &&
mouseY > fmBeads[i].yLocB + BeadSize + HeaderHeightTemp &&
mouseY < fmBeads[i].yLocB + BeadSize + HeaderHeightTemp + fmBeads[i].sizeB){
beadColorFm = beadColorFmNew;
storeBeadColor[i] = fmBeads[i].drawBead(beadColorFm, HeaderHeightTemp);
}else if(Initialize){
beadColorFm = beadColorFmNew;
storeBeadColor[i] = fmBeads[i].drawBead(beadColorFm, HeaderHeightTemp);
}//End conditional
}//End loop
Initialize = false;
return storeBeadColor;
}//End drawFrame()
color[] drawFrameTrans(int HeaderHeightTemp){
for(int i = 0; i < totalBeads; i++){
if(headerState == "headerUp"){
storeBeadColor[i] = fmBeads[i].drawBead(storeBeadColor[i], HeaderHeightTemp);
}
}//End loop
noStroke();
return storeBeadColor;
}//End drawFrame()
void fmDrawBead(int HeaderHeightTemp){
for(int i = 0; i < totalBeads; i++){
//beadColorFm = beadColorFmNew;
fmBeads[i].drawBead(storeBeadColor[i], HeaderHeightTemp);
}
}
boolean frameMouse(int headerHeightTemp){
if(mouseX > BeadSize && mouseY > headerHeightTemp + BeadSize
&& mouseX < BeadSize * (Columns+1) && mouseY < headerHeightTemp + BeadSize * (Rows+1)){
frameMousePos = true;//Pass bead color from color picker to here
}
return frameMousePos;
}
}//End Frame class definition/////////////////////////////////////////////////////////////////