Compare commits

...

145 Commits

Author SHA1 Message Date
Diomidis Spinellis e83df07d5f
Merge pull request #65 from VillePekka/patch-1
Fix typo in README.md
2025-12-01 00:30:52 +02:00
VillePekka e79f81666b
Fix typo in README.md
Comparisson => Comparison
2025-11-30 23:19:24 +01:00
Diomidis Spinellis 893fa38908
Add D2 and comparison links 2023-10-27 13:33:55 +03:00
Diomidis Spinellis a4fa650471
Add related tools 2023-06-13 15:23:31 +03:00
Diomidis Spinellis 606976778e [maven-release-plugin] prepare for next development iteration 2023-05-23 14:59:36 +03:00
Diomidis Spinellis 8d7a3e4b5c [maven-release-plugin] prepare release R6_0_0 2023-05-23 14:59:31 +03:00
Diomidis Spinellis 2a471e5b8c
Merge pull request #64 from laurentschoelens/java9
jdk9 migration fixes
2023-04-08 20:58:59 +03:00
Laurent SCHOELENS 42c648b596 fix findClass for UMLNoteOptions / UMLOptions unqualified classes 2023-03-28 18:58:28 +02:00
Laurent SCHOELENS 5a058a3ace more readable else if statement 2023-03-28 18:58:20 +02:00
Laurent SCHOELENS 24e5822d7b extra fix for typeparameters in classes 2023-03-28 13:14:18 +02:00
Laurent SCHOELENS 7147eaa5ed fix simpleName v. qualifiedName for packageProccesing 2023-03-28 10:48:09 +02:00
Diomidis Spinellis 62acb7337b
Merge pull request #63 from laurentschoelens/java9
jdk9 : bugfixes and update readme
2023-03-27 17:53:37 +03:00
Laurent SCHOELENS de056154bd remove reporter diagnostic / fix class graph / make javase api 9 default / fix package-list and element-list api fetch 2023-03-27 14:52:04 +02:00
Laurent SCHOELENS 27d7821666 fix generation with primitive array 2023-03-27 12:31:35 +02:00
Laurent SCHOELENS 16c1937aad update readme 2023-03-27 12:24:31 +02:00
Laurent SCHOELENS 70929da1d0 make some fixes after run on bigger project 2023-03-27 12:18:46 +02:00
Diomidis Spinellis 6115e12837
Merge pull request #62 from laurentschoelens/java9
jdk9 port of UMLGraph
2023-03-24 17:57:20 +02:00
Laurent SCHOELENS d273b6a3ef fix junit dep / jdk11+ build 2023-03-24 16:11:29 +01:00
Laurent SCHOELENS cd8c3629a1 version running jdk9 2023-03-24 14:55:50 +01:00
Laurent SCHOELENS c8f805bdef reformat classes 2023-03-21 09:15:55 +01:00
Laurent SCHOELENS d80597d547 remove .classpath / .project files and add it to .gitignore 2023-03-21 08:15:34 +01:00
Diomidis Spinellis 09576db5ae Merge branch 'master' of github.com:dspinellis/UMLGraph 2019-03-25 22:17:17 +02:00
Diomidis Spinellis 75cc871a10 Correct version extraction when tags are missing
Issue: #55
2019-03-25 22:16:02 +02:00
Erich Schubert 0967a91289 Add -hideprivateinner option 2018-11-03 23:06:36 +01:00
Erich Schubert 0ba1798ac5 Point out jitpack.io option to get jars. 2018-11-03 21:45:04 +01:00
Erich Schubert bab25cbe35 invalid xml 2018-11-03 20:41:56 +01:00
Diomidis Spinellis 26c9f9d1e5
Merge pull request #54 from kno10/java8
Larger refactorings
2018-11-01 22:38:46 +02:00
Erich Schubert e93b793bd6 Get rid of these margins, then we don't need port="p" anymore. 2018-10-28 13:34:16 +01:00
Erich Schubert e27eeb4bc3 Simplify classinfo handling. 2018-10-27 23:23:47 +02:00
Erich Schubert 867dec5d9c fixup dot formatting 2018-10-27 23:23:47 +02:00
Erich Schubert 1d03695f8e Produce simpler dot files, reduce code duplication in edge generation. 2018-10-27 23:23:47 +02:00
Erich Schubert 8b39c4614f Improve node naming of inner classes. 2018-10-27 23:23:46 +02:00
Erich Schubert 7169d40228 Add -hideGenerics option. 2018-10-27 23:23:46 +02:00
Erich Schubert dc18c503e9 Improve class info handling. 2018-10-27 23:23:46 +02:00
Erich Schubert c7d8648352 Cleanup classToUrl 2018-10-27 23:18:32 +02:00
Erich Schubert aa15be7405 Determine context package only once. 2018-10-27 23:18:32 +02:00
Erich Schubert 1925d2f1c7 More StringUtil functionality. 2018-10-27 23:18:32 +02:00
Erich Schubert 08b8976076 Caching is not necessary with current JavaDoc (8, maybe even earlier) 2018-10-27 23:18:31 +02:00
Erich Schubert 1b29f70460 Avoid having to add/remove hyphens for all options. 2018-10-27 23:18:31 +02:00
Erich Schubert 2f27948475 Refactor font handling. 2018-10-27 23:18:31 +02:00
Erich Schubert 7d9f665d07 Refactor shape into enum pattern. 2018-10-27 23:18:31 +02:00
Erich Schubert 9ddf84129a Move visibility symbols into Visibility class. 2018-10-27 23:18:31 +02:00
Erich Schubert a4ab6f179a Have relation styles in a single place. 2018-10-27 23:18:31 +02:00
Erich Schubert fe2c0c3df1 Streamline code, smaller optimizations. 2018-10-27 23:18:31 +02:00
Erich Schubert f3e945c646 Remove warning in code obsoleted by commit #a29ba215 2018-10-27 23:08:20 +02:00
Erich Schubert 141c8a9353 Trivial simplification. 2018-10-27 21:30:17 +02:00
Erich Schubert fc1b199daf Better error reporting. 2018-10-27 21:30:17 +02:00
Erich Schubert 1e52483a86 Postpone test failues, to first generate the pngs 2018-10-27 21:30:17 +02:00
Erich Schubert f1be5aaee8 add 'clean' ant target 2018-10-27 21:30:17 +02:00
Erich Schubert f7df826f53 fix broken test, where undeclared package was lost previously, now preserved 2018-10-27 21:30:17 +02:00
Erich Schubert 644d148455 Exit code on errors. 2018-10-27 21:30:17 +02:00
Erich Schubert e51f53b25e Add -qualifyGenerics to optionLength. 2018-10-26 21:17:21 +02:00
Erich Schubert a29ba21580 Fix active class shape broken by commit 1b4c9763 + add test.
This was easy to break, because of a non-obvious logic.

Instead we now use the hack of just using a too large rowspan.
2018-10-26 01:32:31 +02:00
Erich Schubert bca0ceae17 Cleanup Options: move defaults to declaration rather than constructor. 2018-10-25 00:18:28 +02:00
Erich Schubert 71f74d3093 Move some basic string processing helpers into StringUtil. 2018-10-25 00:18:28 +02:00
Erich Schubert 1b4c97630d Old merge error / duplicated line? 2018-10-25 00:18:28 +02:00
Erich Schubert 477d5cc58a Fail on test failures. 2018-10-25 00:18:28 +02:00
Diomidis Spinellis e5bc6f1f8f Exit with an error on structural differences 2018-10-24 13:34:33 +03:00
Diomidis Spinellis e2595350fd Correct build status icon URL 2018-10-24 13:11:59 +03:00
Diomidis Spinellis 8806b89cd8 Do not set OS type
This avoids the following error java.lang.Runtime.exec:
java.lang.Error: generic is not a supported OS platform.
2018-10-24 13:11:59 +03:00
Diomidis Spinellis 70a7580e2c Install GraphViz as a CI dependency 2018-10-24 12:52:55 +03:00
Diomidis Spinellis cb77d617e9 Remove unneeded deps 2018-10-24 12:47:57 +03:00
Diomidis Spinellis 13bb2d54bc Remove confusing duplicate file 2018-10-24 12:47:11 +03:00
Diomidis Spinellis 27baa4a6be Add Travis CI configuration 2018-10-24 12:45:09 +03:00
Diomidis Spinellis 3eb6f8d034 Convert README into markdown 2018-10-24 12:45:09 +03:00
Diomidis Spinellis b5238b3bdc
Merge pull request #52 from kno10/patch-qualify-generics
add -!qualifyGenerics option that strips package names only in generics
2018-10-24 12:25:55 +03:00
Erich Schubert 0477f4b82d add -!qualifyGenerics option that strips package names only in generics
This is useful in combination with `-qualify`;
in particular with `-qualify -postfixpackage`

This version also supports *inner* classes, where the outer class has a
generic.

Test case: `p1.Class<A extends g1.G>.Inner<B super g2.G>`

