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

CharacterRun

public class CharacterRun extends Range implements Cloneable
This class represents a run of text that share common properties.
author
Ryan Ackley

Fields Summary
public static final short
SPRM_FRMARKDEL
public static final short
SPRM_FRMARK
public static final short
SPRM_FFLDVANISH
public static final short
SPRM_PICLOCATION
public static final short
SPRM_IBSTRMARK
public static final short
SPRM_DTTMRMARK
public static final short
SPRM_FDATA
public static final short
SPRM_SYMBOL
public static final short
SPRM_FOLE2
public static final short
SPRM_HIGHLIGHT
public static final short
SPRM_OBJLOCATION
public static final short
SPRM_ISTD
public static final short
SPRM_FBOLD
public static final short
SPRM_FITALIC
public static final short
SPRM_FSTRIKE
public static final short
SPRM_FOUTLINE
public static final short
SPRM_FSHADOW
public static final short
SPRM_FSMALLCAPS
public static final short
SPRM_FCAPS
public static final short
SPRM_FVANISH
public static final short
SPRM_KUL
public static final short
SPRM_DXASPACE
public static final short
SPRM_LID
public static final short
SPRM_ICO
public static final short
SPRM_HPS
public static final short
SPRM_HPSPOS
public static final short
SPRM_ISS
public static final short
SPRM_HPSKERN
public static final short
SPRM_YSRI
public static final short
SPRM_RGFTCASCII
public static final short
SPRM_RGFTCFAREAST
public static final short
SPRM_RGFTCNOTFAREAST
public static final short
SPRM_CHARSCALE
public static final short
SPRM_FDSTRIKE
public static final short
SPRM_FIMPRINT
public static final short
SPRM_FSPEC
public static final short
SPRM_FOBJ
public static final short
SPRM_PROPRMARK
public static final short
SPRM_FEMBOSS
public static final short
SPRM_SFXTEXT
public static final short
SPRM_DISPFLDRMARK
public static final short
SPRM_IBSTRMARKDEL
public static final short
SPRM_DTTMRMARKDEL
public static final short
SPRM_BRC
public static final short
SPRM_SHD
public static final short
SPRM_IDSIRMARKDEL
public static final short
SPRM_CPG
public static final short
SPRM_NONFELID
public static final short
SPRM_FELID
public static final short
SPRM_IDCTHINT
SprmBuffer
_chpx
CharacterProperties
_props
Constructors Summary
CharacterRun(CHPX chpx, StyleSheet ss, short istd, Range parent)

param
chpx The chpx this object is based on.
param
ss The stylesheet for the document this run belongs to.
param
istd The style index if this run's base style.
param
parent The parent range of this character run (usually a paragraph).


                                               
         
  
    super(Math.max(parent._start, chpx.getStart()), Math.min(parent._end, chpx.getEnd()), parent);
    _props = chpx.getCharacterProperties(ss, istd);
    _chpx = chpx.getSprmBuf();
  
Methods Summary
public java.lang.Objectclone()
Used to create a deep copy of this object.

return
A deep copy.
throws
CloneNotSupportedException never

    CharacterRun cp = (CharacterRun)super.clone();
    cp._props.setDttmRMark((DateAndTime)_props.getDttmRMark().clone());
    cp._props.setDttmRMarkDel((DateAndTime)_props.getDttmRMarkDel().clone());
    cp._props.setDttmPropRMark((DateAndTime)_props.getDttmPropRMark().clone());
    cp._props.setDttmDispFldRMark((DateAndTime)_props.getDttmDispFldRMark().
                                  clone());
    cp._props.setXstDispFldRMark((byte[])_props.getXstDispFldRMark().clone());
    cp._props.setShd((ShadingDescriptor)_props.getShd().clone());

    return cp;
  
public org.apache.poi.hwpf.usermodel.CharacterPropertiescloneProperties()
clone the CharacterProperties object associated with this characterRun so that you can apply it to another CharacterRun

    try {
       return (CharacterProperties)_props.clone();
    } catch(java.lang.CloneNotSupportedException e) {
       throw new RuntimeException(e);
    } 
  
public intgetCharacterSpacing()

    return _props.getDxaSpace();
  
public intgetColor()

    return _props.getIco();
  
