protected void generateBox(Writer writer, Tree parent) throws IOException { // draw the box in the background Rectangle2D.Double box = getBoundsOfNode(parent); writer.write(rect(""+box.x, ""+box.y, ""+box.width, ""+box.height, "fill:orange; stroke:rgb(0,0,0);", "rx=\"1\"")); // draw the text on top of the box (possibly multiple lines) String line = getText(parent).replace("<","<").replace(">",">"); int fontSize = 10; int x = (int) box.x + 2; int y = (int) box.y + fontSize - 1; String style = String.format("font-family:sans-serif;font-size:%dpx;", fontSize); writer.write(text(""+x, ""+y, style, line)); }
protected void generateBox(Writer writer, Tree parent) throws IOException { // draw the box in the background Rectangle2D.Double box = getBoundsOfNode(parent); writer.write(rect(""+box.x, ""+box.y, ""+box.width, ""+box.height, "fill:orange; stroke:rgb(0,0,0);", "rx=\"1\"")); // draw the text on top of the box (possibly multiple lines) String line = getText(parent).replace("<","<").replace(">",">"); int fontSize = 10; int x = (int) box.x + 2; int y = (int) box.y + fontSize - 1; String style = String.format("font-family:sans-serif;font-size:%dpx;", fontSize); writer.write(text(""+x, ""+y, style, line)); }
protected void generateBox(Writer writer, Tree parent) throws IOException { // draw the box in the background Rectangle2D.Double box = getBoundsOfNode(parent); writer.write(rect(""+box.x, ""+box.y, ""+box.width, ""+box.height, "fill:orange; stroke:rgb(0,0,0);", "rx=\"1\"")); // draw the text on top of the box (possibly multiple lines) String line = getText(parent).replace("<","<").replace(">",">"); int fontSize = 10; int x = (int) box.x + 2; int y = (int) box.y + fontSize - 1; String style = String.format("font-family:sans-serif;font-size:%dpx;", fontSize); writer.write(text(""+x, ""+y, style, line)); }