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:
Layout<V,E>,org.apache.commons.collections4.Transformer<V,java.awt.geom.Point2D>
public class BalloonLayout<V,E> extends TreeLayout<V,E>
ALayoutimplementation that assigns positions toTreeorForestvertices 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 Summary
Fields Modifier and Type Field Description protected java.util.Map<V,PolarPoint>polarLocationsprotected java.util.Map<V,java.lang.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
Constructors Constructor Description BalloonLayout(edu.uci.ics.jung.graph.Forest<V,E> g)Creates an instance based on the input forest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Point2DgetCenter(V v)Returns the coordinates ofv's parent, or the center of this layout's area if it's a root.java.util.Map<V,java.lang.Double>getRadii()voidsetLocation(V v, java.awt.geom.Point2D location)set the location of a vertexprotected voidsetPolars(java.util.List<V> kids, java.awt.geom.Point2D parentLocation, double parentRadius)protected voidsetRootPolar(V root)protected voidsetRootPolars()voidsetSize(java.awt.Dimension size)This method is not supported by this class.java.awt.geom.Point2Dtransform(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
-
-
-
-
Field Detail
-
polarLocations
protected java.util.Map<V,PolarPoint> polarLocations
-
radii
protected java.util.Map<V,java.lang.Double> radii
-
-
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:TreeLayoutThis 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).
-
getCenter
public java.awt.geom.Point2D getCenter(V v)
Returns the coordinates ofv'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:Layoutset the location of a vertex- Specified by:
setLocationin interfaceLayout<V,E>- Overrides:
setLocationin classTreeLayout<V,E>
-
transform
public java.awt.geom.Point2D transform(V v)
-
getRadii
public java.util.Map<V,java.lang.Double> getRadii()
- Returns:
- the radii
-
-