Class BalloonLayout<V,​E>

  • All Implemented Interfaces:
    Layout<V,​E>, org.apache.commons.collections4.Transformer<V,​java.awt.geom.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 Detail

      • polarLocations

        protected java.util.Map<V,​PolarPoint> polarLocations
      • radii

        protected java.util.Map<V,​java.lang.Double> radii
    • Constructor Detail

      • BalloonLayout

        public BalloonLayout​(edu.uci.ics.jung.graph.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​(java.util.List<V> kids,
                                 java.awt.geom.Point2D parentLocation,
                                 double parentRadius)
      • setSize

        public void setSize​(java.awt.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 java.awt.geom.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,
                                java.awt.geom.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 java.awt.geom.Point2D transform​(V v)
        Specified by:
        transform in interface org.apache.commons.collections4.Transformer<V,​E>
        Overrides:
        transform in class TreeLayout<V,​E>
      • getRadii

        public java.util.Map<V,​java.lang.Double> getRadii()
        Returns:
        the radii