Cleanup
This commit is contained in:
@@ -4,6 +4,9 @@ import io.anuke.arc.collection.*;
|
|||||||
import io.anuke.arc.math.*;
|
import io.anuke.arc.math.*;
|
||||||
|
|
||||||
public class RadialTreeLayout implements TreeLayout{
|
public class RadialTreeLayout implements TreeLayout{
|
||||||
|
private static ObjectSet<TreeNode> visited = new ObjectSet<>();
|
||||||
|
private static Queue<TreeNode> queue = new Queue<>();
|
||||||
|
|
||||||
public float startRadius, delta;
|
public float startRadius, delta;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -31,17 +34,15 @@ public class RadialTreeLayout implements TreeLayout{
|
|||||||
child.x = x;
|
child.x = x;
|
||||||
child.y = y;
|
child.y = y;
|
||||||
|
|
||||||
if(child.children.length > 0){
|
if(child.children.length > 0) radialize(child, theta, mi);
|
||||||
radialize(child, theta, mi);
|
|
||||||
}
|
|
||||||
theta = mi;
|
theta = mi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int bfs(TreeNode node, boolean assign){
|
int bfs(TreeNode node, boolean assign){
|
||||||
|
visited.clear();
|
||||||
|
queue.clear();
|
||||||
if(assign) node.number = 0;
|
if(assign) node.number = 0;
|
||||||
ObjectSet<TreeNode> visited = new ObjectSet<>();
|
|
||||||
Queue<TreeNode> queue = new Queue<>();
|
|
||||||
int leaves = 0;
|
int leaves = 0;
|
||||||
|
|
||||||
visited.add(node);
|
visited.add(node);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public interface TreeLayout{
|
|||||||
|
|
||||||
//internal stuff
|
//internal stuff
|
||||||
public float mode, prelim, change, shift;
|
public float mode, prelim, change, shift;
|
||||||
public int number = -1, ancestors;
|
public int number = -1;
|
||||||
public TreeNode thread, ancestor;
|
public TreeNode thread, ancestor;
|
||||||
|
|
||||||
public boolean isLeaf(){
|
public boolean isLeaf(){
|
||||||
|
|||||||
Reference in New Issue
Block a user