public double getRectMaxY() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.max(initPoint.getY(), linkPoint.getY()); for (ClusterComponent child : getChildren()) { val = Math.max(val, child.getRectMaxY()); } return val; }
public double getRectMinX() { // TODO Better use closure / callback here assert initPoint != null && linkPoint != null; double val = Math.min(initPoint.getX(), linkPoint.getX()); for (ClusterComponent child : getChildren()) { val = Math.min(val, child.getRectMinX()); } return val; }
public int getMaxNameWidth(Graphics2D g, boolean includeNonLeafs) { int width = getNameWidth(g, includeNonLeafs); for (ClusterComponent comp : getChildren()) { int childWidth = comp.getMaxNameWidth(g, includeNonLeafs); if (childWidth > width) { width = childWidth; } } return width; } }
public double getRectMaxY() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.max(initPoint.getY(), linkPoint.getY()); for (ClusterComponent child : getChildren()) { val = Math.max(val, child.getRectMaxY()); } return val; }
public int getMaxNameWidth(Graphics2D g, boolean includeNonLeafs) { int width = getNameWidth(g, includeNonLeafs); for (ClusterComponent comp : getChildren()) { int childWidth = comp.getMaxNameWidth(g, includeNonLeafs); if (childWidth > width) { width = childWidth; } } return width; } }
public double getRectMaxX() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.max(initPoint.getX(), linkPoint.getX()); for (ClusterComponent child : getChildren()) { val = Math.max(val, child.getRectMaxX()); } return val; }
public double getRectMaxY() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.max(initPoint.getY(), linkPoint.getY()); for (ClusterComponent child : getChildren()) { val = Math.max(val, child.getRectMaxY()); } return val; }
public double getRectMinX() { // TODO Better use closure / callback here assert initPoint != null && linkPoint != null; double val = Math.min(initPoint.getX(), linkPoint.getX()); for (ClusterComponent child : getChildren()) { val = Math.min(val, child.getRectMinX()); } return val; }
public double getRectMinY() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.min(initPoint.getY(), linkPoint.getY()); for (ClusterComponent child : getChildren()) { val = Math.min(val, child.getRectMinY()); } return val; }
public double getRectMaxX() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.max(initPoint.getX(), linkPoint.getX()); for (ClusterComponent child : getChildren()) { val = Math.max(val, child.getRectMaxX()); } return val; }
public double getRectMinX() { // TODO Better use closure / callback here assert initPoint != null && linkPoint != null; double val = Math.min(initPoint.getX(), linkPoint.getX()); for (ClusterComponent child : getChildren()) { val = Math.min(val, child.getRectMinX()); } return val; }
public double getRectMinY() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.min(initPoint.getY(), linkPoint.getY()); for (ClusterComponent child : getChildren()) { val = Math.min(val, child.getRectMinY()); } return val; }
public double getRectMaxX() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.max(initPoint.getX(), linkPoint.getX()); for (ClusterComponent child : getChildren()) { val = Math.max(val, child.getRectMaxX()); } return val; }
public double getRectMinY() { // TODO Better use closure here assert initPoint != null && linkPoint != null; double val = Math.min(initPoint.getY(), linkPoint.getY()); for (ClusterComponent child : getChildren()) { val = Math.min(val, child.getRectMinY()); } return val; }
public int getMaxNameWidth(Graphics2D g, boolean includeNonLeafs) { int width = getNameWidth(g, includeNonLeafs); for (ClusterComponent comp : getChildren()) { int childWidth = comp.getMaxNameWidth(g, includeNonLeafs); if (childWidth > width) { width = childWidth; } } return width; } }
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; }
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; }