Browse Source

added menu, added clear workspace function, buttons file now gui file

Signed-off-by: Victor Giers <vgiers@web.de>
master
Victor Giers 4 years ago
parent
commit
20f07335c2
51 changed files with 935 additions and 759 deletions
  1. 0
    41
      build/application.linux-arm64/data/save.csv
  2. BIN
      build/application.linux-arm64/lib/ontology.jar
  3. 31
    9
      build/application.linux-arm64/source/gui.pde
  4. 56
    28
      build/application.linux-arm64/source/ontology.java
  5. 23
    5
      build/application.linux-arm64/source/ontology.pde
  6. 1
    11
      build/application.linux-arm64/source/save_load.pde
  7. 1
    0
      build/application.linux-arm64/source/ui.pde
  8. 0
    41
      build/application.linux-armv6hf/data/save.csv
  9. BIN
      build/application.linux-armv6hf/lib/ontology.jar
  10. 31
    9
      build/application.linux-armv6hf/source/gui.pde
  11. 56
    28
      build/application.linux-armv6hf/source/ontology.java
  12. 23
    5
      build/application.linux-armv6hf/source/ontology.pde
  13. 1
    11
      build/application.linux-armv6hf/source/save_load.pde
  14. 1
    0
      build/application.linux-armv6hf/source/ui.pde
  15. 0
    41
      build/application.linux32/data/save.csv
  16. BIN
      build/application.linux32/lib/ontology.jar
  17. 31
    9
      build/application.linux32/source/gui.pde
  18. 56
    28
      build/application.linux32/source/ontology.java
  19. 23
    5
      build/application.linux32/source/ontology.pde
  20. 1
    11
      build/application.linux32/source/save_load.pde
  21. 1
    0
      build/application.linux32/source/ui.pde
  22. 0
    41
      build/application.linux64/data/save.csv
  23. BIN
      build/application.linux64/lib/ontology.jar
  24. 31
    9
      build/application.linux64/source/gui.pde
  25. 56
    28
      build/application.linux64/source/ontology.java
  26. 23
    5
      build/application.linux64/source/ontology.pde
  27. 1
    11
      build/application.linux64/source/save_load.pde
  28. 1
    0
      build/application.linux64/source/ui.pde
  29. 0
    41
      build/application.windows32/data/save.csv
  30. BIN
      build/application.windows32/lib/ontology.jar
  31. BIN
      build/application.windows32/ontology.exe
  32. 0
    78
      build/application.windows32/source/buttons.pde
  33. 100
    0
      build/application.windows32/source/gui.pde
  34. 56
    28
      build/application.windows32/source/ontology.java
  35. 23
    5
      build/application.windows32/source/ontology.pde
  36. 1
    11
      build/application.windows32/source/save_load.pde
  37. 1
    0
      build/application.windows32/source/ui.pde
  38. 0
    41
      build/application.windows64/data/save.csv
  39. BIN
      build/application.windows64/lib/ontology.jar
  40. BIN
      build/application.windows64/ontology.exe
  41. 0
    78
      build/application.windows64/source/buttons.pde
  42. 100
    0
      build/application.windows64/source/gui.pde
  43. 56
    28
      build/application.windows64/source/ontology.java
  44. 23
    5
      build/application.windows64/source/ontology.pde
  45. 1
    11
      build/application.windows64/source/save_load.pde
  46. 1
    0
      build/application.windows64/source/ui.pde
  47. 0
    41
      data/save.csv
  48. 100
    0
      gui.pde
  49. 23
    5
      ontology.pde
  50. 1
    11
      save_load.pde
  51. 1
    0
      ui.pde

+ 0
- 41
build/application.linux-arm64/data/save.csv View File

@@ -1,43 +1,2 @@































Biological Process,395,537,32,33
Physiological Process,292,455,34
Cellular Process,483,455,34
Cellular Physiological Process,391,375,36,35
Cell Cycle,305,296,40,41
Cell Division,544,265,37
Cytokinesis,543,165,38
Cytokinesis after Meiosis,399,54
M Phase of Meiotic Cell Cycle,310,144,38
M Phase,239,225,39
Meiotic Cell Cycle,392,225,39


BIN
build/application.linux-arm64/lib/ontology.jar View File


build/application.linux-arm64/source/buttons.pde → build/application.linux-arm64/source/gui.pde View File