public java.lang.StringgetFontName()

    return _doc.getFontTable().getMainFont(_props.getFtcAscii());
  
public intgetFontSize()

    return _props.getHps();
  
public intgetIco24()
Get the ico24 field for the CHP record.

    return _props.getIco24();
  
public intgetKerning()

    return _props.getHpsKern();
  
public intgetObjOffset()

    return _props.getFcObj();
  
public intgetPicOffset()

    return _props.getFcPic();
  
public shortgetSubSuperScriptIndex()

    return _props.getIss();
  
public intgetUnderlineCode()

    return _props.getKul();
  
public intgetVerticalOffset()

    return _props.getHpsPos();
  
public booleanisBold()

    return _props.isFBold();
  
public booleanisCapitalized()

    return _props.isFCaps();
  
public booleanisData()

    return _props.isFData();
  
public booleanisDoubleStrikeThrough()

    return _props.isFDStrike();
  
public booleanisEmbossed()

    return _props.isFEmboss();
  
public booleanisFldVanished()

    return _props.isFFldVanish();
  
public booleanisHighlighted()

    return _props.isFHighlight();
  
public booleanisImprinted()

    return _props.isFImprint();
  
public booleanisItalic()

    return _props.isFItalic();
  
public booleanisMarkedDeleted()

    return _props.isFRMarkDel();
  
public booleanisMarkedInserted()

    return _props.isFRMark();
  
public booleanisObj()

    return _props.isFObj();
  
public booleanisOle2()

    return _props.isFOle2();
  
public booleanisOutlined()

    return _props.isFOutline();
  
public booleanisShadowed()

    return _props.isFShadow();
  
public booleanisSmallCaps()

    return _props.isFSmallCaps();
  
public booleanisSpecialCharacter()

    return _props.isFSpec();
  
public booleanisStrikeThrough()

    return _props.isFStrike();
  
public booleanisVanished()

    return _props.isFVanish();
  
public voidmarkDeleted(boolean mark)

    _props.setFRMarkDel(mark);

    byte newVal = (byte)(mark ? 1 : 0);
    _chpx.updateSprm(SPRM_FRMARKDEL, newVal);

  
public voidmarkInserted(boolean mark)

    _props.setFRMark(mark);

    byte newVal = (byte)(mark ? 1 : 0);
    _chpx.updateSprm(SPRM_FRMARK, newVal);

  
public voidsetBold(boolean bold)

    _props.setFBold(bold);

    byte newVal = (byte)(bold ? 1 : 0);
    _chpx.updateSprm(SPRM_FBOLD, newVal);

  
public voidsetCapitalized(boolean caps)

    _props.setFCaps(caps);

    byte newVal = (byte)(caps ? 1 : 0);
    _chpx.updateSprm(SPRM_FCAPS, newVal);

  
public voidsetCharacterSpacing(int twips)

    _props.setDxaSpace(twips);

    _chpx.updateSprm(SPRM_DXASPACE, twips);

  
public voidsetColor(int color)

    _props.setIco((byte)color);
    _chpx.updateSprm(SPRM_ICO, (byte)color);
  
public voidsetData(boolean data)

    _props.setFData(data);

    byte newVal = (byte)(data ? 1 : 0);
    _chpx.updateSprm(SPRM_FOBJ, newVal);
  
public voidsetDoubleStrikethrough(boolean dstrike)

    _props.setFDStrike(dstrike);

    byte newVal = (byte)(dstrike ? 1 : 0);
    _chpx.updateSprm(SPRM_FDSTRIKE, newVal);

  
public voidsetEmbossed(boolean emboss)

    _props.setFEmboss(emboss);

    byte newVal = (byte)(emboss ? 1 : 0);
    _chpx.updateSprm(SPRM_FEMBOSS, newVal);

  
public voidsetFldVanish(boolean fldVanish)

    _props.setFFldVanish(fldVanish);

    byte newVal = (byte)(fldVanish ? 1 : 0);
    _chpx.updateSprm(SPRM_FFLDVANISH, newVal);

  
public voidsetFontSize(int halfPoints)

    _props.setHps(halfPoints);

    _chpx.updateSprm(SPRM_HPS, (short)halfPoints);

  