Depending on `-qualify` and `-qualifyGenerics` this can become either:
```
p1.Class<A extends g1.G>.Inner<B super g2.G>
p1.Class<A extends G>.Inner<B super G>
Class<A extends g1.G>.Inner<B super g2.G>
Class<A extends G>.Inner<B super G>
```
on the long run, it may however be convenient to also allow hiding
generics completely, and/or show them just as diamonds. For example
`Class<>.Inner<>` as a shorthand. Other users will prefer to see the
constraint only, e.g., `Class<G>.Inner<G>`... it may need a list of
different named formatters.
2018-10-24 10:55:35 +02:00
Diomidis Spinellis 5de652cfeb
Merge pull request #53 from kno10/patch-includes
Add an @opt include option for the package view.
2018-10-23 23:33:01 +03:00
Erich Schubert 0e69b7a40f Add an @opt include option for the package view. 2018-10-21 03:38:40 +02:00
Diomidis Spinellis 132f389bcf
Merge pull request #50 from kno10/patch-4
Avoid repeated lowercasing
2018-08-14 14:32:09 +03:00
Diomidis Spinellis 7cc92e6fa2
Merge pull request #49 from kno10/patch-3
Strip generics from parent classes properly, fixes #20
2018-03-28 17:24:36 +03:00
Erich Schubert 40b24774eb Strip generics from parent classes properly
Fixes the handling of non-static inner classes `Parent<A>.Child` if the parent has generics, #20
2018-03-28 16:04:44 +02:00
Erich Schubert 021dc34d8e Avoid repeated lowercasing 2018-03-28 16:03:15 +02:00
Diomidis Spinellis 5cd82f641e
Merge pull request #48 from kno10/patch-1
Remove -verbose2 from docs
2018-03-28 15:47:38 +03:00
Erich Schubert ce3847a1e6
Remove -verbose2 from docs
According to the changelog, this option was removed.
2018-03-26 17:56:51 +02:00
Diomidis Spinellis 40b5a687cc Merge branch 'master' and update test data
To match the new -!autosize parameter.
2017-03-21 19:53:36 +02:00
Diomidis Spinellis c0b7962170 Update test data due to JavaDoc changes
From javadoc 1.8.0_20 to 1.8.0_121
2017-03-21 19:48:49 +02:00
Diomidis Spinellis d744535438 Merge pull request #45 from robross0606/master
Added "-autosize" parameter and fixed parameter matching bug with "!"
2017-03-21 19:47:26 +02:00
Robert Ross 160a7db3a7 Added "-autosize" parameter and fixed parameter matching bug with "!" 2017-03-21 13:20:15 -04:00
Diomidis Spinellis 5e854d5667 Merge pull request #43 from adrianN/patch-1
Update index.html
2017-03-15 17:49:19 +02:00
Adrian Neumann 962ad5af72 Update index.html
fix typo
2017-03-15 16:46:24 +01:00
Diomidis Spinellis e307530d8e Correct UMLGraph location 2016-10-24 20:38:25 +03:00
Diomidis Spinellis 6211164ca2 Merge pull request #34 from gousiosg/patch-1
Update documentation
2016-09-20 17:07:34 +03:00
Georgios Gousios 37dc189a29 s/SQO-OSS/Alitheia Core/
Also, add link to the annotated source code.
2016-09-20 15:05:14 +02:00
Diomidis Spinellis d0ede46da8 Correct URL 2016-09-16 23:47:03 +03:00
Diomidis Spinellis 30a611ec91 Update project web page location 2016-09-16 23:38:47 +03:00
Diomidis Spinellis a72c88fb70 Running testupdate requires bash 2016-09-16 23:34:03 +03:00
Diomidis Spinellis 09fab1724d Add reference to textual UML tool survey 2016-06-09 08:10:13 +03:00
Diomidis Spinellis db1a918e16 Remove repeated @override 2016-06-07 17:23:40 +03:00
Diomidis Spinellis ff13af7ea6 Merge pull request #32 from DevFactory/release/remove-dead-stores-fix-1
[squid:S1854] Dead stores should be removed
2016-06-07 17:22:20 +03:00
Diomidis Spinellis c4713960af Merge pull request #31 from DevFactory/release/replace-synchronized-classes-fix-1
[squid:S1149] Synchronized classes Vector, Hashtable, Stack and StringBuffer should not be used
2016-06-07 17:21:55 +03:00
Diomidis Spinellis a0ed8a2672 Merge pull request #30 from DevFactory/release/add-missing-override-annotation-fix-1
[squid:S1161] "@Override" annotation should be used on any method overriding (since Java 5) or implementing (since Java 6) another one
2016-06-07 17:21:36 +03:00
Diomidis Spinellis c4f32a5a74 Update test reference files 2016-06-07 17:20:48 +03:00
Diomidis Spinellis 86574a7824 Update Sun to Oracle URLs 2016-06-07 16:41:55 +03:00
Diomidis Spinellis 4425596017 Merge branch 'master' of github.com:dspinellis/UMLGraph 2016-06-07 16:10:47 +03:00
ayman abdelghany 1ec3be2f98 [squid:S1149] Synchronized classes Vector, Hashtable, Stack and StringBuffer should not be used 2016-06-07 14:12:05 +02:00
ayman abdelghany 105db10e1a [squid:S1854] Dead stores should be removed 2016-06-07 14:07:16 +02:00
ayman abdelghany 9f25167880 [squid:S1161] "@Override" annotation should be used on any method overriding (since Java 5) or implementing (since Java 6) another one 2016-06-07 14:04:11 +02:00
Diomidis Spinellis 23e7da7ca5 Merge pull request #15 from frankgrimes97/svg-uml-output
Output as SVG instead of PNG and minor cosmetic fixes.
2015-11-01 13:09:52 +02:00
Diomidis Spinellis 49a3f570bf Document package diagram generation 2015-10-05 15:14:30 +03:00
Diomidis Spinellis 93e69a4e24 Make umlgraph shell script work under Cygwin 2015-10-05 14:23:19 +03:00
Diomidis Spinellis ee82a7fd20 Update URLs for Javadoc and GraphViz 2014-10-29 09:23:04 +02:00
Diomidis Spinellis 17ab5f89f2 Update version 2014-10-29 00:19:04 +02:00
Diomidis Spinellis 9039a0011b [maven-release-plugin] prepare for next development iteration 2014-10-29 00:04:30 +02:00
Diomidis Spinellis 6700c90fe2 [maven-release-plugin] prepare release R5_7_2 2014-10-29 00:04:24 +02:00
Diomidis Spinellis 691cf7fe69 Add Version.java
Although it's auto-generated Maven wants it under SCM.
2014-10-29 00:03:19 +02:00
Diomidis Spinellis e2d2529ce6 [maven-release-plugin] prepare for next development iteration 2014-10-28 23:45:58 +02:00
Diomidis Spinellis 0a37b4e98f [maven-release-plugin] prepare release R5_7_1 2014-10-28 23:45:53 +02:00
Diomidis Spinellis 3c92579f87 Prepare snapshot for release 2014-10-28 23:45:25 +02:00
Diomidis Spinellis 43517f2a6d Merge branch 'master' of github.com:dspinellis/UMLGraph 2014-10-28 23:44:31 +02:00
Diomidis Spinellis ee39c4bca8 [maven-release-plugin] prepare release R5_7_1 2014-10-28 23:43:29 +02:00
Diomidis Spinellis 91157698e3 [maven-release-plugin] prepare release R5_7_1 2014-10-28 23:40:37 +02:00
Diomidis Spinellis d88df8470f Changes for deployment
See http://central.sonatype.org/pages/apache-maven.html
2014-10-28 23:38:59 +02:00
Diomidis Spinellis e5d0ce31d3 Add tags rule 2014-10-28 22:58:28 +02:00
Diomidis Spinellis 0a8e4a2481 Use OpenSSL for MD5 checksums 2014-10-28 21:54:52 +02:00
Diomidis Spinellis 0bf2c1e440 Use ActiveState Perl for doc building
Required for syntax coloring.
2014-10-28 21:53:01 +02:00
Diomidis Spinellis 76c7c6290c Update regression test reference files
Verified with:
for i in `cd dot-ref ; ls *.dot`; do ../tools/viscompare.sh $i; done

Some differences having to do with inference were found.  It is not
clear which version is correct.
2014-10-28 20:26:12 +02:00
Diomidis Spinellis 786d98cd71 Do not update files for trivial differences 2014-10-28 20:15:40 +02:00
Diomidis Spinellis abeb6c22e0 Update reference data test update for git 2014-10-28 20:07:01 +02:00
Diomidis Spinellis b23a483c1e Update diff for lowercase tag names 2014-10-28 20:01:04 +02:00
Diomidis Spinellis f687058ca3 Bring back comma that got lost in 52d95c3c 2014-10-28 19:54:57 +02:00
Diomidis Spinellis cc22b016ef Introduce required JavaDoc class path 2014-10-28 19:53:39 +02:00
Diomidis Spinellis ade4d6dfc6 Fix build/run of regression tests 2014-10-28 19:44:15 +02:00
Diomidis Spinellis d76d42066a Remove generics warning 2014-10-28 19:43:55 +02:00
Diomidis Spinellis 7fc14a491e Fix includeantruntime warning
Simple set its value to false.
See http://stackoverflow.com/questions/5103384/ant-warning-includeantruntime-was-not-set
2014-10-28 19:25:57 +02:00
Diomidis Spinellis da4d335f38 Remove obsolete variable 2014-10-28 19:07:44 +02:00
Diomidis Spinellis de854f562b Remove obsolete RCS tagging 2014-10-28 17:49:24 +02:00
Diomidis Spinellis fe9ac58af1 Disable importedClasses deprecation warning
In our case an attempt to get the imported classes is justified.
Although they are an implementation detail, we document the
implementation.
2014-10-28 17:23:47 +02:00
Diomidis Spinellis a8b1f1ff46 Remove auto-generated file 2014-10-28 17:07:14 +02:00
Diomidis Spinellis fa40aaf731 Get rid of Java generics warning
Casts are still needed, because Properties extends
Hashtable<Object, Object> instead of Hashtable<String, String>.
2014-10-28 17:04:59 +02:00
Diomidis Spinellis d46829bb01 Add methods required by Java 1.8 2014-10-28 16:38:14 +02:00
Diomidis Spinellis ac69e12d7a Remove obsolete RCS/CVS $Id$
Command used:
sed -i '/^# \$Id\$$/d;/^ \* \$Id\$$/d;/^<!-- \$Id\$ -->$/d;/\/\/ \$Id\$/d' $(fgrep -l \$Id $(git ls-files))
2014-10-28 16:29:43 +02:00
Diomidis Spinellis c1d994d650 Merge pull request #18 from tischda/master
check if source and dest are not already linked
2014-03-06 09:23:44 +02:00
Daniel TISCHER 52d95c3cc3 workaround empty label problem 2014-02-10 13:43:08 +01:00
Daniel TISCHER 8d77597da5 workaround for http://www.graphviz.org/mantisbt/view.php?id=2421 2014-02-09 11:50:05 +01:00
Daniel TISCHER a463b627fb check if source and dest are not already linked 2014-02-09 11:18:57 +01:00
Diomidis Spinellis 3bdff0e55b Fix float clearing for Chrome
Error pointed by: @gousiosg
2013-11-14 03:12:48 +02:00
Emanuel Pordes 44a146c03d Added width and height to svg object tag 2013-10-15 15:28:17 -04:00
Emanuel Pordes 41d93e14f6 Fix variable naming 2013-10-11 15:50:54 -04:00
Emanuel Pordes e58589e4c0 Output as SVG instead of PNG and minor cosmetic fixes. 2013-10-11 14:26:56 -04:00
Diomidis Spinellis 6202d34fa6 Merge pull request #14 from real-prometheus/master
Added support for options tags in ContextView and PackageView using the ...
2013-08-23 00:15:57 -07:00
real-prometheus 0435986b92 Added support for options tags in ContextView and PackageView using the UmlGraphDoc docklet for javadoc generation with integrated Uml. 2013-08-23 02:27:53 +02:00
Diomidis Spinellis bd246d364f Maven-related changes 2013-08-11 15:28:13 +03:00
Diomidis Spinellis e8b54cfde9 Add GitHub ribbon 2013-08-11 15:27:36 +03:00
Diomidis Spinellis 9240c4a012 [maven-release-plugin] prepare for next development iteration 2013-05-23 20:32:03 +03:00
226 changed files with 5775 additions and 4876 deletions

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="JDK_LIB/tools.jar"/>
<classpathentry kind="output" path="build"/>
</classpath>

31
.gitignore vendored
View File

@ -1,15 +1,18 @@
.settings
build
lib
javadoc
UMLGraph-snapshot*
UMLGraph-R*
CHECKSUM.MD5
_vimrc
target
*.iml
*.iws
*.ipr
*.swp
*.DS_Store
*.iml
*.ipr
*.iws
*.swp
.idea
.settings
.project
.classpath
_vimrc
build
CHECKSUM.MD5
javadoc
lib
TAGS
target
UMLGraph-R*
UMLGraph-snapshot*

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>umlgraph_cvs</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

10
.travis.yml Normal file
View File

@ -0,0 +1,10 @@
language: java
addons:
apt:
packages:
- graphviz
install: ant
script: ant test

View File

@ -1,14 +1,9 @@
#
# $Id$
#
VERSION:=$(shell git describe --abbrev=6 HEAD | sed 's/R//;s/_/./;s/-/./;s/-.*$$/-SNAPSHOT/')
TAGVERSION=$(shell echo $(VERSION) | sed 's/\./_/g')
BALL_TAR_GZ=UMLGraph-$(VERSION).tar.gz
ZIPBALL=UMLGraph-$(VERSION).zip
DISTDIR=UMLGraph-$(VERSION)
WEBDIR=$(UH)/dds/pubs/web/home/sw/umlgraph-mirror
DOCLETSRCPATH=src/org/umlgraph/doclet
WEBDIR=$(UH)/dds/pubs/web/home/umlgraph
DOCLETSRCPATH=src/main/java/org/umlgraph/doclet
DOCLETSRC= \
$(DOCLETSRCPATH)/ClassGraph.java \
$(DOCLETSRCPATH)/ClassInfo.java \
@ -17,14 +12,12 @@ DOCLETSRC= \
$(DOCLETSRCPATH)/UmlGraph.java \
$(DOCLETSRCPATH)/Version.java
TESTSRC = \
src/org/umlgraph/test/DotDiff.java \
src/org/umlgraph/test/BasicTest.java
src/main/java/org/umlgraph/test/DotDiff.java \
src/main/java/org/umlgraph/test/BasicTest.java
PICFILE=sequence.pic
README=README.txt
LICENSE=LICENSE
OTHERSRC=index.html build.xml Makefile oldversion.html
# Files to tag
ALLTAG=$(DOCLETSRC) $(TESTSRC) $(PICFILE) $(README) $(LICENSE) $(OTHERSRC)
# Documentation location (release)
ifeq ($(VERSION),snapshot)
DOC=snapshot-doc
@ -72,7 +65,7 @@ test:
ant test
testupdate:
sh tools/testupdate.sh
bash tools/testupdate.sh
# Create only the static HTML pages
static-web:
@ -89,8 +82,8 @@ web: $(BALL_TAR_GZ) CHECKSUM.MD5
tar cf - javadoc | tar -C $(WEBDIR) -xvf -
CHECKSUM.MD5: $(BALL_TAR_GZ) $(JARFILE)
md5 legacy/UMLGraph-2.10.* legacy/UMLGraph-4.8.* UMLGraph-$(VERSION).* >CHECKSUM.MD5
(cd lib ; md5 UmlGraph.jar) >>CHECKSUM.MD5
openssl md5 legacy/UMLGraph-2.10.* legacy/UMLGraph-4.8.* UMLGraph-$(VERSION).* >CHECKSUM.MD5
(cd lib ; openssl md5 UmlGraph.jar) >>CHECKSUM.MD5
tag:
rcs -nV$(TAGVERSION): $(ALLTAG)
tags:
etags **/*.java

69
README.md Normal file
View File

@ -0,0 +1,69 @@
# UMLGraph - Declarative Drawing of UML Diagrams
*UMLGraph* allows the declarative specification and drawing of UML diagrams.
You can browse the system's documentation
through [this link](http://www.spinellis.gr/umlgraph/doc/index.html),
or print it through [this link](http://www.spinellis.gr/umlgraph/doc/indexw.html).
In order to run *UMLGraph*, you need to have [GraphViz](https://www.graphviz.org/)
installed in your system path. On most Linux distributions, this can be easily
installed using the regular package manager.
To compile the Java doclet from the source code run *ant* on the
*build.xml* file.
If you change the source code, you can run regression tests by
executing *ant test*.
Visit the project's [home page](http://www.spinellis.gr/umlgraph) for more information.
## Compatibility
If you build against Java 8, please use latest version of 5.X of the Doclet.
Since Java 9 doclet APIs where completely rewritten, the Doclet in version 6 supports only supports Java 9 and above.
## Development versions
In order to use development versions, you can use [JitPack](https://jitpack.io/#dspinellis/UMLGraph/master-SNAPSHOT).
Note that as this is compiled on demand, you may sometimes see a "Read timed out" when the package is recompiled,
and it should be fine a few seconds later. And because the master branch can change any time, you may want to use
a versioned snapshot instead (see the Jitpack documentation for details).
**Gradle**:
```
repositories { maven { url 'https://jitpack.io' } }
configurations { umlgraph }
dependencies { umlgraph 'com.github.dspinellis:UMLGraph:master-SNAPSHOT' }
javadoc {
doclet = 'org.umlgraph.doclet.UmlGraphDoc'
docletpath = configurations.umlgraph.files.asType(List)
tags("hidden:X", "opt:X", "has:X", "navhas:X", "assoc:X", "navassoc:X",
"composed:X", "navcomposed:X", "stereotype:X", "depend:X")
}
```
**Maven**:
```
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
...
<dependency>
<groupId>com.github.dspinellis</groupId>
<artifactId>UMLGraph</artifactId>
<version>master-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
```
**Jar download**: <https://jitpack.io/com/github/dspinellis/UMLGraph/master-SNAPSHOT/UMLGraph-master-SNAPSHOT.jar>
## See also
* [D2: Declarative Diagraming](https://d2lang.com/) (Emphasis on aesthetics and extensionability)
* [Mermaid diagramming and charting tool](https://mermaid.js.org/) (JavaScript-based; easier syntax, good Markdown integration; interactive diagrams)
* [PlantUML](https://plantuml.com/) (Java-based; supports IDEs and more diagram types)
* [Comparison of textual diagraming systems](https://text-to-diagram.com/)

View File

@ -1,23 +0,0 @@
==UMLGraph - Declarative Drawing of UML Diagrams==
''UMLGraph'' allows the declarative specification and drawing of
UML diagrams.
You can browse the system's documentation
through [http://umlgraph.org/doc/index.html this link],
or print it through [http://umlgraph.org/doc/indexw.html this link].
To install the elements required to run ''UMLGraph'', simply copy
the contents of the ''lib'' directory to a location consistent with
your installation's conventions (for example to /usr/local/lib).
To compile the Java doclet from the source code run ''ant'' on the
''build.xml'' file.
If you change the source code, you can run regression tests by
executing ''ant test''.
Visit the project's [http://www.umlgraph.org home page] for more information.
----
Diomidis Spinellis - November 2005, August 2008, April 2012

View File

@ -1,21 +0,0 @@
UMLGraph - Declarative Drawing of UML Diagrams
UMLGraph allows the declarative specification and drawing of
UML class and sequence diagrams. You can browse the system's
documentation from the doc/index.html page, or print it from
doc/indexw.html.
To install the elements required to run UMLGraph, simply copy
the contents of the lib directory to a location consistent with
your installation's conventions (for example to /usr/local/lib).
To compile the Java doclet from the source code run ant on the
build.xml file.
If you change the source code, you can run regression tests by
executing "ant test".
Project home page: http://www.umlgraph.org
GitHub page: git@github.com:dspinellis/UMLGraph.git
Diomidis Spinellis - November 2005, August 2008, April 2012

7
TODO
View File

@ -1,7 +1,3 @@
$Id$
When UMLGraph 2.29 comes out use <i></i> for italic fonts?
http://stackoverflow.com/questions/8609546/umlgraph-not-automatic-integrated-in-javadoc
Support for all UML diagrams: state, use-case, etc.
@ -10,6 +6,9 @@ State diagrams:
See state-example.dot
See also http://forrst.com/posts/State_Machine_Dont_abuse_the_if-1fE
Note that Hierarchically nested states cannot be shown in GraphViz,
because you can't set shape and labels in cluster, nor can they act
as edge targets.
Add in UmlGraphDoc support for showing package dependencies.
See http://java.dzone.com/articles/reverse-engineer-source-code-u#comment-6124

View File

@ -3,11 +3,11 @@
<description>
The specification for the Java-based umlgraph build processes.
$Id$
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="src" location="src/main/java"/>
<property name="testsrc" location="src/test"/>
<property name="build" location="build"/>
<property name="javadoc" location="javadoc"/>
<property name="lib" location="lib"/>
@ -21,12 +21,12 @@
<macrodef name="gitversion" description="Get git version.">
<attribute name="outputproperty"/>
<sequential>
<echo message="git describe --abbrev=6 => '@{outputproperty}'"/>
<echo message="git rev-parse --short=6 => '@{outputproperty}'"/>
<exec executable="git"
failonerror="true"
outputproperty="@{outputproperty}">
<arg value="describe"/>
<arg value="--abbrev=6"/>
<arg value="rev-parse"/>
<arg value="--short=6"/>
<arg value="HEAD"/>
<redirector>
<outputfilterchain>
@ -64,6 +64,14 @@
<!-- import environment variables -->
<property environment="env"/>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${lib}"/>
<delete dir="testdata/dot-out"/>
<delete dir="${javadoc}"/>
<delete dir="${dist}/lib"/>
</target>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
@ -78,8 +86,8 @@
<target name="version">
<exec executable="git"
outputproperty="VERSION">
<arg value="describe"/>
<arg value="--abbrev=6"/>
<arg value="rev-parse"/>
<arg value="--short=6"/>
<arg value="HEAD"/>
</exec>
<echo>Version is ${VERSION}</echo>
@ -91,8 +99,12 @@ class Version { public static String VERSION = "${VERSION}";}
<target name="compile" depends="init,version"
description="compile the source, build library " >
<javac srcdir="${src}" destdir="${build}" debug="true" deprecation="true" >
<javac srcdir="${src}" destdir="${build}" debug="true"
deprecation="true" includeantruntime="false" >
<compilerarg value="-Xlint"/>
<classpath>
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
</classpath>
</javac>
<jar basedir="${build}" destfile="${lib}/UmlGraph.jar" includes="org/umlgraph/doclet/*.class">
<manifest>
@ -102,38 +114,57 @@ class Version { public static String VERSION = "${VERSION}";}
</jar>
</target>
<target name="test" depends="compile"
description="run the regression tests" >
<java classname="org.umlgraph.test.BasicTest" fork="true">
<target name="testcompile" depends="init"
description="compile the test code " >
<javac srcdir="${testsrc}" destdir="${build}" debug="true"
deprecation="true" includeantruntime="false" >
<classpath>
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
<pathelement location="${build}"/>
<pathelement location="${lib}/UmlGraph.jar"/>
</classpath>
</java>
<java classname="org.umlgraph.test.UmlDocTest" fork="true">
<classpath>
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
<pathelement location="${build}"/>
<pathelement location="${lib}/UmlGraph.jar"/>
</classpath>
</java>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="test" depends="compile,testcompile"
description="run the regression tests" >
<!-- postpone failures, so we get to see the pngs -->
<java classname="org.umlgraph.test.BasicTest" fork="true" resultproperty="BasicTest.exit">
<classpath>
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
<pathelement location="${build}"/>
<pathelement location="${lib}/UmlGraph.jar"/>
</classpath>
</java>
<java classname="org.umlgraph.test.UmlDocTest" fork="true" resultproperty="UmlDocTest.exit">
<classpath>
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
<pathelement location="${build}"/>
<pathelement location="${lib}/UmlGraph.jar"/>
</classpath>
</java>
<apply executable="dot" dest="${testout}" parallel="false">
<arg value="-Tpng"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${testout}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
<fileset dir="${testout}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
</apply>
<apply executable="dot" dest="${testref}" parallel="false">
<arg value="-Tpng"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${testref}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
<fileset dir="${testref}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
</apply>
<!-- postponed failure, so we get to see the pngs -->
<fail message="BasicTest failed">
<condition><not><equals arg1="0" arg2="${BasicTest.exit}"/></not></condition>
</fail>
<fail message="UmlDocTest failed">
<condition><not><equals arg1="0" arg2="${UmlDocTest.exit}"/></not></condition>
</fail>
</target>
<target name="javadocs" depends="compile">
@ -141,6 +172,7 @@ class Version { public static String VERSION = "${VERSION}";}
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${lib}/UmlGraph.jar">
<param name="-inferrel"/>
<param name="-inferdep"/>
<param name="-autosize"/>
<param name="-collapsible"/>
<param name="-hide" value="java.*"/>
<param name="-collpackages" value="java.util.*"/>

View File

@ -13,7 +13,6 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id$
#
.PS

View File

@ -1,11 +1,10 @@
#
# $Id$
#
ROOT=/cygdrive/c
PIC2PLOT=pic2plot
GS=gs
DESTDIR=/dds/pubs/web/home/sw/umlgraph-mirror
DESTDIR=/dds/pubs/web/home/umlgraph
NOTETOOLS=/dds/pubs/Courses/tools
GIF := $(shell sed -n 's/.*<img *src *= *"\([^.]*\.gif\)".*/\1/p' *.xml)
XML := $(wildcard *.xml)
@ -39,7 +38,7 @@ DOC?=snapshot-doc
all: sequence.pic $(GIF) $(XML)
sh $(ROOT)/$(NOTETOOLS)/coursebib.sh bib
echo "Drawing UML Diagrams with UMLGraph" | perl $(NOTETOOLS)/thread.pl -n -h html -r -p ../index.html index ${DESTDIR}/${DOC}
echo "Drawing UML Diagrams with UMLGraph" | /c/Perl/bin/perl $(NOTETOOLS)/thread.pl -n -h html -r -p ../index.html index ${DESTDIR}/${DOC}
sequence.pic: ../sequence.pic
perl -p -e 'BEGIN {binmode(STDOUT);} s/\r//' $< >$@

