Library for programmatically creating class diagram picture with java? - java

Is there a library in java that allows me to programmatically create class diagram from fetched data (similar to the diagram below)? 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. Rather, I want to generate diagrams from the data that I got from the database (via Java) and output them in image form.

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.
DOT is a plain text graph description language. 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.
There are lot of libraries are available to render DOT file.
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.
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.

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;
Generate UML Class Diagram from Java Project

Related

Display dicom or raw images in 3D

I was wondering what tool can I use to make a single slice (image) into 3D. I can open dicom and raw images in my program but I want to display these images in 3D (just a single image rather than the whole stack). I used some of ImageJ files to open images but I don't like how ImageJ displays the stack in 3D and it doesn't really display a single image in 3d. My program is coded in java and I would like a tool that can be easily integrated into eclipse Kepler. I have found many tools like jogl, java 3d, java 3d workbench, vtk, etc. but I don't know which one to use or are there any other programs that are easier to use or integrate into the system.
EDIT:
I want to do something like this... http://www.welfenlab.de/fileadmin/forschung/gebiete/YaDiV/2008_07_18_Screenshot_YaDiV_1.png
There's a library called ImageJ which can be used to create three-dimensional models from two-dimensional slices. I haven't personally used it, but it looks like it should do the trick.
have you looked at XTK? in particular, lesson 17 seems to be exactly what you are looking for. it is in Javascript, so to integrate into your Java application, you should be able to use one of the many Java/Javascript bridges out there.

How to create PDFs with automatic table layout in Java

In my application the user can configure their own table layouts to display the data on the screen, by choosing which colums in which order are to be shown. Now I want to give my users the possibility to export these tables to PDF. The tables should fill the page width completely and the columns should adjust their size depending on the content in the table, like e.g. HTML tables do.
Can you recomment a library or toolchain for this?
I checked Apache FOP, but their fo:tables do not support automatic table layout. Creating a Jasper Report dynamically also doesn't seem to fit, because I have to specify the exact column width there. So, does anyone have an idea how to achive this?
Open Source solutions with commercially friendly licenses like Apache or LGPL preferred.
ANSWER: There are no current tools that allow what I hoped for, so I mark this question as resolved.
iText is probably what you are looking for http://itextpdf.com/. Version 2.1.7 is free to use under the GPL lisence, for more info see this question What is latest version of itext that is not AGPL?. It will work for you need, I would recommend using their code samples on their web page. Most are applicable to version 2.1.7 although it is currently on version 5.
I would recommend you take a look at Flying Saucer. It is an open source project that uses iText PDF as its core rendering engine but it allows you to define very dynamic xhtml files as your rendering medium.
Benefits of using FS+iText using iText by itself
Allows for a much faster dev cycle for changes or new products
Very easy to add in consistent and complex styles using a language built exactly for it (HTML + CSS)
You can use the same HTML code to render your PDF as you use to view it online (if using web application)
Can render graphics using java.awt.Graphics class onto the PDF, meaning you can integrate any graphics library with FS to paint objects like graphs onto your PDF.
Downsides:
While it does a good job at rendering modern css styles it is not perfect. For instance when I used it the project required the border-radius style to be usable. It wasnt so I had to implement it.
Rendering times and memory consumption are increased (Although I have found it to be quite fast and memory efficient)
More libraires in your project.
Heres an example from the FS website if your ineterested.
https://github.com/flyingsaucerproject/flyingsaucer/blob/master/flying-saucer-examples/src/main/java/PDFRender.java

Generating DOC (and DOCX) templates using Python or Java with absolute positioned boxes

For a web-to-print we need to generate a .doc (Microsoft Word 2003+) compatible templates/documents where we need to position some data inside the document (basically we need to auto-generated letter heads for address, phone, contact information etc.).
Which Python or Java based solutions can be used here that providing support for absolute positioning of text boxes in .doc (perhaps even through .DOCX).
We tried: XFC (FO-based which does not support absolute positioning) and tried Aspose Words for Java (also no support for absolute positioning).
Money does not play a major role. The solution has to work and it must not be open-source.
Any more options?
Anything you can do with word, you can do with the word com object.
Install PythonWin.
Use the object browser under "Tools->COM browser" to find what you need.
You could try Docmosis since it works from a template. You would do something like absolute-position your text box in the template and use Docmosis to put populate the text box. You could probably lay out the entire page as a table grid as another approach - it will likely on the specifics of the layout of the other components as well.
OpenOffice.org's Universal Network Objects (UNO), allow you to generate .doc,.PDF, as well as OpenOffice documents. It supports several programming languages like: Java, C++, Visual Basic, etcc..
Some good things is that: its free, open source and plataform-independent
You can build documents, spreadsheets, presentations, etc.
The library allow you to create graph, charts and start from scratch or using a template and fill the gaps..
In order to use it you will need to include some libraries that comes with the OpenOffice suite.
Useful links:
Open Office home
Open Office UNO Developer's Guide

Handwritten scanned Doc to .txt File?

Are there any JAVA APIs or tools that can convert Handwritten Scanned Doc to txt files?
I have tried google tesseract and few other tools , but I am not getting satisfactory results for hand written scanned docs.
Strange that other answers here are pointing out to OCR tools while question clearly states handwriting recongition.
Handwriting is even more difficult area than OCR and number of technologies available is very narrow. I don't think you will be able to find any open source tool for that, while there are few commertial vendors:
http://www.a2ia.com
http://www.parascript.com/
I don't know if they have Java API, but it is better to start researching from contacting them.
You can try the Java OCR Project. I think that you might do the writing to a text file section yourself though.
Also, hand writing tends to vary from one individual to another, so I guess you will need to select some good training data to get good results.
Have a look at these :
Java OCR
Java OCR is a suite of pure java libraries for image processing and character recognition. Provides modular structure for easier deployment .
GOCR
GOCR is an OCR program, developed under the GNU Public License. It converts scanned images of text back to text files.

Library to render Directed Graphs (similar to graphviz) on Google App Engine

I am looking for a Java or Python library that can render graphs in the Dot language as image file. The problem is that I need a library that I can use on Google App Engine. Basically I am looking for a library that can convert the text description of a directed graph into an image of the graph.
For example:
Covert this edge list:
[A,B]
[B,C]
[A,C]
[C,D]
Into this image:
I used Graphviz for this example, but I know it is not possible for me to use it with Google App Engine.
Canviz is what you are looking for: it is a JavaScript library for drawing Graphviz graphs to a web browser canvas. It works with most browsers.
Using Canviz has advantages for your web application over generating and sending bitmapped images and imagemaps to the browser:
The server only needs to have Graphviz generate xdot text; this is faster than generating bitmapped images.
Only the xdot text needs to be transferred to the browser; this is smaller than binary image data, and, if the browser supports it (which most do), the text can be gzip- or bzip2-compressed.
The web browser performs the drawing, not the server; this reduces server load.
The user can resize the graph without needing to involve the server; this is faster than having the server draw and send the graph in a different size.
To see it in action, look here.
Google Charts API now supports GraphViz experimentally. (Note that the entire Image Charts project is officially deprecated.)
You could take a look at the flash based perfuse project if just need to display a graph and not having it embedded as an image is acceptable.
They have some example applications of the library such as this Dependency Graph.
I do not think there is such pure python library, the best you can do is use NetworkX, it can draw using matplotlib or pygraphviz. Maybe you can modify networkx's matplotlib code to draw on server side, here is the code
Another problem is google app engine doesn't have any drawing API, but you may simply use SVG to generate such graphs or may be google charts API have something already there.

Categories

Resources