org.argouml.uml.diagram.static_structure.layout
Class ClassdiagramLayouter

java.lang.Object
  extended byorg.argouml.uml.diagram.static_structure.layout.ClassdiagramLayouter
All Implemented Interfaces:
Layouter

public class ClassdiagramLayouter
extends java.lang.Object
implements Layouter

This class implements a layout algoritms for class diagrams.


Field Summary
static org.apache.log4j.Category cat
          Category for logging events
 
Constructor Summary
ClassdiagramLayouter(UMLDiagram theDiagram)
          This constructor is mainly for convenience, so we don't have add every node manually to the layouter.
 
Method Summary
 void add(org.argouml.uml.diagram.static_structure.layout.ClassdiagramNode obj)
          Add a ClassdiagramNode to layout.
 void add(LayoutedObject obj)
          Add a object to layout.
 org.argouml.uml.diagram.static_structure.layout.ClassdiagramNode getClassdiagramNode(int index)
          Get a ClassdiagramNode from the layouted objects.
protected  int getHGap()
          Get the horizontal gap between nodes.
 java.awt.Dimension getMinimumDiagramSize()
          Operation getMinimumDiagramSize returns the minimum diagram size after the layout process.
 LayoutedObject getObject(int index)
          Operation getObject returns a object with a given index from the layouter.
 LayoutedObject[] getObjects()
          Operation getObjects returns all the objects currently participating in the layout process.
protected  int getVGap()
          Get the vertical gap between nodes.
 void layout()
          Operation layout implements the actual layout algorithm
 void remove(LayoutedObject obj)
          Remove a object from the layout process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

public static final org.apache.log4j.Category cat
Category for logging events

Constructor Detail

ClassdiagramLayouter

public ClassdiagramLayouter(UMLDiagram theDiagram)
This constructor is mainly for convenience, so we don't have add every node manually to the layouter.

Method Detail

add

public void add(LayoutedObject obj)
Add a object to layout.

Specified by:
add in interface Layouter
Parameters:
obj - represents the object to layout.

add

public void add(org.argouml.uml.diagram.static_structure.layout.ClassdiagramNode obj)
Add a ClassdiagramNode to layout.

Parameters:
obj - represents the object to layout.

remove

public void remove(LayoutedObject obj)
Remove a object from the layout process.

Specified by:
remove in interface Layouter
Parameters:
obj - represents the object to remove.

getObjects

public LayoutedObject[] getObjects()
Operation getObjects returns all the objects currently participating in the layout process.

Specified by:
getObjects in interface Layouter
Returns:
An array holding all the object in the layouter.

getObject

public LayoutedObject getObject(int index)
Operation getObject returns a object with a given index from the layouter.

Specified by:
getObject in interface Layouter
Parameters:
index - represents the index of this object in the layouter.
Returns:
The LayoutedObject for the given index.

getClassdiagramNode

public org.argouml.uml.diagram.static_structure.layout.ClassdiagramNode getClassdiagramNode(int index)
Get a ClassdiagramNode from the layouted objects.

Parameters:
index - represents the index of this ClassdiagramNode.
Returns:
The ClassdiagramNode for this index.

layout

public void layout()
Operation layout implements the actual layout algorithm

Specified by:
layout in interface Layouter

getMinimumDiagramSize

public java.awt.Dimension getMinimumDiagramSize()
Operation getMinimumDiagramSize returns the minimum diagram size after the layout process.

Specified by:
getMinimumDiagramSize in interface Layouter
Returns:
The minimum diagram size after the layout process.

getVGap

protected int getVGap()
Get the vertical gap between nodes.

Returns:
The vertical gap between nodes.

getHGap

protected int getHGap()
Get the horizontal gap between nodes.

Returns:
The horizontal gap between nodes.


ArgoUML © 1996-2003 (20040125)ArgoUML Project HomeArgoUML Cookbook