@Override public Object createObject(Attributes atts) { JRBasePrintGraphicElement graphicElement = (JRBasePrintGraphicElement)digester.peek(); PenEnum pen = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_pen)); if (pen != null) { if (log.isWarnEnabled()) { log.warn("The 'pen' attribute is deprecated. Use the <pen> tag instead."); } JRPenUtil.setLinePenFromPen(pen, graphicElement.getLinePen()); } FillEnum fill = FillEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_fill)); if (fill != null) { graphicElement.setFill(fill); } return graphicElement; }
@Override public Object createObject(Attributes atts) { JRDesignGraphicElement graphicElement = (JRDesignGraphicElement)digester.peek(); StretchTypeEnum stretchType = StretchTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_stretchType)); if (stretchType != null) { if (log.isWarnEnabled()) { log.warn("The 'stretchType' attribute in <graphicElement> tag is deprecated. Use the same attribut in <reportElement> tag instead."); } graphicElement.setStretchType(stretchType); } PenEnum pen = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_pen)); if (pen != null) { if (log.isWarnEnabled()) { log.warn("The 'pen' attribute is deprecated. Use the <pen> tag instead."); } JRPenUtil.setLinePenFromPen(pen, graphicElement.getLinePen()); } FillEnum fill = FillEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_fill)); if (fill != null) { graphicElement.setFill(fill); } return graphicElement; }
public void setPen(JRPen pen) { if (pen == null) { setPaintProvider(null); setStroke(null); } else { setPaintProvider(new ColorProvider(pen.getLineColor())); setStroke(JRPenUtil.getStroke(pen, BasicStroke.CAP_SQUARE)); } }