diff --git a/.classpath b/.classpath index 4e00818..0c326bc 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,9 @@ - - - - - - - + + + + + + + + + diff --git a/build.xml b/build.xml index ebf912c..7074049 100644 --- a/build.xml +++ b/build.xml @@ -156,6 +156,7 @@ class Version { public static String VERSION = "${VERSION}";} + diff --git a/doc/cd-opt.xml b/doc/cd-opt.xml index 836f8b9..dfe583b 100644 --- a/doc/cd-opt.xml +++ b/doc/cd-opt.xml @@ -39,6 +39,7 @@ be specified through javadoc tags within the diagram, affecting all or some elem

Visual Appearance

-bgcolor
Specify the graph's background color.
+
-autosize
Fits generated graph to the width of the page/window. Defaults to true.
-collapsible
Enhance the javadoc HTML files containing UML diagrams with Javascript that provides a link for showing the (initially collapsed) diagrams.
-edgecolor
Specify the color for drawing edges.
-edgefontcolor
Specify the font color to use for edge labels.
@@ -77,9 +78,9 @@ be specified through javadoc tags within the diagram, affecting all or some elem

All colors can be either a symbolic name (e.g. blue), -a tripple specifying hue-saturation-brightness as values 0-1 +a triple specifying hue-saturation-brightness as values 0-1 (e.g. ".13 0.9 1"), -or a tripple specifying red-green-blue values as hexadecimal +or a triple 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 diff --git a/doc/ceg-er.xml b/doc/ceg-er.xml index 19ab1c4..16783ec 100644 --- a/doc/ceg-er.xml +++ b/doc/ceg-er.xml @@ -1,11 +1,12 @@ -The following was generated by annotating the source code of the -SQO-OSS project. +The following was generated by annotating the +source code of the +Alitheia Core project. Georgios Gousios, who created it, wrote:

-I've used UMLgraph to generate an E-R diagram out of the DAOs we use in SQO-OSS. I've just annotated a few classes with @assoc tags, removed the super class DAObject from all entities with sed, did some tweaking by hand in the .dot output, et voila, an E-R depicting almost 30 classes in less than 30 minutes! +I've used UMLgraph to generate an E-R diagram out of the DAOs we use in Alitheia Core. I've just annotated a few classes with @assoc tags, removed the super class DAObject from all entities with sed, did some tweaking by hand in the .dot output, et voila, an E-R depicting almost 30 classes in less than 30 minutes!

