Class CharacterRun

  • All Implemented Interfaces:
    java.lang.Cloneable, CharacterRun

    public final class CharacterRun
    extends Range
    implements java.lang.Cloneable, CharacterRun
    This class represents a run of text that share common properties.
    • Method Detail

      • type

        public int type()
        Here for runtime type determination using a switch statement convenient.
        Returns:
        TYPE_CHARACTER
      • isMarkedDeleted

        public boolean isMarkedDeleted()
      • markDeleted

        public void markDeleted​(boolean mark)
      • setBold

        public void setBold​(boolean bold)
        Specified by:
        setBold in interface CharacterRun
      • setItalic

        public void setItalic​(boolean italic)
        Specified by:
        setItalic in interface CharacterRun
      • isOutlined

        public boolean isOutlined()
      • setOutline

        public void setOutline​(boolean outlined)
      • isFldVanished

        public boolean isFldVanished()
      • setFldVanish

        public void setFldVanish​(boolean fldVanish)
      • isVanished

        public boolean isVanished()
      • setVanished

        public void setVanished​(boolean vanish)
      • isMarkedInserted

        public boolean isMarkedInserted()
      • markInserted

        public void markInserted​(boolean mark)
      • strikeThrough

        public void strikeThrough​(boolean strike)
      • setShadow

        public void setShadow​(boolean shadow)
        Specified by:
        setShadow in interface CharacterRun
      • setFtcAscii

        public void setFtcAscii​(int ftcAscii)
      • setFtcFE

        public void setFtcFE​(int ftcFE)
      • setFtcOther

        public void setFtcOther​(int ftcOther)
      • getSubSuperScriptIndex

        public short getSubSuperScriptIndex()
      • setSubSuperScriptIndex

        public void setSubSuperScriptIndex​(short iss)
      • getUnderlineCode

        public int getUnderlineCode()
      • setUnderlineCode

        public void setUnderlineCode​(int kul)
      • getColor

        public int getColor()
      • setColor

        public void setColor​(int color)
      • getVerticalOffset

        public int getVerticalOffset()
      • setVerticalOffset

        public void setVerticalOffset​(int hpsPos)
      • getHighlightedColor

        public byte getHighlightedColor()
      • setHighlighted

        public void setHighlighted​(byte color)
      • getFontName

        public java.lang.String getFontName()
        Description copied from interface: CharacterRun
        Gets the fonts which shall be used to display the text contents of this run. Specifies a font which shall be used to format all "normal" characters in the run
        Specified by:
        getFontName in interface CharacterRun
        Returns:
        a string representing the font
      • isSpecialCharacter

        public boolean isSpecialCharacter()
      • setSpecialCharacter

        public void setSpecialCharacter​(boolean spec)
      • isObj

        public boolean isObj()
      • setObj

        public void setObj​(boolean obj)
      • getPicOffset

        public int getPicOffset()
      • setPicOffset

        public void setPicOffset​(int offset)
      • isData

        public boolean isData()
        Does the picture offset represent picture or binary data? If it's set, then the picture offset refers to a NilPICFAndBinData structure, otherwise to a PICFAndOfficeArtData
      • setData

        public void setData​(boolean data)
      • isOle2

        public boolean isOle2()
      • setOle2

        public void setOle2​(boolean ole)
      • getObjOffset

        public int getObjOffset()
      • setObjOffset

        public void setObjOffset​(int obj)
      • getIco24

        public int getIco24()
        Get the ico24 field for the CHP record.
      • setIco24

        public void setIco24​(int colour24)
        Set the ico24 field for the CHP record.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Used to create a deep copy of this object.
        Returns:
        A deep copy.
        Throws:
        java.lang.CloneNotSupportedException - never
      • isSymbol

        public boolean isSymbol()
        Returns true, if the CharacterRun is a special character run containing a symbol, otherwise false.

        In case of a symbol, the Range.text() method always returns a single character 0x0028, but word actually stores the character in a different field. Use getSymbolCharacter() to get that character and getSymbolFont() to determine its font.

      • getSymbolCharacter

        public char getSymbolCharacter()
        Returns the symbol character, if this is a symbol character run.
        Throws:
        java.lang.IllegalStateException - If this is not a symbol character run: call isSymbol() first.
        See Also:
        isSymbol()
      • getSymbolFont

        public Ffn getSymbolFont()
        Returns the symbol font, if this is a symbol character run. Might return null, if the font index is not found in the font table.
        Throws:
        java.lang.IllegalStateException - If this is not a symbol character run: call isSymbol() first.
        See Also:
        isSymbol()
      • getLanguageCode

        public int getLanguageCode()
      • getStyleIndex

        public short getStyleIndex()

        Returns the index of the base style which applies to this Run. Details of the style can be looked up from the StyleSheet, via StyleSheet.getStyleDescription(int).

        Note that runs typically override some of the style properties from the base, so normally style information should be fetched directly from the CharacterRun itself.

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Range
      • getDropDownListValues

        public java.lang.String[] getDropDownListValues()
      • getDropDownListDefaultItemIndex

        public java.lang.Integer getDropDownListDefaultItemIndex()