ca.sqlpower.architect.layout
Interface ArchitectLayout

All Known Implementing Classes:
AbstractLayout, ArchitectGridLayout, BasicTreeAutoLayout, FruchtermanReingoldForceLayout, LineStraightenerLayout

public interface ArchitectLayout

The ArchitectLayout interface is a generic interface to a collection of graph layout algorithms. Its features include optional animation of the layout, and setting an overall maximum boundary for the laid-out graph.

Example for using this interface:

   ArchitectLayout layout = new MyFavouriteLayout();
   layout.setup(myNodes, myEdges, myMaximumBounds);
   while (!layout.isDone()) {
     layout.nextFrame();
     myComponent.paint();
   }
 

Author:
matt

Method Summary
 void done()
          Interrupts the algorithm and node bounds in a consistent state.
 java.awt.Dimension getNewArea(java.util.List<? extends LayoutNode> nodes)
           
 boolean isDone()
          Returns true iff the layout is finished.
 void nextFrame()
          Updates all the node locations to correspond with the positions they should have in the next frame.
 void setup(java.util.Collection<? extends LayoutNode> nodes, java.util.Collection<? extends LayoutEdge> edges, java.awt.Rectangle frame)
          Sets up the layout algoritm.
 

Method Detail

setup

void setup(java.util.Collection<? extends LayoutNode> nodes,
           java.util.Collection<? extends LayoutEdge> edges,
           java.awt.Rectangle frame)
Sets up the layout algoritm. You have to call this before attempting to use an ArchitectLayout instance to perform a layout. TODO change the Rectangle into a point. This should indicate where to start but the layout should determine dimensions

Parameters:
nodes - The list of entities to be placed on
preferedFrames - The prefered number of animation frames, may be ignored by the layout algorithm

getNewArea

java.awt.Dimension getNewArea(java.util.List<? extends LayoutNode> nodes)

done

void done()
Interrupts the algorithm and node bounds in a consistent state.


isDone

boolean isDone()
Returns true iff the layout is finished.

Returns:
true if the layout algorithm is finished with the layout, false otherwise

nextFrame

void nextFrame()
Updates all the node locations to correspond with the positions they should have in the next frame.



Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca