private ClusterComponent createComponent(Cluster model) { double virtualModelHeight = 1; VCoord initCoord = new VCoord(0, virtualModelHeight / 2); ClusterComponent comp = createComponent(model, initCoord, virtualModelHeight); comp.setLinkPoint(initCoord); return comp; }
private ClusterComponent createComponent(Cluster model) { double virtualModelHeight = 1; VCoord initCoord = new VCoord(0, virtualModelHeight / 2); ClusterComponent comp = createComponent(model, initCoord, virtualModelHeight); comp.setLinkPoint(initCoord); return comp; }
private ClusterComponent createComponent(Cluster model) { double virtualModelHeight = 1; VCoord initCoord = new VCoord(0, virtualModelHeight / 2); ClusterComponent comp = createComponent(model, initCoord, virtualModelHeight); comp.setLinkPoint(initCoord); return comp; }
private ClusterComponent createComponent(Cluster cluster, VCoord initCoord, double clusterHeight) { ClusterComponent comp = null; if (cluster != null) { comp = new ClusterComponent(cluster, cluster.isLeaf(), initCoord); double leafHeight = clusterHeight / cluster.countLeafs(); double yChild = initCoord.getY() - (clusterHeight / 2); double distance = cluster.getDistanceValue() == null ? 0 : cluster.getDistanceValue(); for (Cluster child : cluster.getChildren()) { int childLeafCount = child.countLeafs(); double childHeight = childLeafCount * leafHeight; double childDistance = child.getDistanceValue() == null ? 0 : child.getDistanceValue(); VCoord childInitCoord = new VCoord(initCoord.getX() + (distance - childDistance), yChild + childHeight / 2.0); yChild += childHeight; /* Traverse cluster node tree */ ClusterComponent childComp = createComponent(child, childInitCoord, childHeight); childComp.setLinkPoint(initCoord); comp.getChildren().add(childComp); } } return comp; }
private ClusterComponent createComponent(Cluster cluster, VCoord initCoord, double clusterHeight) { ClusterComponent comp = null; if (cluster != null) { comp = new ClusterComponent(cluster, cluster.isLeaf(), initCoord); double leafHeight = clusterHeight / cluster.countLeafs(); double yChild = initCoord.getY() - (clusterHeight / 2); double distance = cluster.getDistanceValue() == null ? 0 : cluster.getDistanceValue(); for (Cluster child : cluster.getChildren()) { int childLeafCount = child.countLeafs(); double childHeight = childLeafCount * leafHeight; double childDistance = child.getDistanceValue() == null ? 0 : child.getDistanceValue(); VCoord childInitCoord = new VCoord(initCoord.getX() + (distance - childDistance), yChild + childHeight / 2.0); yChild += childHeight; /* Traverse cluster node tree */ ClusterComponent childComp = createComponent(child, childInitCoord, childHeight); childComp.setLinkPoint(initCoord); comp.getChildren().add(childComp); } } return comp; }
private ClusterComponent createComponent(Cluster<T> cluster, VCoord initCoord, double clusterHeight) { ClusterComponent comp = null; if (cluster != null) { comp = new ClusterComponent(cluster, cluster.isLeaf(), initCoord); double leafHeight = clusterHeight / cluster.countLeafs(); double yChild = initCoord.getY() - (clusterHeight / 2); double distance = cluster.getDistance() == null ? 0 : cluster.getDistance(); for (Cluster<T> child : cluster.getChildren()) { int childLeafCount = child.countLeafs(); double childHeight = childLeafCount * leafHeight; double childDistance = child.getDistance() == null ? 0 : child.getDistance(); VCoord childInitCoord = new VCoord(initCoord.getX() + (distance - childDistance), yChild + childHeight / 2.0); yChild += childHeight; /* Traverse cluster node tree */ ClusterComponent childComp = createComponent(child, childInitCoord, childHeight); childComp.setLinkPoint(initCoord); comp.getChildren().add(childComp); } } return comp; }