Class RadialTreeLayout<V,​E>

  • All Implemented Interfaces:
    com.google.common.base.Function<V,​java.awt.geom.Point2D>, Layout<V,​E>, java.util.function.Function<V,​java.awt.geom.Point2D>

    public class RadialTreeLayout<V,​E>
    extends TreeLayout<V,​E>
    A radial layout for Tree or Forest graphs.
    Author:
    Tom Nelson
    • Field Detail

      • polarLocations

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

      • RadialTreeLayout

        public RadialTreeLayout​(Forest<V,​E> g)
      • RadialTreeLayout

        public RadialTreeLayout​(Forest<V,​E> g,
                                int distx)
      • RadialTreeLayout

        public RadialTreeLayout​(Forest<V,​E> g,
                                int distx,
                                int disty)
    • Method Detail

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

        public void setLocation​(V v,
                                java.awt.geom.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
      • getPolarLocations

        public java.util.Map<V,​PolarPoint> getPolarLocations()
        Returns:
        a map from vertices to their locations in polar coordinates.
      • apply

        public java.awt.geom.Point2D apply​(V v)
        Specified by:
        apply in interface com.google.common.base.Function<V,​E>
        Specified by:
        apply in interface java.util.function.Function<V,​E>
        Overrides:
        apply in class TreeLayout<V,​E>