Class BalloonLayoutAlgorithm<V>
- java.lang.Object
-
- org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm<V>
-
- org.jungrapht.visualization.layout.algorithms.AbstractTreeLayoutAlgorithm<V>
-
- org.jungrapht.visualization.layout.algorithms.TreeLayoutAlgorithm<V>
-
- org.jungrapht.visualization.layout.algorithms.BalloonLayoutAlgorithm<V>
-
- All Implemented Interfaces:
Consumer<Function<V,Rectangle>>,Balloon,LayoutAlgorithm<V>,TreeLayout<V>,AfterRunnable,VertexBoundsFunctionConsumer<V>
public class BalloonLayoutAlgorithm<V> extends TreeLayoutAlgorithm<V> implements TreeLayout<V>, Balloon
ALayoutimplementation that assigns positions toTreeorGraphvertices 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBalloonLayoutAlgorithm.Builder<V,T extends BalloonLayoutAlgorithm<V>,B extends BalloonLayoutAlgorithm.Builder<V,T,B>>-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.layout.algorithms.LayoutAlgorithm
LayoutAlgorithm.NoOp<V>
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<V,PolarPoint>polarLocationsprotected Map<V,Double>radii-
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractTreeLayoutAlgorithm
baseBounds, correctOverlap, defaultRootPredicate, expandLayout, horizontalVertexSpacing, neighborCache, rootComparator, rootPredicate, vertexBoundsFunction, verticalVertexSpacing, visitedVertices
-
Fields inherited from class org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm
after
-
Fields inherited from interface org.jungrapht.visualization.layout.algorithms.TreeLayout
TREE_LAYOUT_HORIZONTAL_SPACING, TREE_LAYOUT_VERTICAL_SPACING
-
-
Constructor Summary
Constructors Modifier Constructor Description BalloonLayoutAlgorithm()protectedBalloonLayoutAlgorithm(BalloonLayoutAlgorithm.Builder<V,?,?> builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <V> BalloonLayoutAlgorithm.Builder<V,?,?>builder()booleanconstrained()PointgetCenter(LayoutModel<V> layoutModel, V vertex)Map<V,Double>getRadii()protected voidsetPolars(LayoutModel<V> layoutModel, Collection<V> kids, Point parentLocation, double angleToParent, double parentRadius, Set<V> seen)protected voidsetRootPolar(LayoutModel<V> layoutModel, V root)protected voidsetRootPolars(LayoutModel<V> layoutModel)voidvisit(LayoutModel<V> layoutModel)visit aLayoutModelto set all of the graph vertex positions according to the LayoutAlgorithm logic.-
Methods inherited from class org.jungrapht.visualization.layout.algorithms.TreeLayoutAlgorithm
buildTree, buildTree, calculateHeight, calculateHeight, calculateWidth, calculateWidth, getBaseBounds, getCenter, getInitialPosition, getSpanningTree, merge
-
Methods inherited from class org.jungrapht.visualization.layout.algorithms.AbstractTreeLayoutAlgorithm
adjustToFill, expandToFill, moveVerticesThatOverlapVerticalEdges, setRootComparator, setRootPredicate, setVertexBoundsFunction
-
Methods inherited from class org.jungrapht.visualization.layout.algorithms.AbstractLayoutAlgorithm
computeAverageVertexDimension, computeLayoutExtent, expandToFill, runAfter, setAfter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jungrapht.visualization.layout.algorithms.util.AfterRunnable
runAfter, setAfter
-
Methods inherited from interface org.jungrapht.visualization.layout.algorithms.LayoutAlgorithm
cancel
-
Methods inherited from interface org.jungrapht.visualization.layout.algorithms.TreeLayout
getBaseBounds, setRootComparator, setRootPredicate
-
Methods inherited from interface org.jungrapht.visualization.layout.algorithms.util.VertexBoundsFunctionConsumer
accept, setVertexBoundsFunction
-
-
-
-
Constructor Detail
-
BalloonLayoutAlgorithm
public BalloonLayoutAlgorithm()
-
BalloonLayoutAlgorithm
protected BalloonLayoutAlgorithm(BalloonLayoutAlgorithm.Builder<V,?,?> builder)
-
-
Method Detail
-
builder
public static <V> BalloonLayoutAlgorithm.Builder<V,?,?> builder()
-
visit
public void visit(LayoutModel<V> layoutModel)
Description copied from class:TreeLayoutAlgorithmvisit aLayoutModelto set all of the graph vertex positions according to the LayoutAlgorithm logic.- Specified by:
visitin interfaceLayoutAlgorithm<V>- Overrides:
visitin classTreeLayoutAlgorithm<V>- Parameters:
layoutModel- the mediator between the container for vertices (the Graph) and the mapping
-
setRootPolars
protected void setRootPolars(LayoutModel<V> layoutModel)
-
setRootPolar
protected void setRootPolar(LayoutModel<V> layoutModel, V root)
-
setPolars
protected void setPolars(LayoutModel<V> layoutModel, Collection<V> kids, Point parentLocation, double angleToParent, double parentRadius, Set<V> seen)
-
getCenter
public Point getCenter(LayoutModel<V> layoutModel, V vertex)
- Parameters:
vertex- the vertex whose center is to be returned- Returns:
- the coordinates of
vertex's parent, or the center of this layout's area if it's a root.
-
constrained
public boolean constrained()
- Specified by:
constrainedin interfaceLayoutAlgorithm<V>- Overrides:
constrainedin classTreeLayoutAlgorithm<V>
-
-