@@ -1,19 +1,26 @@
int buttonCount = 6;
int buttonCount = 8;
int i_buttonId;




void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

void buttonFunctions(int functionID) {
@@ -38,6 +45,12 @@ void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -76,3 +89,12 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}

+ 56
- 28
build/application.linux-arm64/source/ontology.java View File

@@ -23,11 +23,12 @@ boolean darkMode = true;
public void setup() {
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -72,10 +73,14 @@ public void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -97,22 +102,42 @@ public void draw() {
}
}
}
int buttonCount = 6;

public void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}
int buttonCount = 8;
int i_buttonId;




public void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

public void buttonFunctions(int functionID) {
@@ -137,6 +162,12 @@ public void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -175,6 +206,15 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

public void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}
int linkCount;

boolean dragLink; //state of dragging a link
@@ -364,7 +404,6 @@ class Node {
text(title, x, y+textSize/3);
}
}

/**
* Saving and loading is a messy hack!
* You'll get a blank line in your save file for each deleted object.
@@ -390,17 +429,7 @@ public void loadCSVFile(File selection) {
}

public void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {
@@ -439,12 +468,12 @@ public void saveCSV(String path) {
String[] saveArray = split(saveString, '\n');
saveStrings(path, saveArray);
}

/**
* Keys only get caught for changing a nodes title.
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

public void keyPressed() {
if (key == ESC) {
key = 0;
@@ -564,7 +593,6 @@ public void mouseWheel(MouseEvent event) {
nodes[i].setVectors();
}
}

public void settings() { size(800, 600); }
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "ontology" };

+ 23
- 5
build/application.linux-arm64/source/ontology.pde View File

@@ -7,11 +7,12 @@ boolean darkMode = true;
void setup() {
size(800, 600);
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -56,10 +57,14 @@ void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -81,3 +86,16 @@ void draw() {
}
}
}

void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}

+ 1
- 11
build/application.linux-arm64/source/save_load.pde View File

@@ -23,17 +23,7 @@ void loadCSVFile(File selection) {
}

void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {

+ 1
- 0
build/application.linux-arm64/source/ui.pde View File

@@ -3,6 +3,7 @@
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

void keyPressed() {
if (key == ESC) {
key = 0;

+ 0
- 41
build/application.linux-armv6hf/data/save.csv View File

@@ -1,43 +1,2 @@































Biological Process,395,537,32,33
Physiological Process,292,455,34
Cellular Process,483,455,34
Cellular Physiological Process,391,375,36,35
Cell Cycle,305,296,40,41
Cell Division,544,265,37
Cytokinesis,543,165,38
Cytokinesis after Meiosis,399,54
M Phase of Meiotic Cell Cycle,310,144,38
M Phase,239,225,39
Meiotic Cell Cycle,392,225,39


BIN
build/application.linux-armv6hf/lib/ontology.jar View File


build/application.linux-armv6hf/source/buttons.pde → build/application.linux-armv6hf/source/gui.pde View File

@@ -1,19 +1,26 @@
int buttonCount = 6;
int buttonCount = 8;
int i_buttonId;




void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

void buttonFunctions(int functionID) {
@@ -38,6 +45,12 @@ void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -76,3 +89,12 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}

+ 56
- 28
build/application.linux-armv6hf/source/ontology.java View File

@@ -23,11 +23,12 @@ boolean darkMode = true;
public void setup() {
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -72,10 +73,14 @@ public void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -97,22 +102,42 @@ public void draw() {
}
}
}
int buttonCount = 6;

public void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}
int buttonCount = 8;
int i_buttonId;




public void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

public void buttonFunctions(int functionID) {
@@ -137,6 +162,12 @@ public void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -175,6 +206,15 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

public void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}
int linkCount;

boolean dragLink; //state of dragging a link
@@ -364,7 +404,6 @@ class Node {
text(title, x, y+textSize/3);
}
}

/**
* Saving and loading is a messy hack!
* You'll get a blank line in your save file for each deleted object.
@@ -390,17 +429,7 @@ public void loadCSVFile(File selection) {
}

public void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {
@@ -439,12 +468,12 @@ public void saveCSV(String path) {
String[] saveArray = split(saveString, '\n');
saveStrings(path, saveArray);
}

/**
* Keys only get caught for changing a nodes title.
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

public void keyPressed() {
if (key == ESC) {
key = 0;
@@ -564,7 +593,6 @@ public void mouseWheel(MouseEvent event) {
nodes[i].setVectors();
}
}

public void settings() { size(800, 600); }
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "ontology" };

+ 23
- 5
build/application.linux-armv6hf/source/ontology.pde View File

@@ -7,11 +7,12 @@ boolean darkMode = true;
void setup() {
size(800, 600);
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -56,10 +57,14 @@ void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -81,3 +86,16 @@ void draw() {
}
}
}

void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}

+ 1
- 11
build/application.linux-armv6hf/source/save_load.pde View File

@@ -23,17 +23,7 @@ void loadCSVFile(File selection) {
}

void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {

+ 1
- 0
build/application.linux-armv6hf/source/ui.pde View File

@@ -3,6 +3,7 @@
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

void keyPressed() {
if (key == ESC) {
key = 0;

+ 0
- 41
build/application.linux32/data/save.csv View File

@@ -1,43 +1,2 @@































Biological Process,395,537,32,33
Physiological Process,292,455,34
Cellular Process,483,455,34
Cellular Physiological Process,391,375,36,35
Cell Cycle,305,296,40,41
Cell Division,544,265,37
Cytokinesis,543,165,38
Cytokinesis after Meiosis,399,54
M Phase of Meiotic Cell Cycle,310,144,38
M Phase,239,225,39
Meiotic Cell Cycle,392,225,39


BIN
build/application.linux32/lib/ontology.jar View File


build/application.linux32/source/buttons.pde → build/application.linux32/source/gui.pde View File

@@ -1,19 +1,26 @@
int buttonCount = 6;
int buttonCount = 8;
int i_buttonId;




void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

void buttonFunctions(int functionID) {
@@ -38,6 +45,12 @@ void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -76,3 +89,12 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}

+ 56
- 28
build/application.linux32/source/ontology.java View File

@@ -23,11 +23,12 @@ boolean darkMode = true;
public void setup() {
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -72,10 +73,14 @@ public void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -97,22 +102,42 @@ public void draw() {
}
}
}
int buttonCount = 6;

public void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}
int buttonCount = 8;
int i_buttonId;




public void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

public void buttonFunctions(int functionID) {
@@ -137,6 +162,12 @@ public void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -175,6 +206,15 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

public void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}
int linkCount;

boolean dragLink; //state of dragging a link
@@ -364,7 +404,6 @@ class Node {
text(title, x, y+textSize/3);
}
}

/**
* Saving and loading is a messy hack!
* You'll get a blank line in your save file for each deleted object.
@@ -390,17 +429,7 @@ public void loadCSVFile(File selection) {
}

public void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {
@@ -439,12 +468,12 @@ public void saveCSV(String path) {
String[] saveArray = split(saveString, '\n');
saveStrings(path, saveArray);
}

/**
* Keys only get caught for changing a nodes title.
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

public void keyPressed() {
if (key == ESC) {
key = 0;
@@ -564,7 +593,6 @@ public void mouseWheel(MouseEvent event) {
nodes[i].setVectors();
}
}

public void settings() { size(800, 600); }
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "ontology" };

+ 23
- 5
build/application.linux32/source/ontology.pde View File

@@ -7,11 +7,12 @@ boolean darkMode = true;
void setup() {
size(800, 600);
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -56,10 +57,14 @@ void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -81,3 +86,16 @@ void draw() {
}
}
}

void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}

+ 1
- 11
build/application.linux32/source/save_load.pde View File

@@ -23,17 +23,7 @@ void loadCSVFile(File selection) {
}

void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {

+ 1
- 0
build/application.linux32/source/ui.pde View File

@@ -3,6 +3,7 @@
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

void keyPressed() {
if (key == ESC) {
key = 0;

+ 0
- 41
build/application.linux64/data/save.csv View File

@@ -1,43 +1,2 @@































Biological Process,395,537,32,33
Physiological Process,292,455,34
Cellular Process,483,455,34
Cellular Physiological Process,391,375,36,35
Cell Cycle,305,296,40,41
Cell Division,544,265,37
Cytokinesis,543,165,38
Cytokinesis after Meiosis,399,54
M Phase of Meiotic Cell Cycle,310,144,38
M Phase,239,225,39
Meiotic Cell Cycle,392,225,39


BIN
build/application.linux64/lib/ontology.jar View File


build/application.linux64/source/buttons.pde → build/application.linux64/source/gui.pde View File

@@ -1,19 +1,26 @@
int buttonCount = 6;
int buttonCount = 8;
int i_buttonId;




void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

void buttonFunctions(int functionID) {
@@ -38,6 +45,12 @@ void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -76,3 +89,12 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}

+ 56
- 28
build/application.linux64/source/ontology.java View File

@@ -23,11 +23,12 @@ boolean darkMode = true;
public void setup() {
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -72,10 +73,14 @@ public void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -97,22 +102,42 @@ public void draw() {
}
}
}
int buttonCount = 6;

public void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}
int buttonCount = 8;
int i_buttonId;




public void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

public void buttonFunctions(int functionID) {
@@ -137,6 +162,12 @@ public void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -175,6 +206,15 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

public void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}
int linkCount;

boolean dragLink; //state of dragging a link
@@ -364,7 +404,6 @@ class Node {
text(title, x, y+textSize/3);
}
}

/**
* Saving and loading is a messy hack!
* You'll get a blank line in your save file for each deleted object.
@@ -390,17 +429,7 @@ public void loadCSVFile(File selection) {
}

public void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {
@@ -439,12 +468,12 @@ public void saveCSV(String path) {
String[] saveArray = split(saveString, '\n');
saveStrings(path, saveArray);
}

/**
* Keys only get caught for changing a nodes title.
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

public void keyPressed() {
if (key == ESC) {
key = 0;
@@ -564,7 +593,6 @@ public void mouseWheel(MouseEvent event) {
nodes[i].setVectors();
}
}

public void settings() { size(800, 600); }
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "ontology" };

+ 23
- 5
build/application.linux64/source/ontology.pde View File

@@ -7,11 +7,12 @@ boolean darkMode = true;
void setup() {
size(800, 600);
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -56,10 +57,14 @@ void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -81,3 +86,16 @@ void draw() {
}
}
}

void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}

+ 1
- 11
build/application.linux64/source/save_load.pde View File

@@ -23,17 +23,7 @@ void loadCSVFile(File selection) {
}

void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {

+ 1
- 0
build/application.linux64/source/ui.pde View File

@@ -3,6 +3,7 @@
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

void keyPressed() {
if (key == ESC) {
key = 0;

+ 0
- 41
build/application.windows32/data/save.csv View File

@@ -1,43 +1,2 @@































Biological Process,395,537,32,33
Physiological Process,292,455,34
Cellular Process,483,455,34
Cellular Physiological Process,391,375,36,35
Cell Cycle,305,296,40,41
Cell Division,544,265,37
Cytokinesis,543,165,38
Cytokinesis after Meiosis,399,54
M Phase of Meiotic Cell Cycle,310,144,38
M Phase,239,225,39
Meiotic Cell Cycle,392,225,39


BIN
build/application.windows32/lib/ontology.jar View File


BIN
build/application.windows32/ontology.exe View File


+ 0
- 78
build/application.windows32/source/buttons.pde View File

@@ -1,78 +0,0 @@
int buttonCount = 6;
int i_buttonId;

void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
}

void buttonFunctions(int functionID) {
switch (functionID) {
case(0):
addNode(int(random(50, width-50)), int(random(30, height-150)), "");
i_selectedNode = nodeCount-1;
break;
case(1):
deleteSelectedNode();
break;
case(2):
darkMode = !darkMode;
break;
case(3):
saveCSV(dataPath("save.csv"));
selectOutput("Where to save .csv file to?", "saveCSVFile");
break;
case(4):
selectInput("Select csv File", "loadCSVFile");
break;
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
default:
break;
}
}


Button buttons[] = new Button[buttonCount];

class Button {
int id, x, y, w, h;
String label;

boolean hover() {
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
}

void click() {
buttonFunctions(id);
}
Button(int x_, int y_, String label_) {
id = i_buttonId;
i_buttonId++;
x = x_;
y = y_ ;
label = label_;
w = int(textWidth(label))+18;
h = 32;
}

void display() {
stroke(0);
strokeWeight(1);
fill(255, 127);
rect(x, y, w, h, 4);
fill(0);
text(label, x+9, y+h/2+5);
}
}

+ 100
- 0
build/application.windows32/source/gui.pde View File

@@ -0,0 +1,100 @@
int buttonCount = 8;
int i_buttonId;




void initButtons() {
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

void buttonFunctions(int functionID) {
switch (functionID) {
case(0):
addNode(int(random(50, width-50)), int(random(30, height-150)), "");
i_selectedNode = nodeCount-1;
break;
case(1):
deleteSelectedNode();
break;
case(2):
darkMode = !darkMode;
break;
case(3):
saveCSV(dataPath("save.csv"));
selectOutput("Where to save .csv file to?", "saveCSVFile");
break;
case(4):
selectInput("Select csv File", "loadCSVFile");
break;
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
}


Button buttons[] = new Button[buttonCount];

class Button {
int id, x, y, w, h;
String label;

boolean hover() {
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
}

void click() {
buttonFunctions(id);
}
Button(int x_, int y_, String label_) {
id = i_buttonId;
i_buttonId++;
x = x_;
y = y_ ;
label = label_;
w = int(textWidth(label))+18;
h = 32;
}

void display() {
stroke(0);
strokeWeight(1);
fill(255, 127);
rect(x, y, w, h, 4);
fill(0);
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}

+ 56
- 28
build/application.windows32/source/ontology.java View File

@@ -23,11 +23,12 @@ boolean darkMode = true;
public void setup() {
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -72,10 +73,14 @@ public void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -97,22 +102,42 @@ public void draw() {
}
}
}
int buttonCount = 6;

public void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}
int buttonCount = 8;
int i_buttonId;




public void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

public void buttonFunctions(int functionID) {
@@ -137,6 +162,12 @@ public void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -175,6 +206,15 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

public void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}
int linkCount;

boolean dragLink; //state of dragging a link
@@ -364,7 +404,6 @@ class Node {
text(title, x, y+textSize/3);
}
}

/**
* Saving and loading is a messy hack!
* You'll get a blank line in your save file for each deleted object.
@@ -390,17 +429,7 @@ public void loadCSVFile(File selection) {
}

public void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {
@@ -439,12 +468,12 @@ public void saveCSV(String path) {
String[] saveArray = split(saveString, '\n');
saveStrings(path, saveArray);
}

/**
* Keys only get caught for changing a nodes title.
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

public void keyPressed() {
if (key == ESC) {
key = 0;
@@ -564,7 +593,6 @@ public void mouseWheel(MouseEvent event) {
nodes[i].setVectors();
}
}

public void settings() { size(800, 600); }
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "ontology" };

+ 23
- 5
build/application.windows32/source/ontology.pde View File

@@ -7,11 +7,12 @@ boolean darkMode = true;
void setup() {
size(800, 600);
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -56,10 +57,14 @@ void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -81,3 +86,16 @@ void draw() {
}
}
}

void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}

+ 1
- 11
build/application.windows32/source/save_load.pde View File

@@ -23,17 +23,7 @@ void loadCSVFile(File selection) {
}

void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {

+ 1
- 0
build/application.windows32/source/ui.pde View File

@@ -3,6 +3,7 @@
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

void keyPressed() {
if (key == ESC) {
key = 0;

+ 0
- 41
build/application.windows64/data/save.csv View File

@@ -1,43 +1,2 @@































Biological Process,395,537,32,33
Physiological Process,292,455,34
Cellular Process,483,455,34
Cellular Physiological Process,391,375,36,35
Cell Cycle,305,296,40,41
Cell Division,544,265,37
Cytokinesis,543,165,38
Cytokinesis after Meiosis,399,54
M Phase of Meiotic Cell Cycle,310,144,38
M Phase,239,225,39
Meiotic Cell Cycle,392,225,39


BIN
build/application.windows64/lib/ontology.jar View File


BIN
build/application.windows64/ontology.exe View File


+ 0
- 78
build/application.windows64/source/buttons.pde View File

@@ -1,78 +0,0 @@
int buttonCount = 6;
int i_buttonId;

void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
}

void buttonFunctions(int functionID) {
switch (functionID) {
case(0):
addNode(int(random(50, width-50)), int(random(30, height-150)), "");
i_selectedNode = nodeCount-1;
break;
case(1):
deleteSelectedNode();
break;
case(2):
darkMode = !darkMode;
break;
case(3):
saveCSV(dataPath("save.csv"));
selectOutput("Where to save .csv file to?", "saveCSVFile");
break;
case(4):
selectInput("Select csv File", "loadCSVFile");
break;
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
default:
break;
}
}


Button buttons[] = new Button[buttonCount];

class Button {
int id, x, y, w, h;
String label;

boolean hover() {
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
}

void click() {
buttonFunctions(id);
}
Button(int x_, int y_, String label_) {
id = i_buttonId;
i_buttonId++;
x = x_;
y = y_ ;
label = label_;
w = int(textWidth(label))+18;
h = 32;
}

void display() {
stroke(0);
strokeWeight(1);
fill(255, 127);
rect(x, y, w, h, 4);
fill(0);
text(label, x+9, y+h/2+5);
}
}

+ 100
- 0
build/application.windows64/source/gui.pde View File

@@ -0,0 +1,100 @@
int buttonCount = 8;
int i_buttonId;




void initButtons() {
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

void buttonFunctions(int functionID) {
switch (functionID) {
case(0):
addNode(int(random(50, width-50)), int(random(30, height-150)), "");
i_selectedNode = nodeCount-1;
break;
case(1):
deleteSelectedNode();
break;
case(2):
darkMode = !darkMode;
break;
case(3):
saveCSV(dataPath("save.csv"));
selectOutput("Where to save .csv file to?", "saveCSVFile");
break;
case(4):
selectInput("Select csv File", "loadCSVFile");
break;
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
}


Button buttons[] = new Button[buttonCount];

class Button {
int id, x, y, w, h;
String label;

boolean hover() {
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
}

void click() {
buttonFunctions(id);
}
Button(int x_, int y_, String label_) {
id = i_buttonId;
i_buttonId++;
x = x_;
y = y_ ;
label = label_;
w = int(textWidth(label))+18;
h = 32;
}

void display() {
stroke(0);
strokeWeight(1);
fill(255, 127);
rect(x, y, w, h, 4);
fill(0);
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}

+ 56
- 28
build/application.windows64/source/ontology.java View File

@@ -23,11 +23,12 @@ boolean darkMode = true;
public void setup() {
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -72,10 +73,14 @@ public void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -97,22 +102,42 @@ public void draw() {
}
}
}
int buttonCount = 6;

public void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}
int buttonCount = 8;
int i_buttonId;




public void initButtons() {
buttons[0] = new Button(10, 10, "Add Node");
buttons[1] = new Button(104, 10, "Delete Node");
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");*/
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

