Class BalloonLayout<V,E>

java.lang.Object
edu.uci.ics.jung.algorithms.layout.TreeLayout<V,E>
edu.uci.ics.jung.algorithms.layout.BalloonLayout<V,E>
All Implemented Interfaces:
com.google.common.base.Function<V,Point2D>, Layout<V,E>, Function<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.
  • Field Details

    • polarLocations

      protected com.google.common.cache.LoadingCache<V,PolarPoint> polarLocations
    • radii

      protected Map<V,Double> radii
  • Constructor Details

    • BalloonLayout

      public BalloonLayout(Forest<V,E> g)
      Creates an instance based on the input forest.
      Parameters:
      g - the forest on which this layout will operate
  • Method Details

    • 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>
      Parameters:
      size - the space to use to lay out this graph
    • getCenter

      public Point2D getCenter(V v)
      Parameters:
      v - the vertex whose center is to be returned
      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
      Changes the layout coordinates of v to location.
      Specified by:
      setLocation in interface Layout<V,E>
      Overrides:
      setLocation in class TreeLayout<V,E>
      Parameters:
      v - the vertex whose location is to be specified
      location - the coordinates of the specified location
    • apply

      public Point2D apply(V v)
      Specified by:
      apply in interface com.google.common.base.Function<V,E>
      Specified by:
      apply in interface Function<V,E>
      Overrides:
      apply in class TreeLayout<V,E>
    • getRadii

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