diff --git a/src/main/java/org/umlgraph/doclet/ClassGraph.java b/src/main/java/org/umlgraph/doclet/ClassGraph.java index f1b4314..55802bb 100644 --- a/src/main/java/org/umlgraph/doclet/ClassGraph.java +++ b/src/main/java/org/umlgraph/doclet/ClassGraph.java @@ -416,18 +416,7 @@ class ClassGraph { externalTableStart(opt, c.qualifiedName(), classToUrl(c, rootClass)); - // Calculate the number of innerTable rows we will emmit - int nRows = 1; - if (showMembers) { - if (opt.showAttributes) - nRows++; - else if(!c.isEnum() && (opt.showConstructors || opt.showOperations)) - nRows++; - else if (c.isEnum() && opt.showEnumConstants) - nRows++; - } - - firstInnerTableStart(opt, nRows); + firstInnerTableStart(opt); if (c.isInterface()) tableLine(Align.CENTER, guilWrap(opt, "interface")); if (c.isEnum()) @@ -448,7 +437,7 @@ class ClassGraph { tableLine(Align.CENTER, escape(qualifiedName), opt, font); } tagvalue(opt, c); - firstInnerTableEnd(opt, nRows); + firstInnerTableEnd(opt); /* * Warning: The boolean expressions guarding innerTableStart() @@ -1111,10 +1100,9 @@ class ClassGraph { /** * Start the first inner table of a class. - * @param nRows the total number of rows in this table. */ - private void firstInnerTableStart(Options opt, int nRows) { - w.print(linePrefix + linePrefix + "" + opt.shape.extraColumn(nRows) + + private void firstInnerTableStart(Options opt) { + w.print(linePrefix + linePrefix + "" + opt.shape.extraColumn() + "" + linePostfix); } @@ -1125,11 +1113,10 @@ class ClassGraph { /** * End the first inner table of a class. - * @param nRows the total number of rows in this table. */ - private void firstInnerTableEnd(Options opt, int nRows) { + private void firstInnerTableEnd(Options opt) { w.print(linePrefix + linePrefix + "
" + - opt.shape.extraColumn(nRows) + "" + linePostfix); + opt.shape.extraColumn() + "" + linePostfix); } private void tableLine(Align align, String text) { diff --git a/src/main/java/org/umlgraph/doclet/Shape.java b/src/main/java/org/umlgraph/doclet/Shape.java index b1b9870..1b457f2 100644 --- a/src/main/java/org/umlgraph/doclet/Shape.java +++ b/src/main/java/org/umlgraph/doclet/Shape.java @@ -86,8 +86,8 @@ public class Shape { } /** Return the table border required for the shape */ - String extraColumn(int nRows) { - return name.equals("activeclass") ? ("") : ""; + String extraColumn() { + return name.equals("activeclass") ? ("") : ""; } /** Return the cell border required for the shape */ diff --git a/testdata/dot-ref/.gitignore b/testdata/dot-ref/.gitignore index b38f805..e33609d 100644 --- a/testdata/dot-ref/.gitignore +++ b/testdata/dot-ref/.gitignore @@ -1,2 +1 @@ -*.dot *.png diff --git a/testdata/dot-ref/active.dot b/testdata/dot-ref/active.dot new file mode 100644 index 0000000..ba5a021 --- /dev/null +++ b/testdata/dot-ref/active.dot @@ -0,0 +1,15 @@ +#!/usr/local/bin/dot +# +# Class diagram +# Generated by UMLGraph version R5_7_2-54-gbca0ce (http://www.spinellis.gr/umlgraph/) +# + +digraph G { + edge [fontname="Helvetica",fontsize=10,labelfontname="Helvetica",labelfontsize=10]; + node [fontname="Helvetica",fontsize=10,shape=plaintext]; + nodesep=0.25; + ranksep=0.5; + // Active + c32 [label=<
Active
run()
>, URL="null", fontname="Helvetica", fontcolor="black", fontsize=10.0]; +} + diff --git a/testdata/java/active.java b/testdata/java/active.java new file mode 100644 index 0000000..5b63708 --- /dev/null +++ b/testdata/java/active.java @@ -0,0 +1,13 @@ +/** + * Active classes + * + * @opt operations + * @opt shape activeclass + * @hidden + */ +class UMLOptions {} + +class Active { + protected int hidden; + public void run() {}; +}