public void buttonFunctions(int functionID) {
@@ -137,6 +162,12 @@ public void buttonFunctions(int functionID) {
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
@@ -175,6 +206,15 @@ class Button {
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

public void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}
int linkCount;

boolean dragLink; //state of dragging a link
@@ -364,7 +404,6 @@ class Node {
text(title, x, y+textSize/3);
}
}

/**
* Saving and loading is a messy hack!
* You'll get a blank line in your save file for each deleted object.
@@ -390,17 +429,7 @@ public void loadCSVFile(File selection) {
}

public void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {
@@ -439,12 +468,12 @@ public void saveCSV(String path) {
String[] saveArray = split(saveString, '\n');
saveStrings(path, saveArray);
}

/**
* Keys only get caught for changing a nodes title.
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

public void keyPressed() {
if (key == ESC) {
key = 0;
@@ -564,7 +593,6 @@ public void mouseWheel(MouseEvent event) {
nodes[i].setVectors();
}
}

public void settings() { size(800, 600); }
static public void main(String[] passedArgs) {
String[] appletArgs = new String[] { "ontology" };

+ 23
- 5
build/application.windows64/source/ontology.pde View File

@@ -7,11 +7,12 @@ boolean darkMode = true;
void setup() {
size(800, 600);
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -56,10 +57,14 @@ void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -81,3 +86,16 @@ void draw() {
}
}
}

void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}

+ 1
- 11
build/application.windows64/source/save_load.pde View File

@@ -23,17 +23,7 @@ void loadCSVFile(File selection) {
}

void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {

+ 1
- 0
build/application.windows64/source/ui.pde View File

@@ -3,6 +3,7 @@
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

void keyPressed() {
if (key == ESC) {
key = 0;

+ 0
- 41
data/save.csv View File

@@ -1,43 +1,2 @@































Biological Process,395,537,32,33
Physiological Process,292,455,34
Cellular Process,483,455,34
Cellular Physiological Process,391,375,36,35
Cell Cycle,305,296,40,41
Cell Division,544,265,37
Cytokinesis,543,165,38
Cytokinesis after Meiosis,399,54
M Phase of Meiotic Cell Cycle,310,144,38
M Phase,239,225,39
Meiotic Cell Cycle,392,225,39


+ 100
- 0
gui.pde View File

@@ -0,0 +1,100 @@
int buttonCount = 8;
int i_buttonId;




void initButtons() {
buttons[0] = new Button(72, 10, "Add Node");
buttons[1] = new Button(164, 10, "Delete Node");
buttons[2] = new Button(10, 50, "Dark/Bright Mode");
buttons[3] = new Button(10, 90, "Save");
buttons[4] = new Button(10, 130, "Open");
buttons[5] = new Button(10, 170, "Export Image");
buttons[6] = new Button(10, 210, "Empty Workspace");
buttons[7] = new Button(10, 10, "Menu");
/* buttons[0] = new Button(10, 10, "Node Hinzufügen");
buttons[1] = new Button(155, 10, "Löschen");
buttons[2] = new Button(10, 50, "Farben umkehren");
buttons[3] = new Button(10, 90, "Speichern");
buttons[4] = new Button(10, 130, "Öffnen");
buttons[5] = new Button(10, 170, "Bild Exportieren");
buttons[6] = new Button(10, 210, "Arbeitsfläche leeren");
buttons[7] = new Button(10, 210, "Menü");*/
}

