/** Request the painting of the border */ @Override public void paint(Graphics graphics) { try { Graphics2D g = ComponentFigure.getG2D(graphics); if (g != null) { Rectangle b = getBounds(); JRPrintElement pe = new JRBasePrintText(null); pe.setX(b.x + 10); pe.setY(b.y + 10); pe.setWidth(b.width - 20); pe.setHeight(b.height - 20); if (section.getElement() instanceof ILineBox && section.getElement() != null) bd.drawBox(g, ((ILineBox) section.getElement()).getBoxContainer().getLineBox(), pe); else if (section.getElement() instanceof MStyle) { MStyle styleModel = (MStyle) section.getElement(); bd.drawBox(g, ((JRStyle) styleModel.getValue()).getLineBox(), pe); } } else { graphics.drawRectangle(0, 0, 100, 100); } } catch (Exception e) { // when a font is missing exception is thrown by DrawVisitor // FIXME: maybe draw something, else? e.printStackTrace(); } }