FileDocCategorySizeDatePackage
Paragraph.javaAPI DocApache Poi 3.0.112609Mon Jan 01 18:55:30 GMT 2007org.apache.poi.hwpf.usermodel

Paragraph

public class Paragraph extends Range implements Cloneable

Fields Summary
public static final short
SPRM_JC
public static final short
SPRM_FSIDEBYSIDE
public static final short
SPRM_FKEEP
public static final short
SPRM_FKEEPFOLLOW
public static final short
SPRM_FPAGEBREAKBEFORE
public static final short
SPRM_BRCL
public static final short
SPRM_BRCP
public static final short
SPRM_ILVL
public static final short
SPRM_ILFO
public static final short
SPRM_FNOLINENUMB
public static final short
SPRM_CHGTABSPAPX
public static final short
SPRM_DXARIGHT
public static final short
SPRM_DXALEFT
public static final short
SPRM_DXALEFT1
public static final short
SPRM_DYALINE
public static final short
SPRM_DYABEFORE
public static final short
SPRM_DYAAFTER
public static final short
SPRM_CHGTABS
public static final short
SPRM_FINTABLE
public static final short
SPRM_FTTP
public static final short
SPRM_DXAABS
public static final short
SPRM_DYAABS
public static final short
SPRM_DXAWIDTH
public static final short
SPRM_PC
public static final short
SPRM_WR
public static final short
SPRM_BRCTOP
public static final short
SPRM_BRCLEFT
public static final short
SPRM_BRCBOTTOM
public static final short
SPRM_BRCRIGHT
public static final short
SPRM_BRCBAR
public static final short
SPRM_FNOAUTOHYPH
public static final short
SPRM_WHEIGHTABS
public static final short
SPRM_DCS
public static final short
SPRM_SHD
public static final short
SPRM_DYAFROMTEXT
public static final short
SPRM_DXAFROMTEXT
public static final short
SPRM_FLOCKED
public static final short
SPRM_FWIDOWCONTROL
public static final short
SPRM_RULER
public static final short
SPRM_FKINSOKU
public static final short
SPRM_FWORDWRAP
public static final short
SPRM_FOVERFLOWPUNCT
public static final short
SPRM_FTOPLINEPUNCT
public static final short
SPRM_AUTOSPACEDE
public static final short
SPRM_AUTOSPACEDN
public static final short
SPRM_WALIGNFONT
public static final short
SPRM_FRAMETEXTFLOW
public static final short
SPRM_ANLD
public static final short
SPRM_PROPRMARK
public static final short
SPRM_OUTLVL
public static final short
SPRM_FBIDI
public static final short
SPRM_FNUMRMLNS
public static final short
SPRM_CRLF
public static final short
SPRM_NUMRM
public static final short
SPRM_USEPGSUSETTINGS
public static final short
SPRM_FADJUSTRIGHT
protected short
_istd
protected ParagraphProperties
_props
protected SprmBuffer
_papx
Constructors Summary
protected Paragraph(int startIdx, int endIdx, Table parent)


        
  
    super(startIdx, endIdx, Range.TYPE_PARAGRAPH, parent);
    PAPX papx = (PAPX)_paragraphs.get(_parEnd - 1);
    _props = papx.getParagraphProperties(_doc.getStyleSheet());
    _papx = papx.getSprmBuf();
    _istd = papx.getIstd();
  
protected Paragraph(PAPX papx, Range parent)

    super(Math.max(parent._start, papx.getStart()), Math.min(parent._end, papx.getEnd()), parent);
    _props = papx.getParagraphProperties(_doc.getStyleSheet());
    _papx = papx.getSprmBuf();
    _istd = papx.getIstd();
  
Methods Summary
public java.lang.Objectclone()

    Paragraph p = (Paragraph)super.clone();
    p._props = (ParagraphProperties)_props.clone();
    //p._baseStyle = _baseStyle;
    p._papx = new SprmBuffer();
    return p;
  
public org.apache.poi.hwpf.usermodel.ParagraphPropertiescloneProperties()
clone the ParagraphProperties object associated with this Paragraph so that you can apply the same properties to another paragraph.

    try {
       return (ParagraphProperties)_props.clone();
    } catch (Exception e) {
       throw new RuntimeException(e);
    }
  
public org.apache.poi.hwpf.usermodel.BorderCodegetBarBorder()

    return _props.getBrcBar();
  
public org.apache.poi.hwpf.usermodel.BorderCodegetBottomBorder()

    return _props.getBrcBottom();
  
public org.apache.poi.hwpf.usermodel.DropCapSpecifiergetDropCap()

    return _props.getDcs();
  
public intgetFirstLineIndent()

    return _props.getDxaLeft1();
  
public intgetFontAlignment()

    return _props.getWAlignFont();
  
private shortgetFrameTextFlow()

    short retVal = 0;
    if (_props.isFVertical())
    {
      retVal |= 1;
    }
    if (_props.isFBackward())
    {
      retVal |= 2;
    }
    if (_props.isFRotateFont())
    {
      retVal |= 4;
    }
    return retVal;
  
public intgetIlfo()

     return _props.getIlfo();
   
public intgetIlvl()

     return _props.getIlvl();
   
public intgetIndentFromLeft()

    return _props.getDxaLeft();
  
public intgetIndentFromRight()

    return _props.getDxaRight();
  
public intgetJustification()

    return _props.getJc();
  
public org.apache.poi.hwpf.usermodel.BorderCodegetLeftBorder()

    return _props.getBrcLeft();
  
public org.apache.poi.hwpf.usermodel.LineSpacingDescriptorgetLineSpacing()

    return _props.getLspd();
  
public org.apache.poi.hwpf.usermodel.BorderCodegetRightBorder()

    return _props.getBrcRight();
  
public org.apache.poi.hwpf.usermodel.ShadingDescriptorgetShading()

    return _props.getShd();
  
public intgetSpacingAfter()

    return _props.getDyaAfter();
  
public intgetSpacingBefore()

    return _props.getDyaBefore();
  
public shortgetStyleIndex()

    return _istd;
  
public intgetTableLevel()

    return _props.getTableLevel();
  
public org.apache.poi.hwpf.usermodel.BorderCodegetTopBorder()

    return _props.getBrcTop();
  
public booleanisAutoHyphenated()

    return _props.getFNoAutoHyph() == 0;
  
public booleanisBackward()

    return _props.isFBackward();
  
public booleanisEmbeddedCellMark()

    return _props.getEmbeddedCellMark() != 0;
  
public booleanisInTable()

    return _props.getFInTable() != 0;
  
public booleanisKinsoku()

    return _props.getFKinsoku() != 0;
  
public booleanisLineNotNumbered()

    return _props.getFNoLnn() != 0;
  
public booleanisSideBySide()

    return _props.getFSideBySide() != 0;
  
public booleanisTableRowEnd()

    return _props.getFTtp() != 0 || _props.getFTtpEmbedded() != 0;
  
public booleanisVertical()

    return _props.isFVertical();
  
public booleanisWidowControlled()

    return _props.getFWidowControl() != 0;
  
public booleanisWordWrapped()

    return _props.getFWordWrap() != 0;
  
public booleankeepOnPage()

    return _props.getFKeep() != 0;
  
public booleankeepWithNext()

    return _props.getFKeepFollow() != 0;
  
public booleanpageBreakBefore()

    return _props.getFPageBreakBefore() != 0;
  
public voidsetAutoHyphenated(boolean autoHyph)

    byte auto = (byte)(!autoHyph ? 1 : 0);
    _props.setFNoAutoHyph(auto);
    _papx.updateSprm(SPRM_FNOAUTOHYPH, auto);
  
public voidsetBackward(boolean bward)

    _props.setFBackward(bward);
    _papx.updateSprm(SPRM_FRAMETEXTFLOW, getFrameTextFlow());
  
public voidsetBarBorder(org.apache.poi.hwpf.usermodel.BorderCode bar)

    _props.setBrcBar(bar);
    _papx.updateSprm(SPRM_BRCBAR, bar.toInt());
  
public voidsetBottomBorder(org.apache.poi.hwpf.usermodel.BorderCode bottom)

    _props.setBrcBottom(bottom);
    _papx.updateSprm(SPRM_BRCBOTTOM, bottom.toInt());
  
public voidsetDropCap(org.apache.poi.hwpf.usermodel.DropCapSpecifier dcs)

    _props.setDcs(dcs);
    _papx.updateSprm(SPRM_DCS, dcs.toShort());
  
public voidsetFirstLineIndent(int first)

    _props.setDxaLeft1(first);
    _papx.updateSprm(SPRM_DXALEFT1, (short)first);
  
public voidsetFontAlignment(int align)

    _props.setWAlignFont(align);
    _papx.updateSprm(SPRM_WALIGNFONT, (short)align);
  
public voidsetIndentFromLeft(int dxaLeft)

    _props.setDxaLeft(dxaLeft);
    _papx.updateSprm(SPRM_DXALEFT, (short)dxaLeft);
  
