Skip to content

Commit 557463a

Browse files
committed
Initial version of showing GDD proof in GraphViz Online (with minor fix)
1 parent 4d18574 commit 557463a

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

src/main/java/wprover/GExpert.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,8 @@ public void addMenueToolBar() {
11781178
addImageToItem(item);
11791179
item = addAMenu(menu, "Save GDD Proof as GraphViz File", null, this);
11801180
addImageToItem(item);
1181-
1181+
item = addAMenu(menu, "Open GDD Proof in GraphViz Online", null, this);
1182+
addImageToItem(item);
11821183
menu.addSeparator();
11831184
item = addAMenu(menu, "Print", "Print the client area", 'P', this);
11841185
addImageToItem(item, "print");
@@ -1765,6 +1766,8 @@ public String getDescription() {
17651766

17661767
} else if (command.equalsIgnoreCase("Save GDD Proof as GraphViz File")) {
17671768
this.saveGDDProofAsGraphViz(src);
1769+
} else if (command.equalsIgnoreCase("Open GDD Proof in GraphViz Online")) {
1770+
this.openGDDProofGraphVizOnline();
17681771
} else if (command.equals("Save as Text")) {
17691772
if (!need_save())
17701773
return;
@@ -2237,6 +2240,14 @@ private void saveGDDProofAsGraphViz(Object src) {
22372240
}
22382241
}
22392242

2243+
/**
2244+
* Opens the GDD proof as a GraphViz file in GraphViz Online.
2245+
*/
2246+
private void openGDDProofGraphVizOnline() {
2247+
openURL("https://dreampuf.github.io/GraphvizOnline/?engine=dot#"
2248+
+ PanelProve.graphvizProgram);
2249+
}
2250+
22402251
/**
22412252
* Opens a GeoGebra file (.ggb) and loads its content.
22422253
*

src/main/java/wprover/PanelProve.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,15 +1664,15 @@ String setNode(Cond co) {
16641664
ret += "\\n" + getLanguage(exstring);
16651665
}
16661666
ret += "\"";
1667+
// The files Rule??.jpg are located in the folder web (FIXME: make the GitHub repository configurable for forks):
1668+
String url = "https://github.com/kovzol/Java-Geometry-Expert/blob/master/src/main/resources/docs/web/Rule" + rule + ".jpg?raw=true";
1669+
ret += ", URL=\"" + url + "\"";
16671670
}
16681671
else {
16691672
ret += ", tooltip = \" \""; // do not show any tooltip
16701673
}
1671-
// The files Rule??.jpg are located in the folder web:
1672-
String url = "https://github.com/kovzol/Java-Geometry-Expert/blob/master/src/main/resources/docs/web/Rule" + rule + ".jpg?raw=true";
1673-
ret += ", style = \"" + s + "\", shape = " + f + ", fillcolor = \"" + c + "\"" +
1674-
", URL=\"" + url + "\""
1675-
+ "];\n";
1674+
1675+
ret += ", style = \"" + s + "\", shape = " + f + ", fillcolor = \"" + c + "\"];\n";
16761676
return ret;
16771677
}
16781678

0 commit comments

Comments
 (0)