diff --git a/pom.xml b/pom.xml index bbb7c9e..6c9edd3 100644 --- a/pom.xml +++ b/pom.xml @@ -128,6 +128,7 @@ ${project.build.directory}${file.separator}${project.build.finalName}.jar -inferrel -inferdep + -autosize -collapsible -hide java.* -collpackages diff --git a/src/main/java/org/umlgraph/doclet/Options.java b/src/main/java/org/umlgraph/doclet/Options.java index 22cb359..3bca4a8 100644 --- a/src/main/java/org/umlgraph/doclet/Options.java +++ b/src/main/java/org/umlgraph/doclet/Options.java @@ -77,6 +77,7 @@ public class Options implements Cloneable, OptionProvider { boolean horizontal; boolean showType; boolean showComment; + boolean autoSize; String edgeFontName; String edgeFontColor; String edgeColor; @@ -144,6 +145,7 @@ public class Options implements Cloneable, OptionProvider { showEnumerations = false; showConstructors = false; showType = false; + autoSize = true; showComment = false; edgeFontName = defaultFont; edgeFontColor = "black"; @@ -221,19 +223,20 @@ public class Options implements Cloneable, OptionProvider { * Will return 0 if the option is not supported. */ public static int optionLength(String option) { - if(option.equals("-qualify") || - option.equals("-horizontal") || - option.equals("-attributes") || - option.equals("-operations") || - option.equals("-constructors") || - option.equals("-visibility") || - option.equals("-types") || - option.equals("-commentname") || + if(option.equals("-qualify") || option.equals("-!qualify") || + option.equals("-horizontal") || option.equals("-!horizontal") || + option.equals("-attributes") || option.equals("-!attributes") || + option.equals("-enumconstants") || option.equals("-!enumconstants") || + option.equals("-operations") || option.equals("-!operations") || + option.equals("-enumerations") || option.equals("-!enumerations") || + option.equals("-constructors") || option.equals("-!constructors") || + option.equals("-visibility") || option.equals("-!visibility") || + option.equals("-types") || option.equals("-!types") || + option.equals("-autosize") || option.equals("-!autosize") || + option.equals("-commentname") || option.equals("-!commentname") || option.equals("-all") || option.equals("-postfixpackage") || option.equals("-noguillemot") || - option.equals("-enumconstants") || - option.equals("-enumerations") || option.equals("-views") || option.equals("-inferrel") || option.equals("-useimports") || @@ -326,6 +329,10 @@ public class Options implements Cloneable, OptionProvider { showType = true; } else if (opt[0].equals("-!types")) { showType = false; + } else if(opt[0].equals("-autoSize")) { + autoSize = true; + } else if (opt[0].equals("-!autoSize")) { + autoSize = false; } else if(opt[0].equals("-commentname")) { showComment = true; } else if (opt[0].equals("-!commentname")) { diff --git a/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java b/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java index 0f9a00f..fe6bbf1 100644 --- a/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java +++ b/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java @@ -162,9 +162,14 @@ public class UmlGraphDoc { //Format string for the uml image div tag. private static final String UML_DIV_TAG = "

" + - "" + + "" + "
"; + private static final String UML_AUTO_SIZED_DIV_TAG = + "
" + + "" + + "
"; + private static final String EXPANDABLE_UML_STYLE = "font-family: Arial,Helvetica,sans-serif;font-size: 1.5em; display: block; width: 250px; height: 20px; background: #009933; padding: 5px; text-align: center; border-radius: 8px; color: white; font-weight: bold;"; //Format string for the java script tag. @@ -217,7 +222,11 @@ public class UmlGraphDoc { if (!matched && insertPointPattern.matcher(line).matches()) { matched = true; - String tag = String.format(UML_DIV_TAG, className); + String tag; + if (opt.autoSize) + tag = String.format(UML_AUTO_SIZED_DIV_TAG, className); + else + tag = String.format(UML_DIV_TAG, className); if (opt.collapsibleDiagrams) tag = String.format(EXPANDABLE_UML, tag, "Show UML class diagram", "Hide UML class diagram"); writer.write(" - + All Classes - + diff --git a/testdata/umldoc-ref/allclasses-noframe.html b/testdata/umldoc-ref/allclasses-noframe.html index 146049b..4980e93 100644 --- a/testdata/umldoc-ref/allclasses-noframe.html +++ b/testdata/umldoc-ref/allclasses-noframe.html @@ -2,9 +2,9 @@ - + All Classes - + diff --git a/testdata/umldoc-ref/constant-values.html b/testdata/umldoc-ref/constant-values.html index 8420a09..2853bc5 100644 --- a/testdata/umldoc-ref/constant-values.html +++ b/testdata/umldoc-ref/constant-values.html @@ -2,9 +2,9 @@ - + Constant Field Values - + diff --git a/testdata/umldoc-ref/deprecated-list.html b/testdata/umldoc-ref/deprecated-list.html index b0a26cb..566d2c4 100644 --- a/testdata/umldoc-ref/deprecated-list.html +++ b/testdata/umldoc-ref/deprecated-list.html @@ -2,9 +2,9 @@ - + Deprecated List - + diff --git a/testdata/umldoc-ref/gr/spinellis/invoice/Customer.html b/testdata/umldoc-ref/gr/spinellis/invoice/Customer.html index ba23451..959bfeb 100644 --- a/testdata/umldoc-ref/gr/spinellis/invoice/Customer.html +++ b/testdata/umldoc-ref/gr/spinellis/invoice/Customer.html @@ -2,9 +2,9 @@ - + Customer - + @@ -87,8 +87,8 @@
gr.spinellis.invoice

Class Customer

- -
+ +
    diff --git a/testdata/umldoc-ref/gr/spinellis/invoice/Invoice.html b/testdata/umldoc-ref/gr/spinellis/invoice/Invoice.html index 5f61204..1d6e890 100644 --- a/testdata/umldoc-ref/gr/spinellis/invoice/Invoice.html +++ b/testdata/umldoc-ref/gr/spinellis/invoice/Invoice.html @@ -2,9 +2,9 @@ - + Invoice - + @@ -93,8 +93,8 @@ var activeTableTab = "activeTableTab";
    gr.spinellis.invoice

    Class Invoice

    - -
    + +
      diff --git a/testdata/umldoc-ref/gr/spinellis/invoice/InvoiceItem.html b/testdata/umldoc-ref/gr/spinellis/invoice/InvoiceItem.html index 17c264f..fe26859 100644 --- a/testdata/umldoc-ref/gr/spinellis/invoice/InvoiceItem.html +++ b/testdata/umldoc-ref/gr/spinellis/invoice/InvoiceItem.html @@ -2,9 +2,9 @@ - + InvoiceItem - + @@ -87,8 +87,8 @@
      gr.spinellis.invoice

      Class InvoiceItem

      - -
      + +
        diff --git a/testdata/umldoc-ref/gr/spinellis/invoice/package-frame.html b/testdata/umldoc-ref/gr/spinellis/invoice/package-frame.html index 411921d..d5b4092 100644 --- a/testdata/umldoc-ref/gr/spinellis/invoice/package-frame.html +++ b/testdata/umldoc-ref/gr/spinellis/invoice/package-frame.html @@ -2,9 +2,9 @@ - + gr.spinellis.invoice - + diff --git a/testdata/umldoc-ref/gr/spinellis/invoice/package-summary.html b/testdata/umldoc-ref/gr/spinellis/invoice/package-summary.html index d483dd8..2ee10ac 100644 --- a/testdata/umldoc-ref/gr/spinellis/invoice/package-summary.html +++ b/testdata/umldoc-ref/gr/spinellis/invoice/package-summary.html @@ -2,9 +2,9 @@ - + gr.spinellis.invoice - + @@ -70,8 +70,8 @@

        Package gr.spinellis.invoice

        - -
        + +
          diff --git a/testdata/umldoc-ref/gr/spinellis/invoice/package-tree.html b/testdata/umldoc-ref/gr/spinellis/invoice/package-tree.html index 6962278..cac2ec7 100644 --- a/testdata/umldoc-ref/gr/spinellis/invoice/package-tree.html +++ b/testdata/umldoc-ref/gr/spinellis/invoice/package-tree.html @@ -2,9 +2,9 @@ - + gr.spinellis.invoice Class Hierarchy - + diff --git a/testdata/umldoc-ref/gr/spinellis/product/Category.html b/testdata/umldoc-ref/gr/spinellis/product/Category.html index 6aa7fdc..1e5c227 100644 --- a/testdata/umldoc-ref/gr/spinellis/product/Category.html +++ b/testdata/umldoc-ref/gr/spinellis/product/Category.html @@ -2,9 +2,9 @@ - + Category - + @@ -87,8 +87,8 @@
          gr.spinellis.product

          Class Category

          - -
          + +
            diff --git a/testdata/umldoc-ref/gr/spinellis/product/Product.html b/testdata/umldoc-ref/gr/spinellis/product/Product.html index 10898ea..47ffa0f 100644 --- a/testdata/umldoc-ref/gr/spinellis/product/Product.html +++ b/testdata/umldoc-ref/gr/spinellis/product/Product.html @@ -2,9 +2,9 @@ - + Product - + @@ -87,8 +87,8 @@
            gr.spinellis.product

            Class Product

            - -
            + +
              diff --git a/testdata/umldoc-ref/gr/spinellis/product/package-frame.html b/testdata/umldoc-ref/gr/spinellis/product/package-frame.html index 662a0b7..1704070 100644 --- a/testdata/umldoc-ref/gr/spinellis/product/package-frame.html +++ b/testdata/umldoc-ref/gr/spinellis/product/package-frame.html @@ -2,9 +2,9 @@ - + gr.spinellis.product - + diff --git a/testdata/umldoc-ref/gr/spinellis/product/package-summary.html b/testdata/umldoc-ref/gr/spinellis/product/package-summary.html index 35ba92b..3c33e0c 100644 --- a/testdata/umldoc-ref/gr/spinellis/product/package-summary.html +++ b/testdata/umldoc-ref/gr/spinellis/product/package-summary.html @@ -2,9 +2,9 @@ - + gr.spinellis.product - + @@ -70,8 +70,8 @@

              Package gr.spinellis.product

              - -
              + +
                diff --git a/testdata/umldoc-ref/gr/spinellis/product/package-tree.html b/testdata/umldoc-ref/gr/spinellis/product/package-tree.html index 274f24f..ac6f159 100644 --- a/testdata/umldoc-ref/gr/spinellis/product/package-tree.html +++ b/testdata/umldoc-ref/gr/spinellis/product/package-tree.html @@ -2,9 +2,9 @@ - + gr.spinellis.product Class Hierarchy - + diff --git a/testdata/umldoc-ref/help-doc.html b/testdata/umldoc-ref/help-doc.html index 1c49f83..101fc14 100644 --- a/testdata/umldoc-ref/help-doc.html +++ b/testdata/umldoc-ref/help-doc.html @@ -2,9 +2,9 @@ - + API Help - + diff --git a/testdata/umldoc-ref/index-all.html b/testdata/umldoc-ref/index-all.html index 1363a3d..09fed8e 100644 --- a/testdata/umldoc-ref/index-all.html +++ b/testdata/umldoc-ref/index-all.html @@ -2,9 +2,9 @@ - + Index - + diff --git a/testdata/umldoc-ref/overview-frame.html b/testdata/umldoc-ref/overview-frame.html index 2c1f324..209a139 100644 --- a/testdata/umldoc-ref/overview-frame.html +++ b/testdata/umldoc-ref/overview-frame.html @@ -2,9 +2,9 @@ - + Overview List - + diff --git a/testdata/umldoc-ref/overview-summary.html b/testdata/umldoc-ref/overview-summary.html index dc7ece5..6128cde 100644 --- a/testdata/umldoc-ref/overview-summary.html +++ b/testdata/umldoc-ref/overview-summary.html @@ -2,9 +2,9 @@ - + Overview - + diff --git a/testdata/umldoc-ref/overview-tree.html b/testdata/umldoc-ref/overview-tree.html index 1ed9cff..d3a767b 100644 --- a/testdata/umldoc-ref/overview-tree.html +++ b/testdata/umldoc-ref/overview-tree.html @@ -2,9 +2,9 @@ - + Class Hierarchy - + diff --git a/web/index.html b/web/index.html index 21d4e8d..1956959 100644 --- a/web/index.html +++ b/web/index.html @@ -10,7 +10,7 @@ all types UML diagrams. An IEEE Software article titled On the declarative specification of models explains the rationale behind this approach. -The tehnology behind UMLGraph was used to draw many of the diagrams +The technology behind UMLGraph was used to draw many of the diagrams appearing in the award-winning books Code Quality: The Open Source Perspective (Addison Wesley, 2006) and Code Reading: The Open Source Perspective (Addison Wesley, 2003).