8232639: Change module graph images to use SVG instead of PNG format

Reviewed-by: mchung, ihse
This commit is contained in:
Jonathan Gibbons 2019-10-21 11:35:36 -07:00
parent b96be4b7ae
commit f5b14bd780
2 changed files with 14 additions and 14 deletions

View File

@ -192,26 +192,26 @@ JAVASE_LONG_NAME := Java<sup>&reg;</sup> Platform, Standard Edition
################################################################################
# Functions
# Helper function for creating a png file from a dot file generated by the
# Helper function for creating a svg file from a dot file generated by the
# GenGraphs tool.
# param 1: SetupJavadocGeneration namespace ($1)
# param 2: module name
#
define setup_gengraph_dot_to_png
define setup_gengraph_dot_to_svg
$1_$2_DOT_SRC := $$($1_GENGRAPHS_DIR)/$2.dot
$1_$2_PNG_TARGET := $$($1_TARGET_DIR)/$2/module-graph.png
$1_$2_SVG_TARGET := $$($1_TARGET_DIR)/$2/module-graph.svg
# For each module needing a graph, create a png file from the dot file
# For each module needing a graph, create a svg file from the dot file
# generated by the GenGraphs tool and store it in the target dir.
$$(eval $$(call SetupExecute, gengraphs_png_$1_$2, \
$$(eval $$(call SetupExecute, gengraphs_svg_$1_$2, \
INFO := Running dot for module graphs for $2, \
DEPS := $$(gengraphs_$1_TARGET), \
OUTPUT_FILE := $$($1_$2_PNG_TARGET), \
OUTPUT_FILE := $$($1_$2_SVG_TARGET), \
SUPPORT_DIR := $$($1_GENGRAPHS_DIR), \
COMMAND := $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC), \
COMMAND := $$(DOT) -Tsvg -o $$($1_$2_SVG_TARGET) $$($1_$2_DOT_SRC), \
))
$1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
$1_MODULEGRAPH_TARGETS += $$($1_$2_SVG_TARGET)
endef
# Helper function to create the overview.html file to use with the -overview
@ -282,7 +282,7 @@ define SetupApiDocsGenerationBody
ifeq ($$(ENABLE_FULL_DOCS), true)
# Tell the ModuleGraph taglet to generate html links to soon-to-be-created
# png files with module graphs.
# svg files with module graphs.
$1_JAVA_ARGS += -DenableModuleGraph=true
endif
@ -362,8 +362,8 @@ define SetupApiDocsGenerationBody
$1_JAVADOC_TARGETS := $$(javadoc_$1_TARGET)
ifeq ($$(ENABLE_FULL_DOCS), true)
# We have asked ModuleGraph to generate links to png files. Now we must
# produce the png files.
# We have asked ModuleGraph to generate links to svg files. Now we must
# produce the svg files.
# Locate which modules has the @moduleGraph tag in their module-info.java
$1_MODULES_NEEDING_GRAPH := $$(strip $$(foreach m, $$($1_ALL_MODULES), \
@ -388,11 +388,11 @@ define SetupApiDocsGenerationBody
--dot-attributes $$(GENGRAPHS_PROPS), \
))
# For each module needing a graph, create a png file from the dot file
# For each module needing a graph, create a svg file from the dot file
# generated by the GenGraphs tool and store it in the target dir.
# They will depend on gengraphs_$1_TARGET, and will be added to $1.
$$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
$$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
$$(eval $$(call setup_gengraph_dot_to_svg,$1,$$m)) \
)
endif
endef

View File

@ -64,7 +64,7 @@ public class ModuleGraph implements Taglet {
}
String moduleName = ((ModuleElement) element).getQualifiedName().toString();
String imageFile = "module-graph.png";
String imageFile = "module-graph.svg";
int thumbnailHeight = -1;
String hoverImage = "";
if (!moduleName.equals("java.base")) {