Java 类net.sf.jasperreports.engine.util.JRPenUtil 实例源码

项目:jasperreports    文件:JRPrintGraphicElementFactory.java   
@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;
}
项目:jasperreports    文件:JRGraphicElementFactory.java   
@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;
}
项目:ireport-fork    文件:AbstractPenProperty.java   
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));
    }
}