void buttonFunctions(int functionID) {
switch (functionID) {
case(0):
addNode(int(random(50, width-50)), int(random(30, height-150)), "");
i_selectedNode = nodeCount-1;
break;
case(1):
deleteSelectedNode();
break;
case(2):
darkMode = !darkMode;
break;
case(3):
saveCSV(dataPath("save.csv"));
selectOutput("Where to save .csv file to?", "saveCSVFile");
break;
case(4):
selectInput("Select csv File", "loadCSVFile");
break;
case(5):
selectOutput("Where to export .png image file to?", "savePNGFile");
break;
case(6):
deleteAll();
break;
case(7):
menu();
break;
default:
break;
}
}


Button buttons[] = new Button[buttonCount];

class Button {
int id, x, y, w, h;
String label;

boolean hover() {
return (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) ? true : false;
}

void click() {
buttonFunctions(id);
}
Button(int x_, int y_, String label_) {
id = i_buttonId;
i_buttonId++;
x = x_;
y = y_ ;
label = label_;
w = int(textWidth(label))+18;
h = 32;
}

void display() {
stroke(0);
strokeWeight(1);
fill(255, 127);
rect(x, y, w, h, 4);
fill(0);
text(label, x+9, y+h/2+5);
}
}

boolean menuOpen;

