From e58589e4c01a04caf68770e3706c307728a94c1c Mon Sep 17 00:00:00 2001 From: Emanuel Pordes Date: Fri, 11 Oct 2013 14:26:56 -0400 Subject: [PATCH 1/3] Output as SVG instead of PNG and minor cosmetic fixes. --- .../java/org/umlgraph/doclet/ClassGraph.java | 2 +- .../java/org/umlgraph/doclet/Options.java | 2 +- .../java/org/umlgraph/doclet/UmlGraphDoc.java | 43 ++++--------------- 3 files changed, 10 insertions(+), 37 deletions(-) diff --git a/src/main/java/org/umlgraph/doclet/ClassGraph.java b/src/main/java/org/umlgraph/doclet/ClassGraph.java index 8afe663..76bbe35 100644 --- a/src/main/java/org/umlgraph/doclet/ClassGraph.java +++ b/src/main/java/org/umlgraph/doclet/ClassGraph.java @@ -1162,7 +1162,7 @@ class ClassGraph { bgcolor = " bgcolor=\""+ opt.nodeFillColor + "\""; String href = ""; if (url != null) - href = " href=\"" + url + "\""; + href = " href=\"" + url + "\" target=\"_parent\""; w.print("<" + - "\"Package" + + "" + ""; + 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. private static final String EXPANDABLE_UML = "\n" + "
\n" + " \n" + - " %2$s \n" + + " %2$s \n" + "
"; /** @@ -198,7 +195,6 @@ public class UmlGraphDoc { File output = new File(outputFolder, packageName.replace(".", "/")); File htmlFile = new File(output, htmlFileName); File alteredFile = new File(htmlFile.getAbsolutePath() + ".uml"); - File mapFile = new File(output, className + ".map"); if (!htmlFile.exists()) { System.err.println("Expected file not found: " + htmlFile.getAbsolutePath()); return; @@ -220,10 +216,6 @@ public class UmlGraphDoc { writer.newLine(); if (!matched && insertPointPattern.matcher(line).matches()) { matched = true; - if (mapFile.exists()) - insertClientSideMap(mapFile, writer); - else - root.printWarning("Could not find map file " + mapFile); String tag = String.format(UML_DIV_TAG, className); if (opt.collapsibleDiagrams) @@ -254,25 +246,6 @@ public class UmlGraphDoc { } } - /** - * Reads the map file and outputs in to the specified writer - * @throws IOException - */ - private static void insertClientSideMap(File mapFile, BufferedWriter writer) throws IOException { - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader(mapFile)); - String line = null; - while ((line = reader.readLine()) != null) { - writer.write(line); - writer.newLine(); - } - } finally { - if (reader != null) - reader.close(); - } - } - /** * Returns the output path specified on the javadoc options */ From 41d93e14f6df47fcf2576959bef8d4c11d33f227 Mon Sep 17 00:00:00 2001 From: Emanuel Pordes Date: Fri, 11 Oct 2013 15:50:54 -0400 Subject: [PATCH 2/3] Fix variable naming --- src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java b/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java index 13e1c82..3d39ab9 100644 --- a/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java +++ b/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java @@ -136,14 +136,14 @@ public class UmlGraphDoc { dotExecutable = "dot"; } File dotFile = new File(outputFolder, packageName.replace(".", "/") + "/" + name + ".dot"); - File pngFile = new File(outputFolder, packageName.replace(".", "/") + "/" + name + ".svg"); + File svgFile = new File(outputFolder, packageName.replace(".", "/") + "/" + name + ".svg"); try { Process p = Runtime.getRuntime().exec(new String [] { dotExecutable, "-Tsvg", "-o", - pngFile.getAbsolutePath(), + svgFile.getAbsolutePath(), dotFile.getAbsolutePath() }); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getErrorStream())); From 44a146c03d773841e1ba404f1050040271b27dc0 Mon Sep 17 00:00:00 2001 From: Emanuel Pordes Date: Tue, 15 Oct 2013 15:28:17 -0400 Subject: [PATCH 3/3] Added width and height to svg object tag --- src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java b/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java index 3d39ab9..6dda3a2 100644 --- a/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java +++ b/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java @@ -162,7 +162,7 @@ public class UmlGraphDoc { //Format string for the uml image div tag. private static final String UML_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;";