|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.uml.diagram.static_structure.layout.ClassdiagramLayouter
This class implements a layout algorithm for class diagrams.
The layout process is performed in a row by row way. The position of the nodes in a row are set using the sequence given by the natural order of the nodes
The resulting layout sequence:
ClassdiagramNode.compareTo(java.lang.Object)
Nested Class Summary | |
private class |
ClassdiagramLayouter.NodeRow
This class keeps all the nodes in one row together and provides basic functionality for them. |
Field Summary | |
private UMLDiagram |
diagram
The diagram that will be layouted |
private static int |
eGap
Constant value for the gap between edges. |
private HashMap |
figNodes
HashMap with figures as key and Nodes as elements |
private static int |
hGap
Constant value for the horizontal gap between nodes. |
private int |
lastRow
The number of the last row |
private Vector |
layoutedClassNodes
layoutedClassNodes is a convenience which holds a subset of layoutedObjects (only ClassNodes) |
private Vector |
layoutedEdges
Holds all edges - subset of layoutedObjects |
private Vector |
layoutedObjects
Attribute layoutedObjects holds the objects to layout. |
private static Logger |
LOG
Logger for logging events. |
private static int |
maxRowWidth
Constant value for the maximum row width |
private Vector |
nodeRows
nodeRows contains all DiagramRows of the diagram |
private static int |
vGap
Constant value for the vertical gap between nodes. |
private int |
xPos
internal |
private int |
yPos
internal |
Constructor Summary | |
ClassdiagramLayouter(UMLDiagram theDiagram)
Constructor for the layouter. |
Method Summary | |
void |
add(LayoutedObject obj)
Add an object to layout. |
ClassdiagramNode |
getClassdiagramNode(int index)
Deprecated. |
private int |
getHGap()
Get the horizontal gap between nodes. |
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. |
private int |
getVGap()
Get the vertical gap between nodes. |
void |
layout()
Operation layout implements the actual layout algorithm. |
private void |
placeEdges()
All layoutedObjects of type "Edge" are placed using an edge-type specific layout algorithm. |
private void |
placeNode(ClassdiagramNode node)
Set the placement coordinate for a given node. |
private void |
placeNodes()
Place the NodeRows in the diagram |
private void |
rankAndWeightNodes()
Rank the nodes depending on their level (position in hierarchy) and set their weight to achieve a proper node-sequence for the layout. |
void |
remove(LayoutedObject obj)
Remove an object from the layout process. |
private void |
setupLinks()
Set the up- and downlinks for each node based on the edges which are shown in the diagram. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static int eGap
private static int hGap
private static final Logger LOG
private static int maxRowWidth
private static int vGap
private UMLDiagram diagram
private HashMap figNodes
private int lastRow
private Vector layoutedClassNodes
private Vector layoutedEdges
private Vector layoutedObjects
private Vector nodeRows
private int xPos
private int yPos
Constructor Detail |
public ClassdiagramLayouter(UMLDiagram theDiagram)
theDiagram
- the diagram to layoutMethod Detail |
public void add(LayoutedObject obj)
add
in interface Layouter
obj
- represents the object to layout.public ClassdiagramNode getClassdiagramNode(int index)
Attention! Should not be used, because the order of nodes might be changed due to a call of layout()
index
- represents the index of this ClassdiagramNode.
private int getHGap()
public Dimension getMinimumDiagramSize()
getMinimumDiagramSize
in interface Layouter
public LayoutedObject getObject(int index)
getObject
in interface Layouter
index
- represents the index of this object in the layouter.
public LayoutedObject[] getObjects()
getObjects
in interface Layouter
private int getVGap()
public void layout()
layout
in interface Layouter
private void placeEdges()
ClassdiagramEdge
private void placeNode(ClassdiagramNode node)
private void placeNodes()
private void rankAndWeightNodes()
public void remove(LayoutedObject obj)
remove
in interface Layouter
obj
- represents the object to remove.private void setupLinks()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |