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; }
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 void updateModelMetrics() { double minX = component.getRectMinX(); double maxX = component.getRectMaxX(); double minY = component.getRectMinY(); double maxY = component.getRectMaxY(); xModelOrigin = minX; yModelOrigin = minY; wModel = maxX - minX; hModel = maxY - minY; }
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 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 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 void setModel(Cluster model) { this.model = model; component = createComponent(model); updateModelMetrics(); }
private void updateModelMetrics() { double minX = component.getRectMinX(); double maxX = component.getRectMaxX(); double minY = component.getRectMinY(); double maxY = component.getRectMaxY(); xModelOrigin = minX; yModelOrigin = minY; wModel = maxX - minX; hModel = maxY - minY; }
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; }
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 void setModel(Cluster model) { this.model = model; component = createComponent(model); updateModelMetrics(); }
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; }
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 void setModel(Cluster model) { this.model = model; component = createComponent(model); updateModelMetrics(); }