Welcome to Umler’s documentation!

Version:1.0-beta

Umler is a DIA plugin for automatic UML Class Diagrams generation out of Java source files.

Major features:

  • support for single files and directories as well
  • recognizing classes and interfaces from Java 1.6 Standard Library
  • supports inheritace, implementation and aggregation relation
  • sorting attributes by visibility
  • supports parameterisation of diagram generation

Note

Please notice, that Umler only helps working with Your source code. It was not designed to check correctness of the code.

Home page of the project

Home page is located under https://sourceforge.net/projects/umler.

You can download the latest version directly by clicking https://sourceforge.net/projects/umler/files/Umler-1.0-src.tar.gz/download.

Documentation

This documentation is located in docs/build/html/ directory or under http://umler.sourceforge.net/.

Requirements

Umler required Python in version 2.5 or later and working instalation of DIA.

Umler uses PLY parser generator, and it can be installed simply by writing (Debian-based systems):

sudo apt-get install python-ply

or directly from author’s page:

http://www.dabeaz.com/ply/ply-3.3.tar.gz

Warning

Umler has not been tested under Windows yet.

Installation

The simples installation looks like this:

easy_install dist/Umler-1.0-py2.6.egg
umler-install-plugin

To do this, You have to install python-setuptools package:

sudo apt-get install python-setuptools

If You do not want to install any additional packages, You can copy src/umler/umler-plugin.py to ~/.dia/python directory. If it does not exist, You should create it. Next You have to make Your Umler installation visible by Python (eg. if using Bash as shell):

export PYTHONPATH=$PYTHONPATH:/path/to/your/umler/src

User guide

Umler is a DIA plugin, thus to start just run DIA and create new diagram using command:

File > New

Plugin is located as extension to Objects section in top menu. After choosing:

Objects > Generate UML from...

small window with several options will be shown:

_images/screen_1.png

In this window You can decide how the diagram will be generated.

Select a file button let You to choose one file with *.java extension.

Select a directory button let You choose a directory, which will be recursively searched in order to find all files with *.java extension. Only files which Umler can read will be parsed.

Done button closes the window. It can be reshown by selectin Objects > Generate UML from... as it was mentioned earlier.

Note

Umler does not limit the number of generated diagrams. Nothing prevents from generaring two diagrams side by side. It should be remembered, however, to move diagrams on one side, so as not to put the new one over old one.

Available preferences

Umler allows to parameterize diagram generation in some way:

  • Show private members? - if selected, Umler will show private class members
  • Generate aggregate relations? - if selected, Umler will generate aggregates relations eg. when one class has attribute typed as another class
  • Skip undeclared items? - if selected, Umler will not create empty classes and interfaces, if they are not defined in parsed files, but appeared in eg. inheritance. In this mode recognizing classes from Java Standard Library will not work.

Examples

Examples are located in examples/ directory. Examples from examples/other directory are not presented here.

Composite.java

Example show how inheritance and aggregation work.

Source code:

package composite;

abstract class Component {
	abstract public void operation();
}

class Composite extends Component {
	private Component[] components;

	public void operation(){
		for(Component component : components)
			component.operation();
	}
}

class Leaf extends Component {
	public void operation(){
		// implementation
	}
}

Output diagram:

_images/Composite.png

Inheritance.java

Example show multi-level inheritance tree and recognizing standard Java classes.

Source code:

package inheritance;

interface Packetable extends Remote {

}

abstract class Packet implements Serializable, Packetable {
	public void load(InputStream);
	public void save(OutputStream);

	abstract void action();
}

class InternetPacket extends Packet {
	private String ipAddress;
	public void action();
}

class DataPacket extends InternetPacket {
	public int data;
	public void action();
}

class PingPacket extends InternetPacket {

}

class JsonPacket extends DataPacket {

}

class TokenRingPacket extends Packet {
	public void action();
}

Output diagram:

_images/Inheritance.png

Sort.java

Example show how attributes are sorted.

Source code:

package sort;

class GodClass {
	public String publicField;
	public String anotherPublicField;

	private String privateField;
	private String anotherPrivateField;

	protected String ProtectedField;
	protected String anotherProtectedField;

	String packageField;
	String anotherPackageField;

	public void publicMethod();
	public void anotherPublicMethod();

	public static void publicAndStaticMethod();

	protected void protectedMethod();
	protected void anotherProtectedMethod();

	abstract protected void protectedAndAbstractMethod();

	void packageMethod();
	void anotherPackageMethod();
}

Output diagram:

_images/Sort.png

Authors and license

Authors:Przemysław Gajda, Dawid Fatyga
Umler - DIA plugin for automatic UML diagram generation.
Copyright (C) 2010  Przemysław Gajda, Dawid Fatyga

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Tables and indices