protected void renderBox(Box box) { if (box.size() == 0) return; for (int i = 0; i < box.size(); i++) { Node n = box.get(i); n.setAttribute("x", box.width * i / (double) box.size()); n.setAttribute("y", box.height / 2); break; case HORIZONTAL: n.setAttribute("x", box.width / 2); n.setAttribute("y", box.height * i / (double) box.size()); break; sx = 1 / (double) parentBox.size(); sy = 1 / Math.pow(2, box.level); break; case HORIZONTAL: sx = 1 / Math.pow(2, box.level); sy = 1 / (double) parentBox.size(); break;
protected void renderBox(Box box) { if (box.size() == 0) return; for (int i = 0; i < box.size(); i++) { Node n = box.get(i); n.setAttribute("x", box.width * i / (double) box.size()); n.setAttribute("y", box.height / 2); break; case HORIZONTAL: n.setAttribute("x", box.width / 2); n.setAttribute("y", box.height * i / (double) box.size()); break; sx = 1 / (double) parentBox.size(); sy = 1 / Math.pow(2, box.level); break; case HORIZONTAL: sx = 1 / Math.pow(2, box.level); sy = 1 / (double) parentBox.size(); break;
void translate(double dx, double dy) { for (int i = 0; i < size(); i++) { get(i).setAttribute("x", dx + get(i).getNumber("x")); get(i).setAttribute("y", dy + get(i).getNumber("y")); } } }
void scale(double sx, double sy) { width *= sx; height *= sy; for (int i = 0; i < size(); i++) { get(i).setAttribute("x", sx * get(i).getNumber("x")); get(i).setAttribute("y", sy * get(i).getNumber("y")); } }
void translate(double dx, double dy) { for (int i = 0; i < size(); i++) { get(i).setAttribute("x", dx + get(i).getNumber("x")); get(i).setAttribute("y", dy + get(i).getNumber("y")); } } }
void scale(double sx, double sy) { width *= sx; height *= sy; for (int i = 0; i < size(); i++) { get(i).setAttribute("x", sx * get(i).getNumber("x")); get(i).setAttribute("y", sy * get(i).getNumber("y")); } }