edu.uci.ics.jung.algorithms.layout
Class BalloonLayout<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.layout.TreeLayout<V,E>
      extended by edu.uci.ics.jung.algorithms.layout.BalloonLayout<V,E>
All Implemented Interfaces:
Layout<V,E>, org.apache.commons.collections15.Transformer<V,Point2D>

public class BalloonLayout<V,E>
extends TreeLayout<V,E>

A Layout implementation that assigns positions to Tree or Forest vertices using associations with nested circles ("balloons"). A balloon is nested inside another balloon if the first balloon's subtree is a subtree of the second balloon's subtree.

Author:
Tom Nelson

Field Summary
protected  Map<V,PolarPoint> polarLocations
           
protected  Map<V,Double> radii
           
 
Fields inherited from class edu.uci.ics.jung.algorithms.layout.TreeLayout
alreadyDone, basePositions, DEFAULT_DISTX, DEFAULT_DISTY, distX, distY, graph, locations, m_currentPoint, size
 
Constructor Summary
BalloonLayout(Forest<V,E> g)
          Creates an instance based on the input forest.
 
Method Summary
 Point2D getCenter(V v)
          Returns the coordinates of v's parent, or the center of this layout's area if it's a root.
 Map<V,Double> getRadii()
           
 void setLocation(V v, Point2D location)
          set the location of a vertex
protected  void setPolars(List<V> kids, Point2D parentLocation, double parentRadius)
           
protected  void setRootPolar(V root)
           
protected  void setRootPolars()
           
 void setSize(Dimension size)
          This method is not supported by this class.
 Point2D transform(V v)
           
 
Methods inherited from class edu.uci.ics.jung.algorithms.layout.TreeLayout
buildTree, buildTree, getCenter, getGraph, getSize, initialize, isLocked, lock, reset, setCurrentPositionFor, setGraph, setInitializer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

polarLocations

protected Map<V,PolarPoint> polarLocations

radii

protected Map<V,Double> radii
Constructor Detail

BalloonLayout

public BalloonLayout(Forest<V,E> g)
Creates an instance based on the input forest.

Method Detail

setRootPolars

protected void setRootPolars()

setRootPolar

protected void setRootPolar(V root)

setPolars

protected void setPolars(List<V> kids,
                         Point2D parentLocation,
                         double parentRadius)

setSize

public void setSize(Dimension size)
Description copied from class: TreeLayout
This method is not supported by this class. The size of the layout is determined by the topology of the tree, and by the horizontal and vertical spacing (optionally set by the constructor).

Specified by:
setSize in interface Layout<V,E>
Overrides:
setSize in class TreeLayout<V,E>

getCenter

public Point2D getCenter(V v)
Returns the coordinates of v's parent, or the center of this layout's area if it's a root.


setLocation

public void setLocation(V v,
                        Point2D location)
Description copied from interface: Layout
set the location of a vertex

Specified by:
setLocation in interface Layout<V,E>
Overrides:
setLocation in class TreeLayout<V,E>

transform

public Point2D transform(V v)
Specified by:
transform in interface org.apache.commons.collections15.Transformer<V,Point2D>
Overrides:
transform in class TreeLayout<V,E>

getRadii

public Map<V,Double> getRadii()
Returns:
the radii


Copyright © 2009. All Rights Reserved.