简体   繁体   English

使用Java以编程方式创建类图图片的库?

[英]Library for programmatically creating class diagram picture with java?

Is there a library in java that allows me to programmatically create class diagram from fetched data (similar to the diagram below)? Java中是否有一个库,可让我以编程方式从获取的数据创建类图(类似于下图)? Specifically, I want to create a database reference diagram (image below). 具体来说,我想创建一个数据库参考图(下图)。

EDIT: As to prevent misunderstanding, I did not want a UML Diagram of my java code. 编辑:为防止误解,我不想要我的Java代码的UML图。 Rather, I want to generate diagrams from the data that I got from the database (via Java) and output them in image form. 相反,我想根据从数据库(通过Java)获得的数据生成图表,并将其以图像形式输出。

在此处输入图片说明

In two steps , we can create diagrams based on object/table relationships. 在两个步骤中,我们可以基于对象/表的关系创建图。

Step 1: use DOT (graph description language) to create graph representation of the relationships. 步骤1:使用DOT (图形描述语言)创建关系的图形表示。

DOT is a plain text graph description language. DOT是纯文本图形描述语言。 It is a simple way of describing graphs that both humans and computer programs can use. 这是描述人类和计算机程序都可以使用的图形的简单方法。 syntax is very easy to learn. 语法非常容易学习。 create this file like you create some text file using your preferred programming language. 创建此文件,就像使用首选编程语言创建一些文本文件一样。

Step 2: Use DOT reader libraries to render as picture. 步骤2:使用DOT阅读器库渲染为图片。

There are lot of libraries are available to render DOT file . 有很多库可用于渲染DOT文件

Graphviz - A collection of libraries and utilities to manipulate and render graphs
Canviz - a JavaScript library for rendering dot files.
Viz.js - A simple Graphviz JavaScript client
Grappa - A Java wrapper for using the Graphviz libraries. 
Beluging - A Python & Google Cloud based viewer of DOT and Beluga extensions.
Tulip can import dot files for analysis
OmniGraffle can import a subset of DOT, producing an editable document. (The result cannot be exported back to DOT, however.)
ZGRViewer, a GraphViz/DOT Viewer link
VizierFX, A Flex graph rendering library link
Gephi - an interactive visualization and exploration platform for all kinds of networks and complex systems, dynamic and hierarchical graphs

I believe most of the libraries listed here: Java graph library for dynamic visualisation should work for that use-case. 我相信这里列出的大多数库: 用于动态可视化的Java图形库应适用于该用例。

If you are looking for ready-made tool that can do this out-of-the box you might want to take a look at the "Reference Graphs" section in the DbVisualizer Gallery . 如果您正在寻找可以立即使用的现成工具,则可能需要查看DbVisualizer Gallery中的“参考图”部分。

I don't know whether the solutions can generate an identical image to that, but; 我不知道解决方案是否可以生成与此相同的图像,但是;
These diagrams are referred to as 'UML diagrams' and generating UML diagrams from a Java project is discussed here; 这些图称为“ UML图”,此处讨论从Java项目生成UML图。

Generate UML Class Diagram from Java Project 从Java项目生成UML类图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM