Java 类net.sf.jasperreports.engine.JRParagraph 实例源码

项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public JRStyle getBaseStyle(JRParagraph paragraph)
{
    if (paragraph != null)
    {
        JRParagraphContainer paragraphContainer = paragraph.getParagraphContainer();

        if (paragraphContainer instanceof JRStyle)
        {
            return getBaseStyle((JRStyle)paragraphContainer);
        }

        return getBaseStyle(paragraphContainer);
    }
    return null;
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public Float getLineSpacingSize(JRParagraph paragraph)
{
    Float ownLineSpacingSize = paragraph.getOwnLineSpacingSize();
    if (ownLineSpacingSize != null)
    {
        return ownLineSpacingSize;
    }
    JRStyle style = getBaseStyle(paragraph);
    if (style != null)
    {
        Float lineSpacingSize = style.getParagraph().getLineSpacingSize();
        if (lineSpacingSize != null)
        {
            return lineSpacingSize;
        }
    }
    return propertiesUtil.getFloatProperty(JRParagraph.DEFAULT_LINE_SPACING_SIZE);
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public Integer getFirstLineIndent(JRParagraph paragraph)
{
    Integer ownFirstLineIndent = paragraph.getOwnFirstLineIndent();
    if (ownFirstLineIndent != null)
    {
        return ownFirstLineIndent;
    }
    JRStyle style = getBaseStyle(paragraph);
    if (style != null)
    {
        Integer firstLineIndent = style.getParagraph().getFirstLineIndent();
        if (firstLineIndent != null)
        {
            return firstLineIndent;
        }
    }
    return propertiesUtil.getIntegerProperty(JRParagraph.DEFAULT_FIRST_LINE_INDENT);
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public Integer getLeftIndent(JRParagraph paragraph)
{
    Integer ownLeftIndent = paragraph.getOwnLeftIndent();
    if (ownLeftIndent != null)
    {
        return ownLeftIndent;
    }
    JRStyle style = getBaseStyle(paragraph);
    if (style != null)
    {
        Integer leftIndent = style.getParagraph().getLeftIndent();
        if (leftIndent != null)
        {
            return leftIndent;
        }
    }
    return propertiesUtil.getIntegerProperty(JRParagraph.DEFAULT_LEFT_INDENT);
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public Integer getRightIndent(JRParagraph paragraph)
{
    Integer ownRightIndent = paragraph.getOwnRightIndent();
    if (ownRightIndent != null)
    {
        return ownRightIndent;
    }
    JRStyle style = getBaseStyle(paragraph);
    if (style != null)
    {
        Integer rightIndent = style.getParagraph().getRightIndent();
        if (rightIndent != null)
        {
            return rightIndent;
        }
    }
    return propertiesUtil.getIntegerProperty(JRParagraph.DEFAULT_RIGHT_INDENT);
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public Integer getSpacingBefore(JRParagraph paragraph)
{
    Integer ownSpacingBefore = paragraph.getOwnSpacingBefore();
    if (ownSpacingBefore != null)
    {
        return ownSpacingBefore;
    }
    JRStyle style = getBaseStyle(paragraph);
    if (style != null)
    {
        Integer spacingBefore = style.getParagraph().getSpacingBefore();
        if (spacingBefore != null)
        {
            return spacingBefore;
        }
    }
    return propertiesUtil.getIntegerProperty(JRParagraph.DEFAULT_SPACING_BEFORE);
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public Integer getSpacingAfter(JRParagraph paragraph)
{
    Integer ownSpacingAfter = paragraph.getOwnSpacingAfter();
    if (ownSpacingAfter != null)
    {
        return ownSpacingAfter;
    }
    JRStyle style = getBaseStyle(paragraph);
    if (style != null)
    {
        Integer spacingAfter = style.getParagraph().getSpacingAfter();
        if (spacingAfter != null)
        {
            return spacingAfter;
        }
    }
    return propertiesUtil.getIntegerProperty(JRParagraph.DEFAULT_SPACING_AFTER);
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public Integer getTabStopWidth(JRParagraph paragraph)
{
    Integer ownTabStopWidth = paragraph.getOwnTabStopWidth();
    if (ownTabStopWidth != null)
    {
        return ownTabStopWidth;
    }
    JRStyle style = getBaseStyle(paragraph);
    if (style != null)
    {
        Integer tabStopWidth = style.getParagraph().getTabStopWidth();
        if (tabStopWidth != null)
        {
            return tabStopWidth;
        }
    }
    return propertiesUtil.getIntegerProperty(JRParagraph.DEFAULT_TAB_STOP_WIDTH);
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public TabStop[] getTabStops(JRParagraph paragraph)
{
    TabStop[] ownTabStops = paragraph.getOwnTabStops();
    if (ownTabStops != null)
    {
        return ownTabStops;
    }
    JRStyle style = getBaseStyle(paragraph);
    if (style != null)
    {
        TabStop[] tabStops = style.getParagraph().getTabStops();
        if (tabStops != null)
        {
            return tabStops;
        }
    }
    return null;
}
项目:jasperreports    文件:StyleResolver.java   
/**
 * 
 */
public LineSpacingEnum getLineSpacing(JRParagraph paragraph)
{
    LineSpacingEnum ownLineSpacing = paragraph.getOwnLineSpacing();
    if (ownLineSpacing != null)
    {
        return ownLineSpacing;
    }
    JRStyle baseStyle = getBaseStyle(paragraph);
    if (baseStyle != null)
    {
        LineSpacingEnum lineSpacing = baseStyle.getParagraph().getLineSpacing();
        if (lineSpacing != null)
        {
            return lineSpacing;
        }
    }
    return LineSpacingEnum.SINGLE;//FIXMENOW could we make all enums in default props?
}
项目:jasperreports    文件:JRParagraphFactory.java   
@Override
public Object createObject(Attributes atts)
{
    JRParagraphContainer paragraphContainer = (JRParagraphContainer) digester.peek();
    JRParagraph paragraph = paragraphContainer.getParagraph();
    setParagraphAttributes(atts, paragraph);
    return paragraph;
}
项目:jasperreports    文件:JRXmlBaseWriter.java   
/**
 *
 */
public void writeParagraph(JRParagraph paragraph, XmlNamespace namespace) throws IOException
{
    if (paragraph != null && isNewerVersionOrEqual(JRConstants.VERSION_4_0_2))
    {
        writer.startElement(JRXmlConstants.ELEMENT_paragraph, namespace);

        writer.addAttribute(JRXmlConstants.ATTRIBUTE_lineSpacing, paragraph.getOwnLineSpacing());
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_lineSpacingSize, paragraph.getOwnLineSpacingSize());
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_firstLineIndent, paragraph.getOwnFirstLineIndent());
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_leftIndent, paragraph.getOwnLeftIndent());
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_rightIndent, paragraph.getOwnRightIndent());
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_spacingBefore, paragraph.getOwnSpacingBefore());
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_spacingAfter, paragraph.getOwnSpacingAfter());
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_tabStopWidth, paragraph.getOwnTabStopWidth());

        /*   */
        TabStop[] tabStops = paragraph.getTabStops();
        if (tabStops != null && tabStops.length > 0)
        {
            for(int i = 0; i < tabStops.length; i++)
            {
                writeTabStop(tabStops[i]);
            }
        }

        writer.closeElement(true);
    }
}
项目:jasperreports    文件:StyleUtil.java   
/**
 * Merges two paragraphs, by appending the properties of the source paragraph to the ones of the destination paragraph.
 */
public static void appendParagraph(JRParagraph destParagraph, JRParagraph srcParagraph)
{
    if (srcParagraph.getOwnLineSpacing() != null)
    {
        destParagraph.setLineSpacing(srcParagraph.getOwnLineSpacing());
    }
    if (srcParagraph.getOwnLeftIndent() != null)
    {
        destParagraph.setLeftIndent(srcParagraph.getOwnLeftIndent());
    }
    if (srcParagraph.getOwnRightIndent() != null)
    {
        destParagraph.setRightIndent(srcParagraph.getOwnRightIndent());
    }
    if (srcParagraph.getOwnSpacingBefore() != null)
    {
        destParagraph.setSpacingBefore(srcParagraph.getOwnSpacingBefore());
    }
    if (srcParagraph.getOwnSpacingAfter() != null)
    {
        destParagraph.setSpacingAfter(srcParagraph.getOwnSpacingAfter());
    }
    if (srcParagraph.getOwnTabStopWidth() != null)
    {
        destParagraph.setTabStopWidth(srcParagraph.getOwnTabStopWidth());
    }
}
项目:jasperreports    文件:JRApiWriter.java   
/**
 *
 */
protected void writeParagraph(JRParagraph paragraph, String paragraphHolder)
{
    if (paragraph != null)
    {
        String paragraphName = paragraphHolder + "Paragraph";
        write( "JRParagraph " + paragraphName + " = " + paragraphHolder + ".getParagraph();\n");
        write( paragraphName + ".setLineSpacing({0});\n", paragraph.getOwnLineSpacing());
        write( paragraphName + ".setLineSpacingSize({0});\n", paragraph.getOwnLineSpacingSize());
        write( paragraphName + ".setFirstLineIndent({0});\n", paragraph.getOwnFirstLineIndent());
        write( paragraphName + ".setLeftIndent({0});\n", paragraph.getOwnLeftIndent());
        write( paragraphName + ".setRightIndent({0});\n", paragraph.getOwnRightIndent());
        write( paragraphName + ".setSpacingBefore({0});\n", paragraph.getOwnSpacingBefore());
        write( paragraphName + ".setSpacingAfter({0});\n", paragraph.getOwnSpacingAfter());
        write( paragraphName + ".setTabStopWidth(Integer.valueOf({0, number, #}));\n", paragraph.getOwnTabStopWidth());//FIXMENOW is this pattern needed?

        TabStop[] tabStops = paragraph.getTabStops();
        if (tabStops != null && tabStops.length > 0)
        {
            for(int i = 0; i < tabStops.length; i++)
            {
                writeTabStop( tabStops[i], paragraphName + "TabStop" + i);
                write( paragraphName +".addTabStop(" + paragraphName + "TabStop" + i + ");\n");
            }
        }

        flush();
    }
}
项目:jasperreports    文件:DocxParagraphHelper.java   
/**
 *
 */
private void exportPropsHeader(String styleNameReference, JRParagraph paragraph)
{
    write("      <w:pPr>\n");
    if (styleNameReference != null)
    {
        write("        <w:pStyle w:val=\"" + styleNameReference + "\"/>\n");
    }
    if(paragraph != null)
    {
        write("      <w:ind");
        if (paragraph.getOwnFirstLineIndent() != null)
        {
            write(" w:firstLine=\"" + LengthUtil.twip(paragraph.getOwnFirstLineIndent().intValue()) + "\"");
        }
        if (paragraph.getOwnLeftIndent() != null)
        {
            write(" w:left=\"" + LengthUtil.twip(paragraph.getOwnLeftIndent().intValue()) + "\"");
        }
        if (paragraph.getOwnRightIndent() != null)
        {
            write(" w:right=\"" + LengthUtil.twip(paragraph.getOwnRightIndent().intValue()) + "\"");
        }
        write("/>\n");
    }
    if (pageBreak)
    {
        write("        <w:pageBreakBefore/>\n");
        pageBreak = false;
    }
}
项目:jasperreports    文件:DocxParagraphHelper.java   
/**
 *
 */
private void exportTabStops(JRParagraph paragraph)
{
    TabStop[] tabStops = paragraph.getTabStops();
    if (tabStops != null && tabStops.length > 0)
    {
        write("   <w:tabs>\n");
        for (int i = 0; i < tabStops.length; i++)
        {
            TabStop tabStop = tabStops[i];
            write("   <w:tab w:pos=\"" + LengthUtil.twip(tabStop.getPosition()) + "\" w:val=\"" + getTabStopAlignment(tabStop.getAlignment()) + "\"/>\n");
        }
        write("   </w:tabs>\n");
    }
}
项目:jasperreports    文件:JRXmlExporter.java   
/**
 * @throws IOException 
 *
 */
private void exportParagraph(JRParagraph paragraph) throws IOException
{
    if (paragraph != null)
    {
        xmlWriter.startElement(JRXmlConstants.ELEMENT_paragraph);

        xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_lineSpacing, paragraph.getOwnLineSpacing());
        xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_lineSpacingSize, paragraph.getOwnLineSpacingSize());
        xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_firstLineIndent, paragraph.getOwnFirstLineIndent());
        xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_leftIndent, paragraph.getOwnLeftIndent());
        xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_rightIndent, paragraph.getOwnRightIndent());
        xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_spacingBefore, paragraph.getOwnSpacingBefore());
        xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_spacingAfter, paragraph.getOwnSpacingAfter());
        xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_tabStopWidth, paragraph.getOwnTabStopWidth());

        /*   */
        TabStop[] tabStops = paragraph.getTabStops();
        if (tabStops != null && tabStops.length > 0)
        {
            for(int i = 0; i < tabStops.length; i++)
            {
                exportTabStop(tabStops[i]);
            }
        }

        xmlWriter.closeElement(true);
    }
}
项目:jasperreports    文件:JRFillTextElement.java   
@Override
public JRParagraph getParagraph()
{
    return paragraph == null 
            ? (fillStyleObjects == null ? initParagraph : fillStyleObjects.paragraph) 
            : paragraph;
}
项目:jasperreports    文件:CachingParagraph.java   
public CachingParagraph(JRParagraph base)
{
    this.base = base;

    this.lineSpacing = base.getLineSpacing();
    this.lineSpacingSize = base.getLineSpacingSize();
    this.firstLineIndent = base.getFirstLineIndent();
    this.leftIndent = base.getLeftIndent();
    this.rightIndent = base.getRightIndent();
    this.spacingBefore = base.getSpacingBefore();
    this.spacingAfter = base.getSpacingAfter();
}
项目:PDFReporter-Studio    文件:ConvertTextIntoStatic.java   
private void cloneParagraph(JRParagraph fieldBox, JRParagraph staticBox){
        if (fieldBox == null || staticBox == null) return;
        fieldBox.setFirstLineIndent(staticBox.getFirstLineIndent());
        fieldBox.setLeftIndent(staticBox.getLeftIndent());
        fieldBox.setLineSpacing(staticBox.getLineSpacing());
        fieldBox.setLineSpacingSize(staticBox.getLineSpacingSize());
        fieldBox.setRightIndent(staticBox.getRightIndent());
        fieldBox.setSpacingAfter(staticBox.getSpacingAfter());
        fieldBox.setSpacingBefore(staticBox.getSpacingBefore());
        fieldBox.setTabStopWidth(staticBox.getTabStopWidth());
}
项目:PDFReporter-Studio    文件:ConvertStaticIntoText.java   
private void cloneParagraph(JRParagraph fieldBox, JRParagraph staticBox){
        if (fieldBox == null || staticBox == null) return;
        fieldBox.setFirstLineIndent(staticBox.getFirstLineIndent());
        fieldBox.setLeftIndent(staticBox.getLeftIndent());
        fieldBox.setLineSpacing(staticBox.getLineSpacing());
        fieldBox.setLineSpacingSize(staticBox.getLineSpacingSize());
        fieldBox.setRightIndent(staticBox.getRightIndent());
        fieldBox.setSpacingAfter(staticBox.getSpacingAfter());
        fieldBox.setSpacingBefore(staticBox.getSpacingBefore());
        fieldBox.setTabStopWidth(staticBox.getTabStopWidth());
}
项目:jasperreports    文件:JRBaseTextElement.java   
@Override
public JRParagraph getParagraph()
{
    return paragraph;
}
项目:jasperreports    文件:JRBasePrintText.java   
@Override
public JRParagraph getParagraph()
{
    return paragraph;
}
项目:jasperreports    文件:JRBasePrintText.java   
/**
 *
 */
public void copyParagraph(JRParagraph paragraph)
{
    this.paragraph = paragraph.clone(this);
}
项目:jasperreports    文件:JRBaseStyle.java   
@Override
public JRParagraph getParagraph()
{
    return paragraph;
}
项目:jasperreports    文件:JRParagraphFactory.java   
public static void setParagraphAttributes(Attributes atts, JRParagraph paragraph)
{
    LineSpacingEnum lineSpacing = LineSpacingEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_lineSpacing));
    if (lineSpacing != null)
    {
        paragraph.setLineSpacing(lineSpacing);
    }

    String lineSpacingSize = atts.getValue(JRXmlConstants.ATTRIBUTE_lineSpacingSize);
    if (lineSpacingSize != null && lineSpacingSize.length() > 0)
    {
        paragraph.setLineSpacingSize(Float.parseFloat(lineSpacingSize));
    }

    String firstLineIndent = atts.getValue(JRXmlConstants.ATTRIBUTE_firstLineIndent);
    if (firstLineIndent != null && firstLineIndent.length() > 0)
    {
        paragraph.setFirstLineIndent(Integer.parseInt(firstLineIndent));
    }

    String leftIndent = atts.getValue(JRXmlConstants.ATTRIBUTE_leftIndent);
    if (leftIndent != null && leftIndent.length() > 0)
    {
        paragraph.setLeftIndent(Integer.parseInt(leftIndent));
    }

    String rightIndent = atts.getValue(JRXmlConstants.ATTRIBUTE_rightIndent);
    if (rightIndent != null && rightIndent.length() > 0)
    {
        paragraph.setRightIndent(Integer.parseInt(rightIndent));
    }

    String spacingBefore = atts.getValue(JRXmlConstants.ATTRIBUTE_spacingBefore);
    if (spacingBefore != null && spacingBefore.length() > 0)
    {
        paragraph.setSpacingBefore(Integer.parseInt(spacingBefore));
    }

    String spacingAfter = atts.getValue(JRXmlConstants.ATTRIBUTE_spacingAfter);
    if (spacingAfter != null && spacingAfter.length() > 0)
    {
        paragraph.setSpacingAfter(Integer.parseInt(spacingAfter));
    }

    String tabStopWidth = atts.getValue(JRXmlConstants.ATTRIBUTE_tabStopWidth);
    if (tabStopWidth != null && tabStopWidth.length() > 0)
    {
        paragraph.setTabStopWidth(Integer.parseInt(tabStopWidth));
    }
}
项目:jasperreports    文件:JRXmlBaseWriter.java   
public void writeParagraph(JRParagraph paragraph) throws IOException
{
    writeParagraph(paragraph, null);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 *
 */
public static Float getLineSpacingSize(JRParagraph paragraph)
{
    return styleResolver.getLineSpacingSize(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 *
 */
public static Integer getFirstLineIndent(JRParagraph paragraph)
{
    return styleResolver.getFirstLineIndent(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 *
 */
public static Integer getLeftIndent(JRParagraph paragraph)
{
    return styleResolver.getLeftIndent(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 *
 */
public static Integer getRightIndent(JRParagraph paragraph)
{
    return styleResolver.getRightIndent(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 *
 */
public static Integer getSpacingBefore(JRParagraph paragraph)
{
    return styleResolver.getSpacingBefore(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 *
 */
public static Integer getSpacingAfter(JRParagraph paragraph)
{
    return styleResolver.getSpacingAfter(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 *
 */
public static Integer getTabStopWidth(JRParagraph paragraph)
{
    return styleResolver.getTabStopWidth(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 *
 */
public static TabStop[] getTabStops(JRParagraph paragraph)
{
    return styleResolver.getTabStops(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 * 
 */
public static LineSpacingEnum getLineSpacing(JRParagraph paragraph)
{
    return styleResolver.getLineSpacing(paragraph);
}
项目:jasperreports    文件:JRStyleResolver.java   
/**
 * @deprecated Replaced by {@link StyleUtil#appendParagraph(JRParagraph, JRParagraph)}.
 */
public static void appendParagraph(JRParagraph destParagraph, JRParagraph srcParagraph)
{
    StyleUtil.appendParagraph(destParagraph, srcParagraph);
}
项目:jasperreports    文件:JRDesignTextElement.java   
@Override
public JRParagraph getParagraph()
{
    return paragraph;
}
项目:jasperreports    文件:AbstractTextRenderer.java   
/**
 * 
 */
public static float getLineHeight(boolean isFirstLine, JRParagraph paragraph, float maxLeading, float maxAscent)
{
    float lineHeight = 0;

    switch(paragraph.getLineSpacing())
    {
        case SINGLE:
        default :
        {
            lineHeight = maxLeading + 1f * maxAscent;
            break;
        }
        case ONE_AND_HALF:
        {
            if (isFirstLine)
            {
                lineHeight = maxLeading + 1f * maxAscent;
            }
            else
            {
                lineHeight = maxLeading + 1.5f * maxAscent;
            }
            break;
        }
        case DOUBLE:
        {
            if (isFirstLine)
            {
                lineHeight = maxLeading + 1f * maxAscent;
            }
            else
            {
                lineHeight = maxLeading + 2f * maxAscent;
            }
            break;
        }
        case PROPORTIONAL:
        {
            if (isFirstLine)
            {
                lineHeight = maxLeading + 1f * maxAscent;
            }
            else
            {
                lineHeight = maxLeading + paragraph.getLineSpacingSize().floatValue() * maxAscent;
            }
            break;
        }
        case AT_LEAST:
        {
            if (isFirstLine)
            {
                lineHeight = maxLeading + 1f * maxAscent;
            }
            else
            {
                lineHeight = Math.max(maxLeading + 1f * maxAscent, paragraph.getLineSpacingSize().floatValue());
            }
            break;
        }
        case FIXED:
        {
            if (isFirstLine)
            {
                lineHeight = maxLeading + 1f * maxAscent;
            }
            else
            {
                lineHeight = paragraph.getLineSpacingSize().floatValue();
            }
            break;
        }
    }

    return lineHeight;
}
项目:jasperreports    文件:DocxParagraphHelper.java   
/**
 *
 */
private void exportLineSpacing(JRParagraph paragraph)
{
    if (
        paragraph.getOwnLineSpacing() != null
        || paragraph.getOwnLineSpacingSize() != null
        || paragraph.getOwnSpacingBefore() != null
        || paragraph.getOwnSpacingAfter() != null
        )
    {
        String lineRule; 
        String lineSpacing; 

        switch (paragraph.getLineSpacing())
        {
            case AT_LEAST :
            {
                lineRule = "atLeast";
                lineSpacing = String.valueOf(LengthUtil.twip(paragraph.getLineSpacingSize().floatValue())); 
                break;
            }
            case FIXED :
            {
                lineRule = "exact";
                lineSpacing = String.valueOf(LengthUtil.twip(paragraph.getLineSpacingSize().floatValue())); 
                break;
            }
            case PROPORTIONAL :
            {
                lineRule = "auto";
                lineSpacing = String.valueOf((int)(paragraph.getLineSpacingSize().floatValue() * LINE_SPACING_FACTOR)); 
                break;
            }
            case DOUBLE :
            {
                lineRule = "auto";
                lineSpacing = String.valueOf((int)(2f * LINE_SPACING_FACTOR)); 
                break;
            }
            case ONE_AND_HALF :
            {
                lineRule = "auto";
                lineSpacing = String.valueOf((int)(1.5f * LINE_SPACING_FACTOR)); 
                break;
            }
            case SINGLE :
            default :
            {
                lineRule = "auto";
                lineSpacing = String.valueOf((int)(1f * LINE_SPACING_FACTOR));
            }
        }

        write("   <w:spacing w:lineRule=\"" + lineRule + "\" w:line=\"" + lineSpacing + "\"");
        write(" w:after=\"" + LengthUtil.twip(paragraph.getSpacingAfter().intValue()) + "\"");
        write(" w:before=\"" + LengthUtil.twip(paragraph.getSpacingBefore().intValue()) + "\"/>\n");
    }
}