public voidsetIndentFromRight(int dxaRight)

    _props.setDxaRight(dxaRight);
    _papx.updateSprm(SPRM_DXARIGHT, (short)dxaRight);
  
public voidsetJustification(byte jc)

    _props.setJc(jc);
    _papx.updateSprm(SPRM_JC, jc);
  
public voidsetKeepOnPage(boolean fKeep)

    byte keep = (byte)(fKeep ? 1 : 0);
    _props.setFKeep(keep);
    _papx.updateSprm(SPRM_FKEEP, keep);
  
public voidsetKeepWithNext(boolean fKeepFollow)

    byte keepFollow = (byte)(fKeepFollow ? 1 : 0);
    _props.setFKeepFollow(keepFollow);
    _papx.updateSprm(SPRM_FKEEPFOLLOW, keepFollow);
  
public voidsetKinsoku(boolean kinsoku)

    byte kin = (byte)(kinsoku ? 1 : 0);
    _props.setFKinsoku(kin);
    _papx.updateSprm(SPRM_FKINSOKU, kin);
  
public voidsetLeftBorder(org.apache.poi.hwpf.usermodel.BorderCode left)

    _props.setBrcLeft(left);
    _papx.updateSprm(SPRM_BRCLEFT, left.toInt());
  
public voidsetLineNotNumbered(boolean fNoLnn)

    byte noLnn = (byte)(fNoLnn ? 1 : 0);
    _props.setFNoLnn(noLnn);
    _papx.updateSprm(SPRM_FNOLINENUMB, noLnn);
  
public voidsetLineSpacing(org.apache.poi.hwpf.usermodel.LineSpacingDescriptor lspd)

    _props.setLspd(lspd);
    _papx.updateSprm(SPRM_DYALINE, lspd.toInt());
  
public voidsetPageBreakBefore(boolean fPageBreak)

    byte pageBreak = (byte)(fPageBreak ? 1 : 0);
    _props.setFPageBreakBefore(pageBreak);
    _papx.updateSprm(SPRM_FPAGEBREAKBEFORE, pageBreak);
  
public voidsetRightBorder(org.apache.poi.hwpf.usermodel.BorderCode right)

    _props.setBrcRight(right);
    _papx.updateSprm(SPRM_BRCRIGHT, right.toInt());
  
public voidsetShading(org.apache.poi.hwpf.usermodel.ShadingDescriptor shd)

    _props.setShd(shd);
    _papx.updateSprm(SPRM_SHD, shd.toShort());
  
public voidsetSideBySide(boolean fSideBySide)

    byte sideBySide = (byte)(fSideBySide ? 1 : 0);
    _props.setFSideBySide(sideBySide);
    _papx.updateSprm(SPRM_FSIDEBYSIDE, sideBySide);
  
public voidsetSpacingAfter(int after)

    _props.setDyaAfter(after);
    _papx.updateSprm(SPRM_DYAAFTER, (short)after);
  
public voidsetSpacingBefore(int before)

    _props.setDyaBefore(before);
    _papx.updateSprm(SPRM_DYABEFORE, (short)before);
  
voidsetTableRowEnd(org.apache.poi.hwpf.usermodel.TableProperties props)

    setTableRowEnd((byte)1);
    byte[] grpprl = TableSprmCompressor.compressTableProperty(props);
    _papx.append(grpprl);
  
private voidsetTableRowEnd(byte val)

    _props.setFTtp(val);
    _papx.updateSprm(SPRM_FTTP, val);
  
public voidsetTopBorder(org.apache.poi.hwpf.usermodel.BorderCode top)

    _props.setBrcTop(top);
    _papx.updateSprm(SPRM_BRCTOP, top.toInt());
  
public voidsetVertical(boolean vertical)

    _props.setFVertical(vertical);
    _papx.updateSprm(SPRM_FRAMETEXTFLOW, getFrameTextFlow());
  
public voidsetWidowControl(boolean widowControl)

    byte widow = (byte)(widowControl ? 1 : 0);
    _props.setFWidowControl(widow);
    _papx.updateSprm(SPRM_FWIDOWCONTROL, widow);
  
public voidsetWordWrapped(boolean wrap)

    byte wordWrap = (byte)(wrap ? 1 : 0);
    _props.setFWordWrap(wordWrap);
    _papx.updateSprm(SPRM_FWORDWRAP, wordWrap);
  
public inttype()

    return TYPE_PARAGRAPH;