void menu() {
if (menuOpen) {
} else {
}
menuOpen = !menuOpen;
}

+ 23
- 5
ontology.pde View File

@@ -7,11 +7,12 @@ boolean darkMode = true;
void setup() {
size(800, 600);
surface.setResizable(true);
//frame.setResizable(true);

textSize(textSize);

initButtons();
/**
* When saving, a copy of the save-file is stored locally which is opened when starting the program
*/
@@ -56,10 +57,14 @@ void draw() {
textAlign(CORNER);
buttons[0].display();
if (i_selectedNode != -1) buttons[1].display();
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
if (menuOpen) {
buttons[2].display();
buttons[3].display();
buttons[4].display();
buttons[5].display();
buttons[6].display();
}
buttons[7].display();
rectMode(CENTER);
textAlign(CENTER);
textSize(textSize);
@@ -81,3 +86,16 @@ void draw() {
}
}
}

void deleteAll() {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;
for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
}

+ 1
- 11
save_load.pde View File

@@ -23,17 +23,7 @@ void loadCSVFile(File selection) {
}

void loadCSV(String path) {
for (int i = 0; i < nodeCount; i++) {
//nodes[i].deleted = true;
i_selectedNode = i;
deleteSelectedNode();
}
nodeCount = 0;

for (int i = 0; i < linkCount; i++) {
links[i].active = false;
}
linkCount = 0;
deleteAll();

String[] loadString = loadStrings(path);
for (int i = 0; i < loadString.length-1; i++) {

+ 1
- 0
ui.pde View File

@@ -3,6 +3,7 @@
* Previous title is remembered in savedTitle and restored when hitting Escape
*/
String savedTitle;

void keyPressed() {
if (key == ESC) {
key = 0;

Loading…
Cancel
Save