improved menu
This commit is contained in:
Binary file not shown.
@@ -1,8 +1,14 @@
|
|||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void initButtons() {
|
void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -13,6 +19,7 @@ void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -62,14 +69,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
boolean hover() {
|
boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void click() {
|
void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -78,9 +87,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = int(textWidth(label))+18;
|
w = int(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display() {
|
void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -88,13 +99,5 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,13 +73,11 @@ public void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
@@ -117,9 +115,15 @@ public void deleteAll() {
|
|||||||
}
|
}
|
||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
public void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void initButtons() {
|
public void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -130,6 +134,7 @@ public void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -179,14 +184,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
public boolean hover() {
|
public boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void click() {
|
public void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -195,9 +202,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = PApplet.parseInt(textWidth(label))+18;
|
w = PApplet.parseInt(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void display() {
|
public void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -205,15 +214,7 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
public void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
int linkCount;
|
int linkCount;
|
||||||
|
|
||||||
|
|||||||
@@ -57,13 +57,11 @@ void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
|
|||||||
Binary file not shown.
@@ -1,8 +1,14 @@
|
|||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void initButtons() {
|
void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -13,6 +19,7 @@ void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -62,14 +69,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
boolean hover() {
|
boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void click() {
|
void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -78,9 +87,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = int(textWidth(label))+18;
|
w = int(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display() {
|
void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -88,13 +99,5 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,13 +73,11 @@ public void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
@@ -117,9 +115,15 @@ public void deleteAll() {
|
|||||||
}
|
}
|
||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
public void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void initButtons() {
|
public void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -130,6 +134,7 @@ public void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -179,14 +184,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
public boolean hover() {
|
public boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void click() {
|
public void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -195,9 +202,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = PApplet.parseInt(textWidth(label))+18;
|
w = PApplet.parseInt(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void display() {
|
public void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -205,15 +214,7 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
public void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
int linkCount;
|
int linkCount;
|
||||||
|
|
||||||
|
|||||||
@@ -57,13 +57,11 @@ void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
|
|||||||
Binary file not shown.
@@ -1,8 +1,14 @@
|
|||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void initButtons() {
|
void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -13,6 +19,7 @@ void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -62,14 +69,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
boolean hover() {
|
boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void click() {
|
void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -78,9 +87,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = int(textWidth(label))+18;
|
w = int(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display() {
|
void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -88,13 +99,5 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,13 +73,11 @@ public void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
@@ -117,9 +115,15 @@ public void deleteAll() {
|
|||||||
}
|
}
|
||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
public void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void initButtons() {
|
public void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -130,6 +134,7 @@ public void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -179,14 +184,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
public boolean hover() {
|
public boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void click() {
|
public void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -195,9 +202,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = PApplet.parseInt(textWidth(label))+18;
|
w = PApplet.parseInt(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void display() {
|
public void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -205,15 +214,7 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
public void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
int linkCount;
|
int linkCount;
|
||||||
|
|
||||||
|
|||||||
@@ -57,13 +57,11 @@ void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
|
|||||||
Binary file not shown.
@@ -1,8 +1,14 @@
|
|||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void initButtons() {
|
void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -13,6 +19,7 @@ void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -62,14 +69,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
boolean hover() {
|
boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void click() {
|
void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -78,9 +87,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = int(textWidth(label))+18;
|
w = int(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display() {
|
void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -88,13 +99,5 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,13 +73,11 @@ public void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
@@ -117,9 +115,15 @@ public void deleteAll() {
|
|||||||
}
|
}
|
||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
public void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void initButtons() {
|
public void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -130,6 +134,7 @@ public void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -179,14 +184,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
public boolean hover() {
|
public boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void click() {
|
public void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -195,9 +202,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = PApplet.parseInt(textWidth(label))+18;
|
w = PApplet.parseInt(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void display() {
|
public void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -205,15 +214,7 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
public void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
int linkCount;
|
int linkCount;
|
||||||
|
|
||||||
|
|||||||
@@ -57,13 +57,11 @@ void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,14 @@
|
|||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void initButtons() {
|
void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -13,6 +19,7 @@ void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -62,14 +69,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
boolean hover() {
|
boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void click() {
|
void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -78,9 +87,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = int(textWidth(label))+18;
|
w = int(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display() {
|
void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -88,13 +99,5 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,13 +73,11 @@ public void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
@@ -117,9 +115,15 @@ public void deleteAll() {
|
|||||||
}
|
}
|
||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
public void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void initButtons() {
|
public void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -130,6 +134,7 @@ public void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -179,14 +184,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
public boolean hover() {
|
public boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void click() {
|
public void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -195,9 +202,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = PApplet.parseInt(textWidth(label))+18;
|
w = PApplet.parseInt(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void display() {
|
public void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -205,15 +214,7 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
public void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
int linkCount;
|
int linkCount;
|
||||||
|
|
||||||
|
|||||||
@@ -57,13 +57,11 @@ void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,14 @@
|
|||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void initButtons() {
|
void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -13,6 +19,7 @@ void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -62,14 +69,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
boolean hover() {
|
boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void click() {
|
void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -78,9 +87,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = int(textWidth(label))+18;
|
w = int(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void display() {
|
void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -88,13 +99,5 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,13 +73,11 @@ public void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
@@ -117,9 +115,15 @@ public void deleteAll() {
|
|||||||
}
|
}
|
||||||
int buttonCount = 8;
|
int buttonCount = 8;
|
||||||
int i_buttonId;
|
int i_buttonId;
|
||||||
|
boolean menuOpen = true;
|
||||||
|
int[] menuButtons = {2, 3, 4, 5, 6};
|
||||||
|
|
||||||
|
public void menu() {
|
||||||
|
menuOpen = !menuOpen;
|
||||||
|
for (int i = 0; i < menuButtons.length; i++) {
|
||||||
|
buttons[menuButtons[i]].active = menuOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void initButtons() {
|
public void initButtons() {
|
||||||
buttons[0] = new Button(72, 10, "Add Node");
|
buttons[0] = new Button(72, 10, "Add Node");
|
||||||
@@ -130,6 +134,7 @@ public void initButtons() {
|
|||||||
buttons[5] = new Button(10, 170, "Export Image");
|
buttons[5] = new Button(10, 170, "Export Image");
|
||||||
buttons[6] = new Button(10, 210, "Empty Workspace");
|
buttons[6] = new Button(10, 210, "Empty Workspace");
|
||||||
buttons[7] = new Button(10, 10, "Menu");
|
buttons[7] = new Button(10, 10, "Menu");
|
||||||
|
menu();
|
||||||
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
|
||||||
buttons[1] = new Button(155, 10, "Löschen");
|
buttons[1] = new Button(155, 10, "Löschen");
|
||||||
buttons[2] = new Button(10, 50, "Farben umkehren");
|
buttons[2] = new Button(10, 50, "Farben umkehren");
|
||||||
@@ -179,14 +184,16 @@ Button buttons[] = new Button[buttonCount];
|
|||||||
class Button {
|
class Button {
|
||||||
int id, x, y, w, h;
|
int id, x, y, w, h;
|
||||||
String label;
|
String label;
|
||||||
|
boolean active;
|
||||||
|
|
||||||
public boolean hover() {
|
public boolean hover() {
|
||||||
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
|
return (active) ? ((mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void click() {
|
public void click() {
|
||||||
buttonFunctions(id);
|
buttonFunctions(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button(int x_, int y_, String label_) {
|
Button(int x_, int y_, String label_) {
|
||||||
id = i_buttonId;
|
id = i_buttonId;
|
||||||
i_buttonId++;
|
i_buttonId++;
|
||||||
@@ -195,9 +202,11 @@ class Button {
|
|||||||
label = label_;
|
label = label_;
|
||||||
w = PApplet.parseInt(textWidth(label))+18;
|
w = PApplet.parseInt(textWidth(label))+18;
|
||||||
h = 32;
|
h = 32;
|
||||||
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void display() {
|
public void display() {
|
||||||
|
if (active) {
|
||||||
stroke(0);
|
stroke(0);
|
||||||
strokeWeight(1);
|
strokeWeight(1);
|
||||||
fill(255, 127);
|
fill(255, 127);
|
||||||
@@ -205,15 +214,7 @@ class Button {
|
|||||||
fill(0);
|
fill(0);
|
||||||
text(label, x+9, y+h/2+5);
|
text(label, x+9, y+h/2+5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean menuOpen;
|
|
||||||
|
|
||||||
public void menu() {
|
|
||||||
if (menuOpen) {
|
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
menuOpen = !menuOpen;
|
|
||||||
}
|
}
|
||||||
int linkCount;
|
int linkCount;
|
||||||
|
|
||||||
|
|||||||
@@ -57,13 +57,11 @@ void draw() {
|
|||||||
textAlign(CORNER);
|
textAlign(CORNER);
|
||||||
buttons[0].display();
|
buttons[0].display();
|
||||||
if (i_selectedNode != -1) buttons[1].display();
|
if (i_selectedNode != -1) buttons[1].display();
|
||||||
if (menuOpen) {
|
|
||||||
buttons[2].display();
|
buttons[2].display();
|
||||||
buttons[3].display();
|
buttons[3].display();
|
||||||
buttons[4].display();
|
buttons[4].display();
|
||||||
buttons[5].display();
|
buttons[5].display();
|
||||||
buttons[6].display();
|
buttons[6].display();
|
||||||
}
|
|
||||||
buttons[7].display();
|
buttons[7].display();
|
||||||
rectMode(CENTER);
|
rectMode(CENTER);
|
||||||
textAlign(CENTER);
|
textAlign(CENTER);
|
||||||
|
|||||||
Reference in New Issue
Block a user