some generalizations to support SVG

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3059 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2008-10-16 14:36:46 +00:00
parent 10573a3d5f
commit 34b71378d8
2 changed files with 14 additions and 3 deletions

View File

@ -42,6 +42,8 @@ public class DotUtil {
}
private static DotOutputType outputType = DotOutputType.PS;
private static int fontSize = 6;
public static void setOutputType(DotOutputType outType) {
outputType = outType;
@ -68,7 +70,6 @@ public class DotUtil {
*/
private final static int MAX_LABEL_LENGTH = Integer.MAX_VALUE;
private final static int FONT_SIZE = 6;
/**
*/
@ -176,7 +177,7 @@ public class DotUtil {
if (rankdir != null) {
result.append("rankdir=" + rankdir + ";");
}
String fontsizeStr = "fontsize=" + FONT_SIZE;
String fontsizeStr = "fontsize=" + fontSize;
result.append("center=true;");
result.append(fontsizeStr);
result.append("node [");
@ -260,4 +261,12 @@ public class DotUtil {
}
public static int getFontSize() {
return fontSize;
}
public static void setFontSize(int fontSize) {
DotUtil.fontSize = fontSize;
}
}

View File

@ -177,7 +177,9 @@ public class ViewIFDSLocalAction<T, P, F> extends Action {
System.err.println("Spawn Viewer for " + proc);
DotUtil.dotify(localGraph, labels, dotFile, psFile, dotExe);
GVUtil.launchGV(psFile, gvExe);
if (DotUtil.getOutputType() == DotUtil.DotOutputType.PS) {
GVUtil.launchGV(psFile, gvExe);
}
} catch (WalaException e) {
e.printStackTrace();
Assertions.UNREACHABLE();