diff --git a/doc/cd-opt.xml b/doc/cd-opt.xml index ad92c4c..785fd61 100644 --- a/doc/cd-opt.xml +++ b/doc/cd-opt.xml @@ -174,6 +174,10 @@ This table is used to resolved external class names (class names that do not belong to the current package being processed by UMLGraph). If no file is provided, external classes will just be mapped to the on-line Java API documentation. +
-nodesep
Specify the horizontal separation between the class nodes (0.25 +by default). Decreasing this can make a diagram more compact.
+
-ranksep
Specify the vertical separation between the class nodes (0.5 +by default). Decreasing this can make a diagram more compact.
-noguillemot
Specify that guillemot characters should not be used to denote special terms like "interface" and stereotype names. This is used on some platforms to circumvent problems associated diff --git a/src/org/umlgraph/doclet/ClassGraph.java b/src/org/umlgraph/doclet/ClassGraph.java index 49c52ab..184f071 100644 --- a/src/org/umlgraph/doclet/ClassGraph.java +++ b/src/org/umlgraph/doclet/ClassGraph.java @@ -1128,8 +1128,11 @@ class ClassGraph { "\tnode [fontname=\"" + opt.nodeFontName + "\",fontsize=10,shape=plaintext];" ); + + w.println("\tnodesep=" + opt.nodeSep + ";"); + w.println("\tranksep=" + opt.rankSep + ";"); if (opt.horizontal) - w.println("\trankdir=LR;\n\tranksep=1;"); + w.println("\trankdir=LR;"); if (opt.bgColor != null) w.println("\tbgcolor=\"" + opt.bgColor + "\";\n"); } diff --git a/src/org/umlgraph/doclet/Options.java b/src/org/umlgraph/doclet/Options.java index 7842c29..b093c8d 100644 --- a/src/org/umlgraph/doclet/Options.java +++ b/src/org/umlgraph/doclet/Options.java @@ -104,6 +104,8 @@ public class Options implements Cloneable, OptionProvider { boolean useGuillemot; boolean findViews; String viewName; + double nodeSep; + double rankSep; public String outputDirectory; /* * Numeric values are preferable to symbolic here. @@ -180,6 +182,8 @@ public class Options implements Cloneable, OptionProvider { collPackages = new Vector(); compact = false; relativeLinksForSourcePackages = false; + nodeSep = 0.25; + rankSep = 0.5; } public Object clone() { @@ -262,6 +266,8 @@ public class Options implements Cloneable, OptionProvider { option.equals("-inferreltype") || option.equals("-inferdepvis") || option.equals("-collpackages") || + option.equals("-nodesep") || + option.equals("-ranksep") || option.equals("-link")) return 2; else if(option.equals("-contextPattern")) @@ -504,6 +510,22 @@ public class Options implements Cloneable, OptionProvider { } + } else if (opt[0].equals("-nodesep")) { + try { + nodeSep = Double.parseDouble(opt[1]); + } catch (NumberFormatException e) { + System.err.println("Skipping invalid nodesep " + opt[1]); + } + } else if (opt[0].equals("-!nodesep")) { + nodeSep = 0.25; + } else if (opt[0].equals("-ranksep")) { + try { + rankSep = Double.parseDouble(opt[1]); + } catch (NumberFormatException e) { + System.err.println("Skipping invalid ranksep " + opt[1]); + } + } else if (opt[0].equals("-!ranksep")) { + rankSep = 0.5; } else ; // Do nothing, javadoc will handle the option or complain, if // needed.