Fix to ensure that class images only appear once.

Contributed by:	Zhigang Xie.
This commit is contained in:
Diomidis Spinellis 2011-01-08 18:20:27 +00:00
parent 0c403eb9e2
commit 88440e18d8
2 changed files with 15 additions and 4 deletions

View File

@ -1,6 +1,5 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<!-- vim: spell -->
<notes>
<dl>
@ -8,8 +7,10 @@
<ul>
<li>Make the generation of diamond shapes compatible with GraphViz 2.27.
(Contributed by Soraya Santana de la Fe.)</li>
<li>Make the maps appearing sdfs
(Contributed by Soraya Santana de la Fe.)</li>
<li>Make the diagram elements appearing in HTML content clickable.
(Contributed by Bernd Onasch.)</li>
<li>Fix to ensure that class images only appear once.
(Contributed by Zhigang Xie.)</li>
</ul>
</dd>

View File

@ -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<ClassDoc> classDocs = new TreeSet<ClassDoc>(new Comparator<ClassDoc>() {
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