From 16c5db82b03edc7c57330fc0305c35dbc4fb4866 Mon Sep 17 00:00:00 2001 From: Andrea Aime Date: Sat, 31 Dec 2005 17:32:10 +0000 Subject: [PATCH] Lookup the association targets using the java standard mechanism --- .../spinellis/umlgraph/doclet/ClassGraph.java | 18 ++++++++++++++---- src/org/umlgraph/doclet/ClassGraph.java | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/gr/spinellis/umlgraph/doclet/ClassGraph.java b/src/gr/spinellis/umlgraph/doclet/ClassGraph.java index 395f09d..b5a7b4b 100644 --- a/src/gr/spinellis/umlgraph/doclet/ClassGraph.java +++ b/src/gr/spinellis/umlgraph/doclet/ClassGraph.java @@ -454,17 +454,27 @@ class ClassGraph { * @param name the source class internal name * @param edgetype the dot edge specification */ - private void relation(Options opt, String tagname, Doc from, String name, String edgetype) { + private void relation(Options opt, String tagname, ClassDoc from, String name, String edgetype) { for (Tag tag : from.tags(tagname)) { String t[] = StringUtil.tokenize(tag.text()); // l-src label l-dst target if (t.length != 4) { System.err.println("Error in " + from + "\n" + tagname + " expects four fields (l-src label l-dst target): " + tag.text()); return; } - if(hidden(t[3])) + String destName = t[3]; + String nodeName = null; + ClassDoc to = from.findClass(t[3]); + if(to != null) { + destName = to.toString(); + nodeName = getNodeName(destName); + } else { + nodeName = getNodeName(t[3]); + } + + if(hidden(destName)) continue; - opt.w.println("\t// " + from + " " + tagname + " " + t[3]); - opt.w.println("\t" + name + " -> " + getNodeName(t[3]) + " [" + + opt.w.println("\t// " + from + " " + tagname + " " +destName); + opt.w.println("\t" + name + " -> " + nodeName + " [" + "taillabel=\"" + t[0] + "\", " + "label=\"" + guillemize(opt, t[1]) + "\", " + "headlabel=\"" + t[2] + "\", " + diff --git a/src/org/umlgraph/doclet/ClassGraph.java b/src/org/umlgraph/doclet/ClassGraph.java index 395f09d..b5a7b4b 100644 --- a/src/org/umlgraph/doclet/ClassGraph.java +++ b/src/org/umlgraph/doclet/ClassGraph.java @@ -454,17 +454,27 @@ class ClassGraph { * @param name the source class internal name * @param edgetype the dot edge specification */ - private void relation(Options opt, String tagname, Doc from, String name, String edgetype) { + private void relation(Options opt, String tagname, ClassDoc from, String name, String edgetype) { for (Tag tag : from.tags(tagname)) { String t[] = StringUtil.tokenize(tag.text()); // l-src label l-dst target if (t.length != 4) { System.err.println("Error in " + from + "\n" + tagname + " expects four fields (l-src label l-dst target): " + tag.text()); return; } - if(hidden(t[3])) + String destName = t[3]; + String nodeName = null; + ClassDoc to = from.findClass(t[3]); + if(to != null) { + destName = to.toString(); + nodeName = getNodeName(destName); + } else { + nodeName = getNodeName(t[3]); + } + + if(hidden(destName)) continue; - opt.w.println("\t// " + from + " " + tagname + " " + t[3]); - opt.w.println("\t" + name + " -> " + getNodeName(t[3]) + " [" + + opt.w.println("\t// " + from + " " + tagname + " " +destName); + opt.w.println("\t" + name + " -> " + nodeName + " [" + "taillabel=\"" + t[0] + "\", " + "label=\"" + guillemize(opt, t[1]) + "\", " + "headlabel=\"" + t[2] + "\", " +