From 88440e18d86be099218e88fb85fbab205c84347e Mon Sep 17 00:00:00 2001 From: Diomidis Spinellis Date: Sat, 8 Jan 2011 18:20:27 +0000 Subject: [PATCH] Fix to ensure that class images only appear once. Contributed by: Zhigang Xie. --- doc/ver.xml | 7 ++++--- src/org/umlgraph/doclet/UmlGraphDoc.java | 12 +++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/ver.xml b/doc/ver.xml index 8b45f56..d735a92 100644 --- a/doc/ver.xml +++ b/doc/ver.xml @@ -1,6 +1,5 @@ -
@@ -8,8 +7,10 @@
  • Make the generation of diamond shapes compatible with GraphViz 2.27. (Contributed by Soraya Santana de la Fe.)
  • -
  • Make the maps appearing sdfs -(Contributed by Soraya Santana de la Fe.)
  • +
  • Make the diagram elements appearing in HTML content clickable. +(Contributed by Bernd Onasch.)
  • +
  • Fix to ensure that class images only appear once. +(Contributed by Zhigang Xie.)
diff --git a/src/org/umlgraph/doclet/UmlGraphDoc.java b/src/org/umlgraph/doclet/UmlGraphDoc.java index efc67cf..044d076 100644 --- a/src/org/umlgraph/doclet/UmlGraphDoc.java +++ b/src/org/umlgraph/doclet/UmlGraphDoc.java @@ -10,6 +10,8 @@ import java.io.FileOutputStream; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.HashSet; +import java.util.TreeSet; +import java.util.Comparator; import java.util.Set; import java.util.regex.Pattern; @@ -106,8 +108,16 @@ public class UmlGraphDoc { */ private static void generateContextDiagrams(RootDoc root, Options opt, String outputFolder) throws IOException { + Set classDocs = new TreeSet(new Comparator() { + public int compare(ClassDoc cd1, ClassDoc cd2) { + return cd1.name().compareTo(cd2.name()); + } + }); + for (ClassDoc classDoc : root.classes()) + classDocs.add(classDoc); + ContextView view = null; - for (ClassDoc classDoc : root.classes()) { + for (ClassDoc classDoc : classDocs) { if(view == null) view = new ContextView(outputFolder, classDoc, root, opt); else