Package org.openxmlformats.schemas.wordprocessingml.x2006.main

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr


     * characters in the contents of this run when displayed.
     *
     * @return value representing the font size
     */
    public int getFontSize() {
        CTRPr pr = run.getRPr();
        return (pr != null && pr.isSetSz()) ? pr.getSz().getVal().divide(new BigInteger("2")).intValue() : -1;
    }
View Full Code Here


     *
     * @param size
     */
    public void setFontSize(int size) {
  BigInteger bint=new BigInteger(""+size);
        CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
        CTHpsMeasure ctSize = pr.isSetSz() ? pr.getSz() : pr.addNewSz();
        ctSize.setVal(bint.multiply(new BigInteger("2")));
    }
View Full Code Here

     * without altering the font size of the contents.
     *
     * @return a big integer representing the amount of text shall be "moved"
     */
    public int getTextPosition() {
        CTRPr pr = run.getRPr();
        return (pr != null && pr.isSetPosition()) ? pr.getPosition().getVal().intValue()
                : -1;
    }
View Full Code Here

     *
     * @param val
     */
    public void setTextPosition(int val) {
  BigInteger bint=new BigInteger(""+val);
        CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
        CTSignedHpsMeasure position = pr.isSetPosition() ? pr.getPosition() : pr.addNewPosition();
        position.setVal(bint);
    }
View Full Code Here

   * Sets the default font on ctStyles DocDefaults parameter
   * @param fonts
   */
  public void setDefaultFonts(CTFonts fonts) {
    CTDocDefaults docDefaults = null;
    CTRPr runProps = null;

    // Just making sure we use the members that have already been defined
    if(ctStyles.isSetDocDefaults()) {
      docDefaults = ctStyles.getDocDefaults();
      if(docDefaults.isSetRPrDefault()) {
        CTRPrDefault RPrDefault = docDefaults.getRPrDefault();
        if(RPrDefault.isSetRPr()) {
          runProps = RPrDefault.getRPr();
        }
      }
    }

    if(docDefaults == null)
      docDefaults = ctStyles.addNewDocDefaults();
    if(runProps == null)
      runProps = docDefaults.addNewRPrDefault().addNewRPr();

    runProps.setRFonts(fonts);
  }
View Full Code Here

   * Sets the default spelling language on ctStyles DocDefaults parameter
   * @param strSpellingLanguage
   */
  public void setSpellingLanguage(String strSpellingLanguage) {
    CTDocDefaults docDefaults = null;
    CTRPr runProps = null;
    CTLanguage lang = null;

    // Just making sure we use the members that have already been defined
    if(ctStyles.isSetDocDefaults()) {
      docDefaults = ctStyles.getDocDefaults();
      if(docDefaults.isSetRPrDefault()) {
        CTRPrDefault RPrDefault = docDefaults.getRPrDefault();
        if(RPrDefault.isSetRPr()) {
          runProps = RPrDefault.getRPr();
          if(runProps.isSetLang())
            lang = runProps.getLang();
        }
      }
    }

    if(docDefaults == null)
      docDefaults = ctStyles.addNewDocDefaults();
    if(runProps == null)
      runProps = docDefaults.addNewRPrDefault().addNewRPr();
    if(lang == null)
      lang = runProps.addNewLang();

    lang.setVal(strSpellingLanguage);
    lang.setBidi(strSpellingLanguage);
  }
View Full Code Here

   * Sets the default East Asia spelling language on ctStyles DocDefaults parameter
   * @param strEastAsia
   */
  public void setEastAsia(String strEastAsia) {
    CTDocDefaults docDefaults = null;
    CTRPr runProps = null;
    CTLanguage lang = null;

    // Just making sure we use the members that have already been defined
    if(ctStyles.isSetDocDefaults()) {
      docDefaults = ctStyles.getDocDefaults();
      if(docDefaults.isSetRPrDefault()) {
        CTRPrDefault RPrDefault = docDefaults.getRPrDefault();
        if(RPrDefault.isSetRPr()) {
          runProps = RPrDefault.getRPr();
          if(runProps.isSetLang())
            lang = runProps.getLang();
        }
      }
    }

    if(docDefaults == null)
      docDefaults = ctStyles.addNewDocDefaults();
    if(runProps == null)
      runProps = docDefaults.addNewRPrDefault().addNewRPr();
    if(lang == null)
      lang = runProps.addNewLang();

    lang.setEastAsia(strEastAsia);
  }
View Full Code Here

     * characters in the contents of this run when displayed in a document.
     *
     * @return <code>true</code> if the italic property is applied
     */
    public boolean isItalic() {
        CTRPr pr = run.getRPr();
        if(pr == null || !pr.isSetI())
           return false;
        return isCTOnOff(pr.getI());
    }
View Full Code Here

     *
     * @param value <code>true</code> if the italic property is applied to
     *              this run
     */
    public void setItalic(boolean value) {
        CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
        CTOnOff italic = pr.isSetI() ? pr.getI() : pr.addNewI();
        italic.setVal(value ? STOnOff.TRUE : STOnOff.FALSE);
    }
View Full Code Here

     *
     * @return the Underline pattern applyed to this run
     * @see UnderlinePatterns
     */
    public UnderlinePatterns getUnderline() {
        CTRPr pr = run.getRPr();
        return (pr != null && pr.isSetU()) ? UnderlinePatterns.valueOf(pr
                .getU().getVal().intValue()) : UnderlinePatterns.NONE;
    }
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.