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

java.lang.Object
  extended byorg.argouml.uml.diagram.static_structure.layout.ClassdiagramLayouter.NodeRow
Enclosing class:
ClassdiagramLayouter

private class ClassdiagramLayouter.NodeRow
extends Object

This class keeps all the nodes in one row together and provides basic functionality for them.


Field Summary
private  Vector nodes
          Keeps all nodes of this row
private  int rowNumber
          The row number of this row
 
Constructor Summary
ClassdiagramLayouter.NodeRow(int aRowNumber)
          Construct an empty NodeRow with the given row number
 
Method Summary
 void addNode(ClassdiagramNode node)
          Add a node to this NodeRow.
private  void adjustRowNodes()
          Adjust the properties for all nodes in this row: rank, column, offset for edges
 ClassdiagramLayouter.NodeRow doSplit(int maxWidth, int gap)
          Splittable are packages and stanalone-nodes.
 Vector getNodes()
           
 int getRowNumber()
           
 Iterator getSortedIterator()
          Get an Iterator for the nodes of this row, sorted by their natural order
 int getWidth(int gap)
          Get the width for this row using the given horizontal gap between nodes.
 void setRowNumber(int rowNum)
          Set the row number of this row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

private Vector nodes
Keeps all nodes of this row


rowNumber

private int rowNumber
The row number of this row

Constructor Detail

ClassdiagramLayouter.NodeRow

public ClassdiagramLayouter.NodeRow(int aRowNumber)
Construct an empty NodeRow with the given row number

Method Detail

addNode

public void addNode(ClassdiagramNode node)
Add a node to this NodeRow.

Parameters:
node - The node to be added

doSplit

public ClassdiagramLayouter.NodeRow doSplit(int maxWidth,
                                            int gap)
Splittable are packages and stanalone-nodes. A split is performed, if the maximum width is reached or when a type change occurs (from package to not-package, from standalone to not-standalone). Split this row into two, if Return the new NodeRow or null if this row is not split.

Parameters:
maxWidth - The maximum allowed row width
gap - The horizontal gab between two nodes
Returns:
NodeRow

getNodes

public Vector getNodes()
Returns:
Returns the nodes.

getRowNumber

public int getRowNumber()
Returns:
Returns the rowNumber.

getSortedIterator

public Iterator getSortedIterator()
Get an Iterator for the nodes of this row, sorted by their natural order

Returns:
Iterator for sorted nodes

getWidth

public int getWidth(int gap)
Get the width for this row using the given horizontal gap between nodes.

Parameters:
gap - The horizontal gap between nodes
Returns:
The width of this row

setRowNumber

public void setRowNumber(int rowNum)
Set the row number of this row

Parameters:
rowNum - The rowNumber to set.

adjustRowNodes

private void adjustRowNodes()
Adjust the properties for all nodes in this row: rank, column, offset for edges



ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook