Skip to content

Commit 1198c68

Browse files
committed
Improve GraphViz invocation
1 parent 4470e49 commit 1198c68

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/main/java/wprover/GExpert.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
import java.awt.dnd.*;
2828
import java.awt.datatransfer.*;
2929
import java.lang.reflect.Method;
30-
import java.net.URL;
31-
import java.net.URISyntaxException;
30+
import java.net.*;
3231
import java.nio.charset.StandardCharsets;
3332
import java.nio.file.Files;
3433
import java.nio.file.Path;
@@ -2244,8 +2243,14 @@ private void saveGDDProofAsGraphViz(Object src) {
22442243
* Opens the GDD proof as a GraphViz file in GraphViz Online.
22452244
*/
22462245
private void openGDDProofGraphVizOnline() {
2247-
openURL("https://dreampuf.github.io/GraphvizOnline/?engine=dot#"
2248-
+ PanelProve.graphvizProgram);
2246+
try {
2247+
URL url = new URL("https://dreampuf.github.io/GraphvizOnline/?engine=dot#" + PanelProve.graphvizProgram);
2248+
URI uri = new URI(url.getProtocol(), url.getUserInfo(), IDN.toASCII(url.getHost()), url.getPort(), url.getPath(), url.getQuery(), url.getRef());
2249+
String correctEncodedURL = uri.toASCIIString();
2250+
openURL(correctEncodedURL);
2251+
} catch (Exception e) {
2252+
throw new RuntimeException(e);
2253+
}
22492254
}
22502255

22512256
/**

src/main/java/wprover/PanelProve.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1902,7 +1902,7 @@ private void createSubNode(DefaultMutableTreeNode node, Cond co, Cond root) {
19021902
// This may duplicate some entries, FIXME:
19031903
hypotheses += "\"" + st + "\" [ fillcolor = \"" + COLOR_HYPOTHESIS
19041904
+ "\", shape = " + FORM_HYPOTHESIS + ", style = \"" + STYLE_HYPOTHESIS
1905-
+ "\", tooltip = \" \" ];\n";
1905+
+ "\", tooltip = \" \"];\n";
19061906
}
19071907
}
19081908
Cond leaf = searchSubCond(root, num);

0 commit comments

Comments
 (0)