public voidsetFtcAscii(int ftcAscii)

    _props.setFtcAscii(ftcAscii);

    _chpx.updateSprm(SPRM_RGFTCASCII, (short)ftcAscii);

  
public voidsetFtcFE(int ftcFE)

    _props.setFtcFE(ftcFE);

    _chpx.updateSprm(SPRM_RGFTCFAREAST, (short)ftcFE);

  
public voidsetFtcOther(int ftcOther)

    _props.setFtcOther(ftcOther);

    _chpx.updateSprm(SPRM_RGFTCNOTFAREAST, (short)ftcOther);

  
public voidsetHighlighted(byte color)

    _props.setFHighlight(true);
    _props.setIcoHighlight(color);
    _chpx.updateSprm(SPRM_HIGHLIGHT, color);
  
public voidsetIco24(int colour24)
Set the ico24 field for the CHP record.

    _props.setIco24(colour24);
  
public voidsetImprinted(boolean imprint)

    _props.setFImprint(imprint);

    byte newVal = (byte)(imprint ? 1 : 0);
    _chpx.updateSprm(SPRM_FIMPRINT, newVal);

  
public voidsetItalic(boolean italic)

    _props.setFItalic(italic);

    byte newVal = (byte)(italic ? 1 : 0);
    _chpx.updateSprm(SPRM_FITALIC, newVal);

  
public voidsetKerning(int kern)

    _props.setHpsKern(kern);
    _chpx.updateSprm(SPRM_HPSKERN, (short)kern);
  
public voidsetObj(boolean obj)

    _props.setFObj(obj);

    byte newVal = (byte)(obj ? 1 : 0);
    _chpx.updateSprm(SPRM_FOBJ, newVal);
  
public voidsetObjOffset(int obj)

    _props.setFcObj(obj);
    _chpx.updateSprm(SPRM_OBJLOCATION, obj);
  
public voidsetOle2(boolean ole)

    _props.setFOle2(ole);

    byte newVal = (byte)(ole ? 1 : 0);
    _chpx.updateSprm(SPRM_FOBJ, newVal);
  
public voidsetOutline(boolean outlined)

    _props.setFOutline(outlined);

    byte newVal = (byte)(outlined ? 1 : 0);
    _chpx.updateSprm(SPRM_FOUTLINE, newVal);

  
public voidsetPicOffset(int offset)

    _props.setFcPic(offset);
    _chpx.updateSprm(SPRM_PICLOCATION, offset);
  
public voidsetShadow(boolean shadow)

    _props.setFShadow(shadow);

    byte newVal = (byte)(shadow ? 1 : 0);
    _chpx.updateSprm(SPRM_FSHADOW, newVal);

  
public voidsetSmallCaps(boolean smallCaps)

    _props.setFSmallCaps(smallCaps);

    byte newVal = (byte)(smallCaps ? 1 : 0);
    _chpx.updateSprm(SPRM_FSMALLCAPS, newVal);

  
public voidsetSpecialCharacter(boolean spec)

    _props.setFSpec(spec);

    byte newVal = (byte)(spec ? 1 : 0);
    _chpx.updateSprm(SPRM_FSPEC, newVal);
  
public voidsetSubSuperScriptIndex(short iss)

    _props.setDxaSpace(iss);

    _chpx.updateSprm(SPRM_DXASPACE, iss);

  
public voidsetUnderlineCode(int kul)

    _props.setKul((byte)kul);
    _chpx.updateSprm(SPRM_KUL, (byte)kul);
  
public voidsetVanished(boolean vanish)

    _props.setFVanish(vanish);

    byte newVal = (byte)(vanish ? 1 : 0);
    _chpx.updateSprm(SPRM_FVANISH, newVal);

  
public voidsetVerticalOffset(int hpsPos)

    _props.setHpsPos(hpsPos);
    _chpx.updateSprm(SPRM_HPSPOS, (byte)hpsPos);
  
public voidstrikeThrough(boolean strike)

    _props.setFStrike(strike);

    byte newVal = (byte)(strike ? 1 : 0);
    _chpx.updateSprm(SPRM_FSTRIKE, newVal);

  
public inttype()
Here for runtime type determination using a switch statement convenient.

return
TYPE_CHARACTER

    return TYPE_CHARACTER;