View File

@ -1,5 +1,4 @@
// Author: Vadim Nasardinov
// Version: $Id$
import java.util.List;
import java.util.Map;

View File

@ -1,6 +1,5 @@
// Author: Vadim Nasardinov
// Author: Andrea Aime
// Version: $Id$
import java.util.List;
import java.util.Map;
@ -64,4 +63,4 @@ class DetailedView {}
/**
* @view
*/
class Overview {}
class Overview {}

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<p>
UMLGraph was developed and is being maintained by
@ -47,6 +46,7 @@ UMLGraph would not be in its current state without their contributions.
<li>Soraya Santana de la Fe</li>
<li>Jonathan R. Santos</li>
<li>Jan Schl&#252;ter</li>
<li>Erich Schubert</li>
<li>Sebastian Setzer</li>
<li>J&#246;rn Guy S&#252;&#223;</li>
<li>Andreas Studer</li>

View File

@ -1,7 +1,6 @@
/*
* Advanced relationships
* UML User Guide p. 137
* $Id$
*/
/**

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
To run the UMLGraph doclet from <em>ant</em>, use a rule,
like the following.

View File

@ -1,4 +1,3 @@
// $Id$
/**
* Associations with visibility

View File

@ -110,3 +110,14 @@
Note="Available online \url{http://java.dzone.com/articles/reverse-engineer-source-code-u}",
Author="Meera Subbarao"
}
@CONFERENCE{SG16,
author={Seifermann, S. and Groenda, H.},
title={Survey on textual notations for the Unified Modeling Language},
journal={MODELSWARD 2016 - Proceedings of the 4th International Conference on Model-Driven Engineering and Software Development},
year={2016},
pages={28--39},
note={cited By 0},
url={https://www.cooperate-project.de/images/publications/MODELSWARD2016.pdf},
document_type={Conference Paper},
}

View File

@ -1,4 +1,3 @@
// $Id$
class Tyre {}
class Engine {}

View File

@ -1,6 +1,5 @@
/*
* Interface and generalization relationships in Jakarta Catalina
* $Id$
*/
/**

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-7" ?>
<!-- $Id$ -->
<notes>
One specifies a class diagram using the Java syntax complemented by
<a href="http://java.sun.com/j2se/javadoc/"><em>javadoc</em></a>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The UMLGraph class diagrams allows you to model
<ul>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
In UMLGraph you can easily add a note (comment) to an element,
using the <code>@note</code> tag.

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
UMLGraph's input follows the Java syntax and semantics.
However,
@ -73,6 +72,14 @@ Example:
java -jar /usr/jvm/java-1.5.0/lib/UmlGraph.jar -private Simple.java
</fmtcode>
<p />
To generate a diagram of all classes in the package specify as arguments
to the Java invocation the name of the package and the directory where
it resides.
The following example generates a diagram of all UMLGraph classes.
<fmtcode ext="sh">
java -classpath ... org.umlgraph.doclet.UmlGraph -sourcepath src/main/java org.umlgraph.doclet
</fmtcode>
<p />
Specifying some packages before the list of source files will designate
those packages as <em>local</em>.
When you specify a package list,

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Since the options are really a part of the generated graph you
want in many cases to include them in the diagram specification.

View File

@ -1,10 +1,10 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
A number of options contol the operation of UMLGraph
A number of options control the operation of UMLGraph
class diagram generator.
These can be specified on the command line, and most can also
be specified through javadoc tags within the diagram, affecting all or some elements.
be specified through javadoc <code>@opt</code> tags within the diagram, affecting all or some elements.
Most have a negated version by prefixing an exclamation mark.
<p/>
<h2>What Gets Drawn</h2> <!-- {{{1 -->
<dl>
@ -28,8 +28,12 @@ be specified through javadoc tags within the diagram, affecting all or some elem
in this case it will hide everything (useful in the context of views
to selectively unhide some portions of the graph, see the view chapter for
further details). </dd>
<dt>-include</dt><dd>Match classes to include with a non-anchored match. This is weaker than
the <code>-hide</code> option, but can be used to include classes from foreign packages
in the package view (which would by default filter to only include package members).</dd>
<dt>-operations</dt><dd>Show class operations (Java methods) </dd>
<dt>-qualify</dt><dd>Produce fully-qualified class names. </dd>
<dt>-qualifyGenerics</dt><dd>Use fully-qualified class names in Java generics.</dd>
<dt>-types</dt><dd>Add type information to attributes and operations </dd>
<dt>-view</dt><dd>Specify the fully qualified name of a class that contains
a view definition. Only the class diagram specified by this view will be generated.
@ -40,6 +44,7 @@ be specified through javadoc tags within the diagram, affecting all or some elem
<h2>Visual Appearance</h2> <!-- {{{1 -->
<dl>
<dt>-bgcolor</dt><dd>Specify the graph's background color. </dd>
<dt>-autosize</dt><dd>Fits generated graph to the width of the page/window. Defaults to true. </dd>
<dt>-collapsible</dt><dd>Enhance the javadoc HTML files containing UML diagrams with Javascript that provides a link for showing the (initially collapsed) diagrams. </dd>
<dt>-edgecolor</dt><dd>Specify the color for drawing edges. </dd>
<dt>-edgefontcolor</dt><dd>Specify the font color to use for edge labels. </dd>
@ -78,9 +83,9 @@ be specified through javadoc tags within the diagram, affecting all or some elem
<p />
All colors can be either a symbolic name (e.g. blue),
a tripple specifying hue-saturation-brightness as values 0-1
a triple specifying hue-saturation-brightness as values 0-1
(e.g. ".13 0.9 1"),
or a tripple specifying red-green-blue values as hexadecimal
or a triple specifying red-green-blue values as hexadecimal
digits prefixed by a # (e.g. "#ff8020").
The symbolic color names are derived from the X Windows System;
you can find a complete list in the
@ -183,10 +188,6 @@ When using <em>dot</em> to generate SVG diagrams you should specify
<code>UTF-8</code> as the output encoding, to have guillemots correctly
appearing in the resulting SVG.
</dd>
<dt>-verbose2</dt><dd>Will print on the standard output details regarding
the progress of graph generation.
(Note that -verbose is a javadoc option with a different meaning).
</dd>
</dl>
<!-- Footer {{{1 -->
</notes>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
UmlGraphDoc is a standard doclet wrapper that combines
the standard doclet output (javadoc documentation) along with auto-generated

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<table>
<tr><td>
@ -32,7 +31,7 @@ class SetTopController implements URLStreamHandler {
void connect() {}
}
/** @depend - <friend> - SetTopController */
/** @depend - &lt;friend&gt; - SetTopController */
class ChannelIterator {}
interface URLStreamHandler {

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<table>
<tr><td>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<fmtcode ext="java">
/*

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<table>
<tr><td>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" ?>
<!-- $Id: ceg-schema.xml,v 1.1 2005/11/23 22:21:22 dds Exp $ -->
<notes>
The following was generated by annotating the source code of the
<a href="http://www.sqo-oss.org">SQO-OSS</a> project.
The following was generated by annotating the
<a href="https://github.com/istlab/Alitheia-Core/tree/master/alitheia/core/src/main/java/eu/sqooss/service/db">source code</a> of the
<a href="https://github.com/istlab/Alitheia-Core/">Alitheia Core</a> project.
Georgios Gousios, who created it, wrote:
<blockquote>
<p>
I've used UMLgraph to generate an E-R diagram out of the DAOs we use in SQO-OSS. I've just annotated a few classes with @assoc tags, removed the super class DAObject from all entities with sed, did some tweaking by hand in the .dot output, et voila, an E-R depicting almost 30 classes in less than 30 minutes!
I've used UMLgraph to generate an E-R diagram out of the DAOs we use in Alitheia Core. I've just annotated a few classes with @assoc tags, removed the super class DAObject from all entities with sed, did some tweaking by hand in the .dot output, et voila, an E-R depicting almost 30 classes in less than 30 minutes!
</p>
</blockquote>
<p />

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<table>
<tr><td>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<table>
<tr><td>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<table>
<tr><td>
@ -21,8 +20,8 @@ class UMLOptions {}
class Person {
House[] houses;
List<Dog> dogs;
List&lt;Dog&gt; dogs;
public Room getFavouriteRoom(House house) {}
}
@ -30,7 +29,7 @@ class Person {
* @opt inferreltype composed
*/
class House {
Map<String, Room> nameRoomMap;
Map&lt;String, Room&gt; nameRoomMap;
}
class Room {}
@ -38,7 +37,6 @@ class Room {}
class Dog {
Person owner;
}
</fmtcode>
</td><td>
<img src="infer.png" alt="UML diagram with relationship inference" />

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Vadim Nasardinov noted that an advantage of UMLGraph over many
GUI-oriented UML drawing tools is the ability
@ -16,7 +15,6 @@ a Makefile illustrates a way to organize this process.
<h2>Java Description</h2>
<fmtcode ext="java">
// Author: Vadim Nasardinov
// Version: $Id$
import java.util.List;
import java.util.Map;
@ -63,8 +61,7 @@ class DataOperation extends Element {}
<fmtcode ext="mak">
# Author: Vadim Nasardinov (vadimn@redhat.com)
# Since: 2004-05-26
# Version: $Id$
# See: http://www.spinellis.gr/sw/umlgraph/doc/ceg-mv.html
# See: http://www.spinellis.gr/umlgraph/doc/ceg-mv.html
# Requires: graphviz
# Requires: javadoc
@ -96,18 +93,18 @@ clean:
build/%.dot : %.java
mkdir -p $(dir $@)
$(jd) $(jd_flags) $(detailed_flags) -output $@ $<
$(jd) $(jd_flags) $(detailed_flags) -output $@ $&lt;
build/%-small.dot : %.java
mkdir -p $(dir $@)
$(jd) $(jd_flags) -output $@ $<
$(jd) $(jd_flags) -output $@ $&lt;
%.png : %.dot
dot -Nheight=0.2 -Elabelfontcolor=DarkSlateBlue -Elabelfontsize=8 -Tpng -o $@ $<
dot -Nheight=0.2 -Elabelfontcolor=DarkSlateBlue -Elabelfontsize=8 -Tpng -o $@ $&lt;
build/%.png : %.fig
mkdir -p $(dir $@)
fig2dev -L png -S 4 $< $@
fig2dev -L png -S 4 $&lt; $@
dot: $(dot_files)
@ -115,7 +112,7 @@ png: $(png_files)
build/%.png : %.png
mkdir -p $(dir $@)
cp $< $@
cp $&lt; $@
# Example usage:
# make debug-java_files

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<table>
<tr><td>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<fmtcode ext="java">
/**

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<table>
<tr><td>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The makefile-based multiple view example can be generated by using internal
view support by means of the following sources (note the use of UmlOptions
@ -9,7 +8,6 @@ diagrams at different detail level).
<fmtcode ext="java">
// Author: Vadim Nasardinov
// Author: Andrea Aime
// Version: $Id$
import java.util.List;
import java.util.Map;

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Views are especially interesting in big projects, since they allow to
generate package specific diagrams and overview diagrams in a quick and

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Views are special classes that allow the generation of a custom class
diagram based on a set of diagram global options and a set of option

View File

@ -1,4 +1,3 @@
// $Id$
/**
* @opt nodefillcolor ".13 .9 1"

View File

@ -1,7 +1,6 @@
/*
* Class stereotypes and tagged values
* UML User Guide p. 439
* $Id$
*/
/**

View File

@ -1,4 +1,3 @@
// $Id$
/**
* @opt edgecolor "yellow"

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Here are other programs or efforts that build on UMLGraph's
code or ideas.

View File

@ -1,6 +1,5 @@
# UML Distilled: Figure 5-2 p. 70
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The following diagram, based on the diagram appearing on p. 70 of
UML Distilled, contains self calls, object activation,

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The following diagram, illustrates the operating system calls of
a typical DNS query.
@ -17,7 +16,6 @@ drawing facility.
#
# DNS query collaboration diagram
#
# $Id$
#
.PS

View File

@ -4,7 +4,6 @@
#
# DNS query collaboration diagram
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<!--

View File

@ -1,7 +1,6 @@
/*
* Generalisation
* UML User Guide p. 141
* $Id$
*/
/* Basic categorisations */

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The following sequence diagram demonstrates the use of the frame and comment elements.
<h2>Diagram</h2>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<index>
<ch><ti>Introduction</ti><fi>intro</fi></ch>
<ch><ti>Installation</ti><fi>install</fi></ch>

View File

@ -1,6 +1,5 @@
/*
* Relationship inference
* $Id$
*/
import java.util.List;

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-7" ?>
<!-- $Id$ -->
<notes>
To install UmlGraph follow these steps.
<ol>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
UMLGraph allows the declarative specification and drawing of
UML class and sequence diagrams.

View File

@ -1,7 +1,6 @@
/*
* Schema model
* UML User Guide p. 112
* $Id$
*/
/**

View File

@ -1,5 +1,4 @@
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Objects do not always appear at the top of a UML sequence diagram;
they are often constructed by other objects.

View File

@ -1,6 +1,5 @@
# UML User Guide: Appendix A,p. 436
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Let us try to improve the simple sequence diagram.
<fmtcode ext="pic">

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
One specifies a sequence diagram using <em>pic</em> macros to define
objects and method invocations.

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- $Id$ -->
<notes>
The following calls can be used to define a sequence diagram.
<dl>

View File

@ -1,5 +1,4 @@
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
A sequence diagram is defined in three main phases:
<ol>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Sequence diagrams consist of objects, their lifelines
(also known as smimming lanes),

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The value of
<em>pic</em> variables can sometimes be modified by assignment

View File

@ -14,7 +14,6 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id$
#

View File

@ -1,6 +1,5 @@
# UML User Guide: Figure 18-2
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The following diagram, based on the one appearing on p. 247 of the
UML User Guide, illustrates the dynamic creation and destruction of

View File

@ -1,6 +1,5 @@
# UML User Guide: Figure 18-4
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The following diagram, based on Figure 18-4 appearing on p. 252 of the
UML User Guide, illustrates constraints on an object's lifeline,
@ -31,7 +30,7 @@ async(); message(S,W,"liftReceiver"); sync();
active(S);
message(W,S,"setDialTone()");
async(); message(S,W,"*dialDigit(d)"); sync();
lconstraint(W,"{dialing.executionTime < 30s}");
lconstraint(W,"{dialing.executionTime &lt; 30s}");
active(W);
message(W,W,"routeCalls(s,n)");
inactive(W);

View File

@ -1,6 +1,5 @@
# UML User Guide Figure 7-1.
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The following diagram, based on Figure 7-1 appearing on p. 102 of the
UML User Guide, illustrates an interaction diagram with an

View File

@ -1,6 +1,5 @@
# UML User Guide: Appendix A,p. 436
#
# $Id$
#
.PS

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
The following diagram, based on the one appearing on p. 436 of the
UML User Guide, contains the most important elements

View File

@ -1,9 +1,23 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
<dl>
<dt>Version 5.7 Under development </dt><dd>
<ul>
<li>The <code>@opt include</code> option can be used to include classes from
foreign packages in the package view (unless hidden with <code>@opt hide</code>).</li>
<li>You can now also use <code>@opt</code> in <code>package-info.java</code>.</li>
<li>Added <code>-qualifyGenerics</code> option to separately control the inclusion of
package names for the class (<code>-qualify</code>) and its generics. In particular
this works well with <code>-qualify -postfixpackage</code> (and <code>-!qualifyGenerics</code>).<br />
To get the old <code>-qualify</code> behavior, you need to add <code>-qualifyGenerics</code>,
the default is off, and it will not inherit from <code>-qualify</code>.</li>
<li>Better handling of complex names with generics and inner classes such as <code>pkg.Outer&lt;T&gt;.Inner</code>.</li>
<li>Use &lt;i&gt; tags for italic, because the old font naming approach does not work with SVG anymore.
Replace <code>-nodefontabstractname</code> and <code>-nodefontclassabstractname</code>
with a simple flag <code>-nodefontabstractitalic</code> instead.</li>
<li>Added <code>-hideprivateinner</code> to hide all private inner classes.</li>
</ul>
</dd>
<dt>Version 5.6 2012-05-31 </dt><dd>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" ?>
<!-- $Id$ -->
<notes>
Documenting a big project often requires multiple diagrams:
each to show a specific and limited portion of the system.

View File

@ -1,4 +1,3 @@
// $Id$
/**
* Attribute and operation visility

View File

@ -10,7 +10,7 @@
<name>UMLGraph</name>
<version>${version}</version>
<description>Declarative Drawing of UML Diagrams</description>
<url>http://www.umlgraph.org</url>
<url>http://www.spinellis.gr/umlgraph</url>
<licenses>
<license>

79
pom.xml
View File

@ -6,9 +6,9 @@
<artifactId>umlgraph</artifactId>
<packaging>jar</packaging>
<name>UMLGraph</name>
<version>5.6.6</version>
<version>6.0.1-SNAPSHOT</version>
<description>Declarative Drawing of UML Diagrams</description>
<url>http://www.umlgraph.org</url>
<url>http://www.spinellis.gr/umlgraph</url>
<licenses>
<license>
@ -26,6 +26,7 @@
<url>https://github.com/dspinellis/UMLGraph/</url>
<connection>scm:git://github.com/dspinellis/UMLGraph.git</connection>
<developerConnection>scm:git:git@github.com:dspinellis/UMLGraph.git</developerConnection>
<tag>R5_7_1</tag>
</scm>
<developers>
@ -39,16 +40,15 @@
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
<version>9</version>
</parent>
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -62,15 +62,16 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.10.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>9</source>
<target>9</target>
</configuration>
</plugin> <plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
@ -83,15 +84,18 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
<version>3.0.0-M7</version>
<configuration>
<preparationGoals>clean verify</preparationGoals>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
@ -104,21 +108,38 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<version>3.5.0</version>
<configuration>
<tags>
<tag>
<name>depend</name>
<placement>X</placement>
</tag>
<tag>
<name>hidden</name>
<placement>X</placement>
</tag>
<tag>
<name>opt</name>
<placement>X</placement>
</tag>
</tags>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<docletPath>${project.build.directory}${file.separator}${project.build.finalName}.jar</docletPath>
<additionalparam>-inferrel</additionalparam>
<additionalparam>-inferdep</additionalparam>
<additionalparam>-collapsible</additionalparam>
<additionalparam>-hide java.*</additionalparam>
<additionalparam>-collpackages</additionalparam>
<additionalparam>-qualify</additionalparam>
<additionalparam>-postfixpackage</additionalparam>
<additionalparam>-nodefontsize 9</additionalparam>
<additionalparam>-nodefontpackagesize 7</additionalparam>
<additionalparam>-link http://docs.oracle.com/javase/7/docs/jdk/api/javadoc/doclet/</additionalparam>
<additionalparam>-link http://download.oracle.com/javase/7/docs/api/</additionalparam>
<additionalOptions>
<option>-inferrel</option>
<option>-inferdep</option>
<option>-autosize</option>
<option>-collapsible</option>
<option>--hide="java.*"</option>
<option>--collpackages=</option>
<option>-qualify</option>
<option>-postfixpackage</option>
<option>-nodefontsize 9</option>
<option>-nodefontpackagesize 7</option>
<option>--link="https://docs.oracle.com/javase/9/docs/api/"</option>
</additionalOptions>
<detectJavaApiLink>false</detectJavaApiLink>
<useStandardDocletOptions>true</useStandardDocletOptions>
</configuration>
<executions>

View File

@ -14,7 +14,6 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id$
#

View File

@ -0,0 +1,6 @@
module org.umlgraph.doclet {
exports org.umlgraph.doclet;
opens org.umlgraph.doclet;
requires transitive jdk.javadoc;
}

View File

@ -1 +0,0 @@
Version.java

File diff suppressed because it is too large Load Diff

View File

@ -14,62 +14,60 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id$
*
*/
package org.umlgraph.doclet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.lang.model.element.Name;
/**
* Class's dot-compatible alias name (for fully qualified class names)
* and printed information
* Class's dot-compatible alias name (for fully qualified class names) and
* printed information
*
* @version $Revision$
* @author <a href="http://www.spinellis.gr">Diomidis Spinellis</a>
*/
class ClassInfo {
private static int classNumber;
/** Alias name for the class */
String name;
final String name;
/** True if the class class node has been printed */
boolean nodePrinted;
/** True if the class class node is hidden */
boolean hidden;
/**
* The list of classes that share a relation with this one. Contains
* all the classes linked with a bi-directional relation , and the ones
* referred by a directed relation
/**
* The list of classes that share a relation with this one. Contains all the
* classes linked with a bi-directional relation , and the ones referred by a
* directed relation
*/
Map<String, RelationPattern> relatedClasses = new HashMap<String, RelationPattern>();
Map<String, RelationPattern> relatedClasses = new HashMap<>();
ClassInfo(boolean p, boolean h) {
nodePrinted = p;
hidden = h;
name = "c" + (new Integer(classNumber)).toString();
classNumber++;
ClassInfo(boolean h) {
hidden = h;
name = "c" + classNumber;
classNumber++;
}
public void addRelation(String dest, RelationType rt, RelationDirection d) {
RelationPattern ri = relatedClasses.get(dest);
if(ri == null) {
ri = new RelationPattern(RelationDirection.NONE);
relatedClasses.put(dest, ri);
}
ri.addRelation(rt, d);
public void addRelation(Name dest, RelationType rt, RelationDirection d) {
RelationPattern ri = relatedClasses.get(dest.toString());
if (ri == null) {
ri = new RelationPattern(RelationDirection.NONE);
relatedClasses.put(dest.toString(), ri);
}
ri.addRelation(rt, d);
}
public RelationPattern getRelation(String dest) {
return relatedClasses.get(dest);
public RelationPattern getRelation(CharSequence dest) {
return relatedClasses.get(dest.toString());
}
/** Start numbering from zero. */
public static void reset() {
classNumber = 0;
classNumber = 0;
}
}

View File

@ -12,28 +12,27 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id$
*
*/
package org.umlgraph.doclet;
import com.sun.javadoc.ClassDoc;
import javax.lang.model.element.TypeElement;
/**
* A ClassMatcher is used to check if a class definition matches a
* specific condition. The nature of the condition is dependent on
* the kind of matcher
* A ClassMatcher is used to check if a class definition matches a specific
* condition. The nature of the condition is dependent on the kind of matcher
*
* @author wolf
*/
public interface ClassMatcher {
/**
* Returns the options for the specified class.
* Returns the options for the specified class.
*/
public boolean matches(ClassDoc cd);
public boolean matches(TypeElement cd);
/**
* Returns the options for the specified class.
* Returns the options for the specified class.
*/
public boolean matches(String name);
public boolean matches(CharSequence name);
}

View File

@ -12,7 +12,6 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id$
*
*/
@ -27,8 +26,10 @@ import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.RootDoc;
import jdk.javadoc.doclet.DocletEnvironment;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
/**
* Matches classes that are directly connected to one of the classes matched by
@ -39,6 +40,7 @@ import com.sun.javadoc.RootDoc;
* This class needs to perform quite a bit of computations in order to gather
* the network of class releationships, so you are allowed to reuse it should
* you
*
* @author wolf
*
* @depend - - - DevNullWriter
@ -46,34 +48,35 @@ import com.sun.javadoc.RootDoc;
public class ContextMatcher implements ClassMatcher {
ClassGraphHack cg;
Pattern pattern;
List<ClassDoc> matched;
Set<String> visited = new HashSet<String>();
List<TypeElement> matched;
Set<String> visited = new HashSet<>();
/** The options will be used to decide on inference */
Options opt;
RootDoc root;
DocletEnvironment root;
boolean keepParentHide;
/**
* Builds the context matcher
* @param root The root doc returned by JavaDoc
* @param pattern The pattern that will match the "center" of this
* context
* @param keepParentHide If true, parent option hide patterns will be
* preserved, so that classes hidden by the options won't
* be shown in the context
*
* @param root The root doc returned by JavaDoc
* @param pattern The pattern that will match the "center" of this
* context
* @param keepParentHide If true, parent option hide patterns will be preserved,
* so that classes hidden by the options won't be shown in
* the context
* @throws IOException
*/
public ContextMatcher(RootDoc root, Pattern pattern, Options options, boolean keepParentHide) throws IOException {
this.pattern = pattern;
this.root = root;
this.keepParentHide = keepParentHide;
opt = (Options) options.clone();
opt.setOption(new String[] { "-!hide" });
opt.setOption(new String[] { "-!attributes" });
opt.setOption(new String[] { "-!operations" });
this.cg = new ClassGraphHack(root, opt);
public ContextMatcher(DocletEnvironment root, Pattern pattern, Options options, boolean keepParentHide) throws IOException {
this.pattern = pattern;
this.root = root;
this.keepParentHide = keepParentHide;
opt = (Options) options.clone();
opt.setOption(new String[] { "!hide" });
opt.setOption(new String[] { "!attributes" });
opt.setOption(new String[] { "!operations" });
this.cg = new ClassGraphHack(root, opt);
setContextCenter(pattern);
setContextCenter(pattern);
}
/**
@ -81,117 +84,126 @@ public class ContextMatcher implements ClassMatcher {
* <p>
* This can be used to speed up subsequent matching with the same global
* options, since the class network informations will be reused.
*
* @param pattern
*/
public void setContextCenter(Pattern pattern) {
// build up the classgraph printing the relations for all of the
// classes that make up the "center" of this context
this.pattern = pattern;
matched = new ArrayList<ClassDoc>();
for (ClassDoc cd : root.classes()) {
if (pattern.matcher(cd.toString()).matches()) {
matched.add(cd);
addToGraph(cd);
}
}
// build up the classgraph printing the relations for all of the
// classes that make up the "center" of this context
this.pattern = pattern;
matched = new ArrayList<>();
for (Element cd : root.getIncludedElements()) {
if (cd instanceof TypeElement && pattern.matcher(cd.toString()).matches()) {
matched.add((TypeElement) cd);
addToGraph((TypeElement) cd);
}
}
}
/**
* Adds the specified class to the internal class graph along with its
* relations and depencies, eventually inferring them, according to the
* Options specified for this matcher
* Adds the specified class to the internal class graph along with its relations
* and dependencies, eventually inferring them, according to the Options
* specified for this matcher
*
* @param cd
*/
private void addToGraph(ClassDoc cd) {
// avoid adding twice the same class, but don't rely on cg.getClassInfo
// since there
// are other ways to add a classInfor than printing the class
if (visited.contains(cd.toString()))
return;
private void addToGraph(TypeElement cd) {
// avoid adding twice the same class, but don't rely on cg.getClassInfo
// since there are other ways to add a classInfor than printing the class
if (visited.contains(cd.toString())) {
return;
}
visited.add(cd.toString());
cg.printClass(cd, false);
cg.printRelations(cd);
if (opt.inferRelationships) {
cg.printInferredRelations(cd);
}
if (opt.inferDependencies) {
cg.printInferredDependencies(cd);
}
visited.add(cd.toString());
cg.printClass(cd, false);
cg.printRelations(cd);
if (opt.inferRelationships) {
cg.printInferredRelations(cd);
}
if (opt.inferDependencies) {
cg.printInferredDependencies(cd);
}
}
/**
* @see org.umlgraph.doclet.ClassMatcher#matches(com.sun.javadoc.ClassDoc)
* @see org.umlgraph.doclet.ClassMatcher#matches(TypeElement)
*/
public boolean matches(ClassDoc cd) {
if (keepParentHide && opt.matchesHideExpression(cd.toString()))
return false;
public boolean matches(TypeElement cd) {
if (keepParentHide && opt.matchesHideExpression(cd.getQualifiedName())) {
return false;
}
// if the class is matched, it's in by default.
if (matched.contains(cd))
return true;
// if the class is matched, it's in by default.
if (matched.contains(cd)) {
return true;
}
// otherwise, add the class to the graph and see if it's associated
// with any of the matched classes using the classgraph hack
addToGraph(cd);
return matches(cd.toString());
// otherwise, add the class to the graph and see if it's associated
// with any of the matched classes using the classgraph hack
addToGraph(cd);
return matches(cd.toString());
}
/**
* @see org.umlgraph.doclet.ClassMatcher#matches(java.lang.String)
* @see org.umlgraph.doclet.ClassMatcher#matches(CharSequence)
*/
public boolean matches(String name) {
if (pattern.matcher(name).matches())
return true;
public boolean matches(CharSequence name) {
if (pattern.matcher(name).matches()) {
return true;
}
for (ClassDoc mcd : matched) {
String mcName = mcd.toString();
ClassInfo ciMatched = cg.getClassInfo(mcName);
RelationPattern rp = ciMatched.getRelation(name);
if (ciMatched != null && rp != null && opt.contextRelationPattern.matchesOne(rp))
return true;
}
return false;
for (TypeElement mcd : matched) {
RelationPattern rp = cg.getClassInfo(mcd, true).getRelation(name);
if (rp != null && opt.contextRelationPattern.matchesOne(rp)) {
return true;
}
}
return false;
}
/**
* A quick hack to compute class dependencies reusing ClassGraph but
* without generating output. Will be removed once the ClassGraph class
* will be split into two classes for graph computation and output
* generation.
* A quick hack to compute class dependencies reusing ClassGraph but without
* generating output. Will be removed once the ClassGraph class will be split
* into two classes for graph computation and output generation.
*
* @author wolf
*
*/
private static class ClassGraphHack extends ClassGraph {
public ClassGraphHack(RootDoc root, OptionProvider optionProvider) throws IOException {
super(root, optionProvider, null);
prologue();
}
public ClassGraphHack(DocletEnvironment root, OptionProvider optionProvider) throws IOException {
super(root, optionProvider, null);
prologue();
}
public void prologue() throws IOException {
w = new PrintWriter(new DevNullWriter());
}
@Override
public void prologue() throws IOException {
w = new PrintWriter(new DevNullWriter());
}
}
/**
* Simple dev/null imitation
*
* @author wolf
*/
private static class DevNullWriter extends Writer {
public void write(char[] cbuf, int off, int len) throws IOException {
// nothing to do
}
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
// nothing to do
}
public void flush() throws IOException {
// nothing to do
}
@Override
public void flush() throws IOException {
// nothing to do
}
public void close() throws IOException {
// nothing to do
}
@Override
public void close() throws IOException {
// nothing to do
}
}

140
src/main/java/org/umlgraph/doclet/ContextView.java Normal file → Executable file
View File

@ -3,8 +3,14 @@ package org.umlgraph.doclet;
import java.io.IOException;
import java.util.regex.Pattern;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.RootDoc;
import jdk.javadoc.doclet.DocletEnvironment;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.TypeElement;
import org.umlgraph.doclet.util.ElementUtil;
import com.sun.source.util.DocTrees;
/**
* A view designed for UMLDoc, filters out everything that it's not directly
@ -14,96 +20,114 @@ import com.sun.javadoc.RootDoc;
* single {@linkplain ContextMatcher}, but provides some extra configuration
* such as context highlighting and output path configuration (and it is
* specified in code rather than in javadoc comments).
*
* @author wolf
*
*/
public class ContextView implements OptionProvider {
private ClassDoc cd;
private TypeElement cd;
private DocletEnvironment root;
private ContextMatcher matcher;
private Options globalOptions;
private Options myGlobalOptions;
private Options hideOptions;
private Options centerOptions;
private Options packageOptions;
private static final String[] HIDE_OPTIONS = new String[] { "-hide" };
private static final String[] HIDE_OPTIONS = new String[] { "hide" };
public ContextView(String outputFolder, ClassDoc cd, RootDoc root, Options parent)
throws IOException {
this.cd = cd;
String outputPath = cd.containingPackage().name().replace('.', '/') + "/" + cd.name()
+ ".dot";
public ContextView(String outputFolder, TypeElement cd, DocletEnvironment root, Options parent) throws IOException {
this.cd = cd;
this.root = root;
ModuleElement md = ElementUtil.getModuleOf(root, cd);
String pathPrefix = Runtime.version().major() > 10 && md != null ? md.getQualifiedName().toString() + "/" : "";
String outputPath = pathPrefix + ElementUtil.getPackageOf(root, cd).getQualifiedName().toString().replace('.', '/') + "/" + cd.getSimpleName() + ".dot";
// setup options statically, so that we won't need to change them so
// often
this.globalOptions = parent.getGlobalOptions();
this.packageOptions = parent.getGlobalOptions();
this.packageOptions.showQualified = false;
// setup options statically, so that we won't need to change them so
// often
this.globalOptions = parent.getGlobalOptions();
this.myGlobalOptions = parent.getGlobalOptions();
this.myGlobalOptions.setOption(new String[] { "-output", outputPath });
this.myGlobalOptions.setOption(HIDE_OPTIONS);
this.packageOptions = parent.getGlobalOptions();
this.packageOptions.showQualified = false;
this.hideOptions = parent.getGlobalOptions();
this.hideOptions.setOption(HIDE_OPTIONS);
this.myGlobalOptions = parent.getGlobalOptions();
this.myGlobalOptions.setOption(new String[] { "output", outputPath });
this.myGlobalOptions.setOption(HIDE_OPTIONS);
this.centerOptions = parent.getGlobalOptions();
this.centerOptions.nodeFillColor = "lemonChiffon";
this.centerOptions.showQualified = false;
this.hideOptions = parent.getGlobalOptions();
this.hideOptions.setOption(HIDE_OPTIONS);
this.matcher = new ContextMatcher(root, Pattern.compile(cd.qualifiedName()),
myGlobalOptions, true);
this.centerOptions = parent.getGlobalOptions();
this.centerOptions.nodeFillColor = "lemonChiffon";
this.centerOptions.showQualified = false;
this.matcher = new ContextMatcher(root, Pattern.compile(Pattern.quote(cd.toString())), myGlobalOptions, true);
}
public void setContextCenter(ClassDoc contextCenter) {
this.cd = contextCenter;
String outputPath = cd.containingPackage().name().replace('.', '/') + "/" + cd.name()
+ ".dot";
this.myGlobalOptions.setOption(new String[] { "-output", outputPath });
matcher.setContextCenter(Pattern.compile(cd.toString()));
public void setContextCenter(TypeElement contextCenter) {
this.cd = contextCenter;
ModuleElement md = ElementUtil.getModuleOf(root, contextCenter);
String pathPrefix = Runtime.version().major() > 10 && md != null ? md.getQualifiedName().toString() + "/" : "";
String outputPath = pathPrefix + ElementUtil.getPackageOf(root, cd).getQualifiedName().toString().replace('.', '/') + "/" + cd.getSimpleName() + ".dot";
this.myGlobalOptions.setOption(new String[] { "output", outputPath });
matcher.setContextCenter(Pattern.compile(Pattern.quote(cd.toString())));
}
public String getDisplayName() {
return "Context view for class " + cd;
return "Context view for class " + cd;
}
public Options getGlobalOptions() {
return myGlobalOptions;
return myGlobalOptions;
}
public Options getOptionsFor(ClassDoc cd) {
if (globalOptions.matchesHideExpression(cd.toString()) || !matcher.matches(cd)) {
return hideOptions;
} else if (cd.equals(this.cd)) {
return centerOptions;
} else if(cd.containingPackage().equals(this.cd.containingPackage())){
return packageOptions;
} else {
return globalOptions;
}
public Options getOptionsFor(DocTrees dt, TypeElement cd) {
Options opt;
if (globalOptions.matchesHideExpression(cd.getQualifiedName())
|| !(matcher.matches(cd) || globalOptions.matchesIncludeExpression(cd.getQualifiedName()))) {
opt = hideOptions;
} else if (cd.equals(this.cd)) {
opt = centerOptions;
} else if (root.getElementUtils().getPackageOf(cd).equals(root.getElementUtils().getPackageOf(this.cd))) {
opt = packageOptions;
} else {
opt = globalOptions;
}
Options optionClone = (Options) opt.clone();
overrideForClass(optionClone, cd);
return optionClone;
}
public Options getOptionsFor(String name) {
if (!matcher.matches(name))
return hideOptions;
else if (name.equals(cd.name()))
return centerOptions;
else
return globalOptions;
public Options getOptionsFor(CharSequence name) {
Options opt;
if (!matcher.matches(name)) {
opt = hideOptions;
} else if (name.equals(cd.getSimpleName())) {
opt = centerOptions;
} else {
opt = globalOptions;
}
Options optionClone = (Options) opt.clone();
overrideForClass(optionClone, name);
return optionClone;
}
public void overrideForClass(Options opt, ClassDoc cd) {
if (opt.matchesHideExpression(cd.toString()) || !matcher.matches(cd))
opt.setOption(HIDE_OPTIONS);
if (cd.equals(this.cd))
opt.nodeFillColor = "lemonChiffon";
public void overrideForClass(Options opt, TypeElement cd) {
opt.setOptions(root.getDocTrees(), cd);
if (opt.matchesHideExpression(cd.getQualifiedName())
|| !(matcher.matches(cd) || opt.matchesIncludeExpression(cd.getQualifiedName()))) {
opt.setOption(HIDE_OPTIONS);
}
if (cd.equals(this.cd)) {
opt.nodeFillColor = "lemonChiffon";
}
}
public void overrideForClass(Options opt, String className) {
if (!matcher.matches(className))
opt.setOption(HIDE_OPTIONS);
public void overrideForClass(Options opt, CharSequence className) {
if (!(matcher.matches(className) || opt.matchesIncludeExpression(className))) {
opt.setOption(HIDE_OPTIONS);
}
}
}

View File

@ -0,0 +1,101 @@
package org.umlgraph.doclet;
/**
* Class to represent a font for graphviz.
* <p>
* This is a fairly complicated model, because it is rather an API into graphviz
* formatting strings rather than a standalone thing. <p> Some fonts (edge, node,
* abstract) are set on the top level elements, whereas others (class name, tag,
* package) are inserted as {@code <font>} tags, and these can be omitted if not
* set. Inheritance of properties then happens in graphviz.
*
* @author Erich Schubert
*/
public enum Font {
/** Edge label font */
EDGE, //
/** Node basic */
NODE, //
/** Normal operation font */
NORMAL, //
/** Abstract operation font */
ABSTRACT, //
/** Class name. Inherits from null. */
CLASS, //
/** Class name of abstract classes (usually italic) */
CLASS_ABSTRACT, //
/** Package names Inherits from null. */
PACKAGE, //
/** Tags Inherits from null. */
TAG;
public static final String DEFAULT_FONT;
// Static initialization of further values.
static {
// use an appropriate font depending on the current operating system
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
DEFAULT_FONT = "Arial";
} else {
DEFAULT_FONT = "Helvetica"; // TODO: can we use just "sans"?
}
}
/**
* Wraps the text with the appropriate font according to the specified font type
*
* @param opt Options
* @param text Text to wrap
* @return Wrapped text
*/
public String wrap(Options opt, String text) {
if (text.isEmpty() || this == NORMAL)
return text;
String face = null;
double size = -1;
boolean italic = false;
switch (this) {
case EDGE:
case NODE:
// Not used with the wrap function.
throw new UnsupportedOperationException();
case ABSTRACT:
italic = opt.nodeFontAbstractItalic;
case NORMAL:
break;
case CLASS_ABSTRACT:
italic = opt.nodeFontAbstractItalic;
case CLASS:
face = opt.nodeFontClassName;
size = opt.nodeFontClassSize;
break;
case PACKAGE:
face = opt.nodeFontPackageName;
size = opt.nodeFontPackageSize;
break;
case TAG:
face = opt.nodeFontTagName;
size = opt.nodeFontTagSize;
break;
}
if (face == null && size < 0 && !italic)
return text;
StringBuilder buf = new StringBuilder(text.length() + 100);
if (face != null || size > 0) {
buf.append("<font");
if (face != null)
buf.append(" face=\"").append(face).append('"');
if (size > 0)
buf.append(" point-size=\"").append(size).append('"');
buf.append('>');
}
if (italic)
buf.append("<i>");
buf.append(text);
if (italic)
buf.append("</i>");
if (face != null || size > 0)
buf.append("</font>");
return buf.toString();
}
}

View File

@ -2,47 +2,51 @@ package org.umlgraph.doclet;
import java.util.regex.Pattern;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.RootDoc;
import jdk.javadoc.doclet.DocletEnvironment;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import org.umlgraph.doclet.util.ElementUtil;
/**
* Matches every class that implements (directly or indirectly) an
* interfaces matched by regular expression provided.
* Matches every class that implements (directly or indirectly) an interfaces
* matched by regular expression provided.
*/
public class InterfaceMatcher implements ClassMatcher {
protected RootDoc root;
protected DocletEnvironment root;
protected Pattern pattern;
public InterfaceMatcher(RootDoc root, Pattern pattern) {
this.root = root;
this.pattern = pattern;
public InterfaceMatcher(DocletEnvironment root, Pattern pattern) {
this.root = root;
this.pattern = pattern;
}
public boolean matches(ClassDoc cd) {
// if it's the interface we're looking for, match
if(cd.isInterface() && pattern.matcher(cd.toString()).matches())
return true;
// for each interface, recurse, since classes and interfaces
// are treated the same in the doclet API
for (ClassDoc iface : cd.interfaces()) {
if(matches(iface))
return true;
}
// recurse on supeclass, if available
if(cd.superclass() != null)
return matches(cd.superclass());
return false;
public boolean matches(TypeElement cd) {
// if it's the interface we're looking for, match
if (cd.getKind() == ElementKind.INTERFACE && pattern.matcher(cd.toString()).matches()) {
return true;
}
// for each interface, recurse, since classes and interfaces
// are treated the same in the doclet API
for (TypeMirror type : cd.getInterfaces()) {
TypeElement iType = ElementUtil.getTypeElement(type);
if (iType != null && matches(iType)) {
return true;
}
}
// recurse on superclass, if available
TypeElement scd = ElementUtil.getTypeElement(cd.getSuperclass());
return scd == null ? false : matches(scd);
}
public boolean matches(String name) {
ClassDoc cd = root.classNamed(name);
if(cd == null)
return false;
return matches(cd);
public boolean matches(CharSequence name) {
TypeElement cd = root.getElementUtils().getTypeElement(name);
return cd == null ? false : matches(cd);
}
}

View File

@ -0,0 +1,53 @@
package org.umlgraph.doclet;
import java.util.List;
import jdk.javadoc.doclet.Doclet;
/**
* A base class for declaring options. Subtypes for specific options should
* implement the {@link #process(String,List) process} method to handle
* instances of the option found on the command line.
*/
public abstract class Option implements Doclet.Option {
private final String name;
private final int argumentCount;
private final String description;
private final String parameters;
public Option(String name, boolean hasArg, String description, String parameters) {
this(name, hasArg ? 1 : 0, description, parameters);
}
public Option(String name, int argumentCount, String description, String parameters) {
this.name = name;
this.argumentCount = argumentCount;
this.description = description;
this.parameters = parameters;
}
@Override
public int getArgumentCount() {
return argumentCount;
}
@Override
public String getDescription() {
return description;
}
@Override
public Kind getKind() {
return Kind.STANDARD;
}
@Override
public List<String> getNames() {
return List.of(name);
}
@Override
public String getParameters() {
return argumentCount == 0 ? "" : parameters;
}
}

View File

@ -12,28 +12,28 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id$
*
*/
package org.umlgraph.doclet;
import com.sun.javadoc.ClassDoc;
import javax.lang.model.element.TypeElement;
import com.sun.source.util.DocTrees;
/**
* A factory class that builds Options object for general use or for a
* specific class
* A factory class that builds Options object for general use or for a specific class
*/
public interface OptionProvider {
/**
* Returns the options for the specified class.
*/
public Options getOptionsFor(ClassDoc cd);
public Options getOptionsFor(DocTrees dt, TypeElement cd);
/**
* Returns the options for the specified class.
*/
public Options getOptionsFor(String name);
public Options getOptionsFor(CharSequence name);
/**
* Returns the global options (the class independent definition)
@ -43,16 +43,17 @@ public interface OptionProvider {
/**
* Gets a base Options and applies the overrides for the specified class
*/
public void overrideForClass(Options opt, ClassDoc cd);
public void overrideForClass(Options opt, TypeElement cd);
/**
* Gets a base Options and applies the overrides for the specified class
*/
public void overrideForClass(Options opt, String className);
public void overrideForClass(Options opt, CharSequence className);
/**
* Returns user displayable name for this option provider.
* <p>Will be used to provide progress feedback on the console
* <p>
* Will be used to provide progress feedback on the console
*/
public String getDisplayName();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,33 @@
package org.umlgraph.doclet;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.PackageDoc;
import jdk.javadoc.doclet.DocletEnvironment;
import javax.lang.model.element.Element;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import org.umlgraph.doclet.util.ElementUtil;
public class PackageMatcher implements ClassMatcher {
protected PackageDoc packageDoc;
protected DocletEnvironment root;
protected PackageElement packageDoc;
public PackageMatcher(PackageDoc packageDoc) {
super();
this.packageDoc = packageDoc;
public PackageMatcher(DocletEnvironment root, PackageElement packageDoc) {
this.root = root;
this.packageDoc = packageDoc;
}
public boolean matches(ClassDoc cd) {
return cd.containingPackage().equals(packageDoc);
public boolean matches(TypeElement cd) {
return packageDoc.equals(ElementUtil.getPackageOf(root, cd));
}
public boolean matches(String name) {
for (ClassDoc cd : packageDoc.allClasses()) {
if (cd.qualifiedName().equals(name))
return true;
}
return false;
public boolean matches(CharSequence name) {
for (Element cd : packageDoc.getEnclosedElements()) {
if (cd instanceof TypeElement && ((TypeElement) cd).getQualifiedName().equals(name)) {
return true;
}
}
return false;
}
}

86
src/main/java/org/umlgraph/doclet/PackageView.java Normal file → Executable file
View File

@ -1,8 +1,14 @@
package org.umlgraph.doclet;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.PackageDoc;
import com.sun.javadoc.RootDoc;
import jdk.javadoc.doclet.DocletEnvironment;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import org.umlgraph.doclet.util.ElementUtil;
import com.sun.source.util.DocTrees;
/**
* A view designed for UMLDoc, filters out everything that it's not contained in
@ -12,58 +18,78 @@ import com.sun.javadoc.RootDoc;
* single {@linkplain ClassMatcher}, and provides some extra configuration such
* as output path configuration (and it is specified in code rather than in
* javadoc comments).
*
* @author wolf
*
*/
public class PackageView implements OptionProvider {
private PackageDoc pd;
private static final String[] HIDE = new String[] { "hide" };
private PackageElement pd;
private OptionProvider parent;
private ClassMatcher matcher;
private String outputPath;
private Options opt;
private DocTrees docTrees;
public PackageView(String outputFolder, PackageDoc pd, RootDoc root, OptionProvider parent) {
this.parent = parent;
this.pd = pd;
this.matcher = new PackageMatcher(pd);
this.outputPath = pd.name().replace('.', '/') + "/" + pd.name() + ".dot";
public PackageView(String outputFolder, PackageElement pd, DocletEnvironment root, OptionProvider parent) {
this.parent = parent;
this.pd = pd;
this.docTrees = root.getDocTrees();
this.matcher = new PackageMatcher(root, pd);
this.opt = parent.getGlobalOptions();
this.opt.setOptions(docTrees, pd);
ModuleElement md = ElementUtil.getModuleOf(root, pd);
String pathPrefix = Runtime.version().major() > 10 && md != null ? md.getQualifiedName().toString() + "/" : "";
this.outputPath = pathPrefix + pd.getQualifiedName().toString().replace('.', '/') + "/" + pd.getSimpleName().toString() + ".dot";
}
public String getDisplayName() {
return "Package view for package " + pd;
return "Package view for package " + pd;
}
public Options getGlobalOptions() {
Options go = parent.getGlobalOptions();
Options go = parent.getGlobalOptions();
go.setOption(new String[] { "-output", outputPath });
go.setOption(new String[] { "-hide" });
go.setOption(new String[] { "output", outputPath });
go.setOption(HIDE);
return go;
return go;
}
public Options getOptionsFor(ClassDoc cd) {
Options go = parent.getGlobalOptions();
overrideForClass(go, cd);
return go;
public Options getOptionsFor(DocTrees dt, TypeElement cd) {
Options go = parent.getGlobalOptions();
overrideForClass(go, cd);
return go;
}
public Options getOptionsFor(String name) {
Options go = parent.getGlobalOptions();
overrideForClass(go, name);
return go;
public Options getOptionsFor(CharSequence name) {
Options go = parent.getGlobalOptions();
overrideForClass(go, name);
return go;
}
public void overrideForClass(Options opt, ClassDoc cd) {
opt.showQualified = false;
if (!matcher.matches(cd) || parent.getGlobalOptions().matchesHideExpression(cd.name()))
opt.setOption(new String[] { "-hide" });
public void overrideForClass(Options opt, TypeElement cd) {
opt.setOptions(docTrees, cd);
boolean inPackage = matcher.matches(cd);
if (inPackage) {
opt.showQualified = false;
}
boolean included = inPackage || this.opt.matchesIncludeExpression(cd.getQualifiedName());
if (!included || this.opt.matchesHideExpression(cd.getQualifiedName())) {
opt.setOption(HIDE);
}
}
public void overrideForClass(Options opt, String className) {
opt.showQualified = false;
if (!matcher.matches(className))
opt.setOption(new String[] { "-hide" });
public void overrideForClass(Options opt, CharSequence className) {
opt.showQualified = false;
boolean inPackage = matcher.matches(className);
if (inPackage)
opt.showQualified = false;
boolean included = inPackage || this.opt.matchesIncludeExpression(className);
if (!included || this.opt.matchesHideExpression(className)) {
opt.setOption(HIDE);
}
}
}

View File

@ -12,35 +12,33 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id$
*
*/
package org.umlgraph.doclet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.sun.javadoc.ClassDoc;
import javax.lang.model.element.TypeElement;
/**
* Matches classes performing a regular expression match on the qualified class
* name
*
* @author wolf
*/
public class PatternMatcher implements ClassMatcher {
Pattern pattern;
public PatternMatcher(Pattern pattern) {
this.pattern = pattern;
this.pattern = pattern;
}
public boolean matches(ClassDoc cd) {
return matches(cd.toString());
public boolean matches(TypeElement cd) {
return matches(cd.getQualifiedName());
}
public boolean matches(String name) {
Matcher matcher = pattern.matcher(name);
return matcher.matches();
public boolean matches(CharSequence name) {
return pattern.matcher(name).matches();
}
}

Some files were not shown because too many files have changed in this diff Show More