diff --git a/index.html b/index.html
index ac7ca46..c47bb26 100644
--- a/index.html
+++ b/index.html
@@ -164,14 +164,29 @@ visibility (private, public, protected)
-visibility
-types
+All colors can be either a symbolic name (e.g. blue), a tripple specifying hue-saturation-brightness as values 0-1 (e.g. ".13 0.9 1"), or a tripple specifying red-green-blue values as hexadecimal digits prefixed by a # (e.g. "#ff8020"). The symbolic color names are derived from the X Windows System; you can find a complete list in the Graphviz documentation. - +
+Font names are passed directly to the dot graph generation back-end. +In general the Postcript standard names Times, Helvetica, Courier, and +Symbol are safe to use.
Since the options are really a part of the generated graph you want in many cases to include them in the diagram specification. @@ -202,6 +217,18 @@ You can download it in source and compiled format from the following links:
Download the declarative specification, the generated dot code.
-
/**
+ * @opt edgecolor "yellow"
+ * @opt nodefontname "Times"
+ * @opt bgcolor ".7 .9 1"
* @opt nodefillcolor "#a0a0a0"
+ * @opt nodefontsize 14
* @hidden
*/
class UMLOptions{}
/**
+ * @opt nodefontname "Helvetica-Bold"
+ * @opt nodefontcolor "white"
* @composed - - - Red
* @composed - - - Green
* @composed - - - Blue
diff --git a/src/gr/spinellis/umlgraph/doclet/ClassGraph.java b/src/gr/spinellis/umlgraph/doclet/ClassGraph.java
index e86c7e2..8d47494 100644
--- a/src/gr/spinellis/umlgraph/doclet/ClassGraph.java
+++ b/src/gr/spinellis/umlgraph/doclet/ClassGraph.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/gr/spinellis/umlgraph/doclet/ClassInfo.java b/src/gr/spinellis/umlgraph/doclet/ClassInfo.java
index e86c7e2..8d47494 100644
--- a/src/gr/spinellis/umlgraph/doclet/ClassInfo.java
+++ b/src/gr/spinellis/umlgraph/doclet/ClassInfo.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/gr/spinellis/umlgraph/doclet/Options.java b/src/gr/spinellis/umlgraph/doclet/Options.java
index e86c7e2..8d47494 100644
--- a/src/gr/spinellis/umlgraph/doclet/Options.java
+++ b/src/gr/spinellis/umlgraph/doclet/Options.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/gr/spinellis/umlgraph/doclet/StringUtil.java b/src/gr/spinellis/umlgraph/doclet/StringUtil.java
index e86c7e2..8d47494 100644
--- a/src/gr/spinellis/umlgraph/doclet/StringUtil.java
+++ b/src/gr/spinellis/umlgraph/doclet/StringUtil.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/gr/spinellis/umlgraph/doclet/UmlGraph.java b/src/gr/spinellis/umlgraph/doclet/UmlGraph.java
index e86c7e2..8d47494 100644
--- a/src/gr/spinellis/umlgraph/doclet/UmlGraph.java
+++ b/src/gr/spinellis/umlgraph/doclet/UmlGraph.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/org/umlgraph/doclet/ClassGraph.java b/src/org/umlgraph/doclet/ClassGraph.java
index e86c7e2..8d47494 100644
--- a/src/org/umlgraph/doclet/ClassGraph.java
+++ b/src/org/umlgraph/doclet/ClassGraph.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/org/umlgraph/doclet/ClassInfo.java b/src/org/umlgraph/doclet/ClassInfo.java
index e86c7e2..8d47494 100644
--- a/src/org/umlgraph/doclet/ClassInfo.java
+++ b/src/org/umlgraph/doclet/ClassInfo.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/org/umlgraph/doclet/Options.java b/src/org/umlgraph/doclet/Options.java
index e86c7e2..8d47494 100644
--- a/src/org/umlgraph/doclet/Options.java
+++ b/src/org/umlgraph/doclet/Options.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/org/umlgraph/doclet/StringUtil.java b/src/org/umlgraph/doclet/StringUtil.java
index e86c7e2..8d47494 100644
--- a/src/org/umlgraph/doclet/StringUtil.java
+++ b/src/org/umlgraph/doclet/StringUtil.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/src/org/umlgraph/doclet/UmlGraph.java b/src/org/umlgraph/doclet/UmlGraph.java
index e86c7e2..8d47494 100644
--- a/src/org/umlgraph/doclet/UmlGraph.java
+++ b/src/org/umlgraph/doclet/UmlGraph.java
@@ -36,11 +36,14 @@ class Options implements Cloneable {
boolean showType;
String edgeFontName;
String edgeFontColor;
+ String edgeColor;
double edgeFontSize;
String nodeFontName;
+ String nodeFontAbstractName;
String nodeFontColor;
double nodeFontSize;
String nodeFillColor;
+ String bgColor;
Options() {
showQualified = false;
@@ -49,12 +52,14 @@ class Options implements Cloneable {
showVisibility = false;
showType = false;
edgeFontName = "Helvetica";
- edgeFontColor = null;
+ edgeFontColor = "black";
+ edgeColor = "black";
edgeFontSize = 10;
- nodeFontName = "Helvetica";
- nodeFontColor = null;
+ nodeFontAbstractName = "Helvetica-Oblique";
+ nodeFontColor = "black";
nodeFontSize = 10;
nodeFillColor = null;
+ bgColor = null;
}
public Object clone()
@@ -92,6 +97,24 @@ class Options implements Cloneable {
showType = true;
} else if(opt[0].equals("-all")) {
setAll();
+ } else if(opt[0].equals("-bgcolor")) {
+ bgColor = opt[1];
+ } else if(opt[0].equals("-edgecolor")) {
+ edgeColor = opt[1];
+ } else if(opt[0].equals("-edgefontcolor")) {
+ edgeFontColor = opt[1];
+ } else if(opt[0].equals("-edgefontname")) {
+ edgeFontName = opt[1];
+ } else if(opt[0].equals("-edgefontsize")) {
+ edgeFontSize = Integer.parseInt(opt[1]);
+ } else if(opt[0].equals("-nodefontcolor")) {
+ nodeFontColor = opt[1];
+ } else if(opt[0].equals("-nodefontname")) {
+ nodeFontName = opt[1];
+ } else if(opt[0].equals("-nodefontabstractname")) {
+ nodeFontAbstractName = opt[1];
+ } else if(opt[0].equals("-nodefontsize")) {
+ nodeFontSize = Integer.parseInt(opt[1]);
} else if(opt[0].equals("-nodefillcolor")) {
nodeFillColor = opt[1];
}
@@ -380,9 +403,12 @@ class ClassGraph {
opt.w.print("}\"");
// Use ariali for gif output
if (c.isAbstract())
- opt.w.print(", fontname=\"Helvetica-Oblique\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontAbstractName + "\"");
if (opt.nodeFillColor != null)
opt.w.print(", style=filled, fillcolor=\"" + opt.nodeFillColor + "\"");
+ opt.w.print(", fontname=\"" + opt.nodeFontName + "\"");
+ opt.w.print(", fontcolor=\"" + opt.nodeFontColor + "\"");
+ opt.w.print(", fontsize=" + opt.nodeFontSize);
opt.w.println("];");
ci.nodePrinted = true;
}
@@ -408,6 +434,10 @@ class ClassGraph {
"taillabel=\"" + t[0] + "\", " +
"label=\"" + StringFuns.guillemize(t[1]) + "\", " +
"headlabel=\"" + t[2] + "\", " +
+ "fontname=\"" + opt.edgeFontName + "\", " +
+ "fontcolor=\"" + opt.edgeFontColor + "\", " +
+ "fontsize=" + opt.edgeFontSize + ", " +
+ "color=\"" + opt.edgeColor + "\", " +
edgetype + "]"
);
}
@@ -476,7 +506,16 @@ public class UmlGraph {
option.equals("-types") ||
option.equals("-all"))
return 1;
- else if(option.equals("-nodefillcolor"))
+ else if(option.equals("-nodefillcolor") ||
+ option.equals("-nodefontcolor") ||
+ option.equals("-nodefontsize") ||
+ option.equals("-nodefontname") ||
+ option.equals("-nodefontabstractname") ||
+ option.equals("-edgefontcolor") ||
+ option.equals("-edgecolor") ||
+ option.equals("-edgefontsize") ||
+ option.equals("-edgefontname") ||
+ option.equals("-bgcolor"))
return 2;
else
return 0;
@@ -497,6 +536,8 @@ public class UmlGraph {
);
if (opt.horizontal)
opt.w.println("\trankdir=LR;\n\tranksep=1;");
+ if (opt.bgColor != null)
+ opt.w.println("\tbgcolor=\"" + opt.bgColor + "\";\n");
}
/** Dot epilogue */
diff --git a/web/index.html b/web/index.html
index ac7ca46..c47bb26 100644
--- a/web/index.html
+++ b/web/index.html
@@ -164,14 +164,29 @@ visibility (private, public, protected)
+All colors can be either a symbolic name (e.g. blue), a tripple specifying hue-saturation-brightness as values 0-1 (e.g. ".13 0.9 1"), or a tripple specifying red-green-blue values as hexadecimal digits prefixed by a # (e.g. "#ff8020"). The symbolic color names are derived from the X Windows System; you can find a complete list in the Graphviz documentation. - + +Font names are passed directly to the dot graph generation back-end. +In general the Postcript standard names Times, Helvetica, Courier, and +Symbol are safe to use. Since the options are really a part of the generated graph you want in many cases to include them in the diagram specification. @@ -202,6 +217,18 @@ You can download it in source and compiled format from the following links: Version History
|
/**
+ * @opt edgecolor "yellow"
+ * @opt nodefontname "Times"
+ * @opt bgcolor ".7 .9 1"
* @opt nodefillcolor "#a0a0a0"
+ * @opt nodefontsize 14
* @hidden
*/
class UMLOptions{}
/**
+ * @opt nodefontname "Helvetica-Bold"
+ * @opt nodefontcolor "white"
* @composed - - - Red
* @composed - - - Green
* @composed - - - Blue
|