mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 04:30:45 +00:00
Removing some deprecated things
This commit is contained in:
@@ -39,7 +39,7 @@ public class GraphVizDotCommands {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void runCommand(String command) {
|
||||
private static void runCommand(String[] command) {
|
||||
try {
|
||||
Process process = Runtime.getRuntime().exec(command);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
@@ -52,12 +52,17 @@ public class GraphVizDotCommands {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean runDotCommand(String command) {
|
||||
private static boolean runDotCommand(String[] command) {
|
||||
String dotLocation = Configuration.graphVizDotLocation.get();
|
||||
if (dotLocation.isEmpty() && !new File(dotLocation).exists()) {
|
||||
return false;
|
||||
}//
|
||||
runCommand("\"" + dotLocation + "\" " + command);
|
||||
String[] commandPlusDot = new String[command.length + 1];
|
||||
commandPlusDot[0] = dotLocation;
|
||||
for (int i = 0; i < command.length; i++) {
|
||||
commandPlusDot[1 + i] = command[i];
|
||||
}
|
||||
runCommand(commandPlusDot);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -68,8 +73,7 @@ public class GraphVizDotCommands {
|
||||
PrintWriter pw = new PrintWriter(gvFile);
|
||||
pw.println(text);
|
||||
pw.close();
|
||||
String extraParams = " -Nfontname=times-bold -Nfontsize=12";
|
||||
if (!runDotCommand("-Tpng" + extraParams + " -o \"" + pngFile.getAbsolutePath() + "\" \"" + gvFile.getAbsolutePath() + "\"")) {
|
||||
if (!runDotCommand(new String[]{"-Tpng", "-Nfontname=times-bold", "-Nfontsize=12", "-o", pngFile.getAbsolutePath(), gvFile.getAbsolutePath()})) {
|
||||
gvFile.delete();
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user