/** * Get the vertical alignment value * * @return {@link STVerticalAlignRun.Enum} value (see 22.9.2.17 ST_VerticalAlignRun (Vertical Positioning Location)) * @since 4.0.0 */ public STVerticalAlignRun.Enum getVerticalAlignment() { CTRPr pr = getRunProperties(true); CTVerticalAlignRun vertAlign = pr.isSetVertAlign() ? pr.getVertAlign() : pr.addNewVertAlign(); STVerticalAlignRun.Enum val = vertAlign.getVal(); if (val == null) { val = STVerticalAlignRun.BASELINE; } return val; }
/** * Specifies the alignment which shall be applied to the contents of this * run in relation to the default appearance of the run's text. This allows * the text to be repositioned as subscript or superscript without altering * the font size of the run properties. * <p> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then the text shall not * be subscript or superscript relative to the default baseline location for * the contents of this run. * </p> * * @param valign Type of vertical align to apply * @see VerticalAlign */ public void setSubscript(VerticalAlign valign) { CTRPr pr = getRunProperties(true); CTVerticalAlignRun ctValign = pr.isSetVertAlign() ? pr.getVertAlign() : pr.addNewVertAlign(); ctValign.setVal(STVerticalAlignRun.Enum.forInt(valign.getValue())); }
/** * Set the vertical alignment of the run. * * @param verticalAlignment Vertical alignment value, one of "baseline", "superscript", or "subscript". * @since 4.0.0 */ public void setVerticalAlignment(String verticalAlignment) { CTRPr pr = getRunProperties(true); CTVerticalAlignRun vertAlign = pr.isSetVertAlign() ? pr.getVertAlign() : pr.addNewVertAlign(); STVerticalAlignRun align = vertAlign.xgetVal(); if (align == null) { align = STVerticalAlignRun.Factory.newInstance(); } STVerticalAlignRun.Enum val = STVerticalAlignRun.Enum.forString(verticalAlignment); if (val != null) { align.setStringValue(val.toString()); vertAlign.xsetVal(align); } }
/** * Get the vertical alignment value * * @return {@link STVerticalAlignRun.Enum} value (see 22.9.2.17 ST_VerticalAlignRun (Vertical Positioning Location)) * @since 4.0.0 */ public STVerticalAlignRun.Enum getVerticalAlignment() { CTRPr pr = getRunProperties(true); CTVerticalAlignRun vertAlign = pr.isSetVertAlign() ? pr.getVertAlign() : pr.addNewVertAlign(); STVerticalAlignRun.Enum val = vertAlign.getVal(); if (val == null) { val = STVerticalAlignRun.BASELINE; } return val; }
/** * Specifies the alignment which shall be applied to the contents of this * run in relation to the default appearance of the run's text. This allows * the text to be repositioned as subscript or superscript without altering * the font size of the run properties. * <p> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then the text shall not * be subscript or superscript relative to the default baseline location for * the contents of this run. * </p> * * @param valign Type of vertical align to apply * @see VerticalAlign */ public void setSubscript(VerticalAlign valign) { CTRPr pr = getRunProperties(true); CTVerticalAlignRun ctValign = pr.isSetVertAlign() ? pr.getVertAlign() : pr.addNewVertAlign(); ctValign.setVal(STVerticalAlignRun.Enum.forInt(valign.getValue())); }
/** * Specifies the alignment which shall be applied to the contents of this * run in relation to the default appearance of the run's text. This allows * the text to be repositioned as subscript or superscript without altering * the font size of the run properties. * <p/> * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then the text shall not * be subscript or superscript relative to the default baseline location for * the contents of this run. * </p> * * @param valign * @see VerticalAlign */ public void setSubscript(VerticalAlign valign) { CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr(); CTVerticalAlignRun ctValign = pr.isSetVertAlign() ? pr.getVertAlign() : pr.addNewVertAlign(); ctValign.setVal(STVerticalAlignRun.Enum.forInt(valign.getValue())); }
/** * Set the vertical alignment of the run. * * @param verticalAlignment Vertical alignment value, one of "baseline", "superscript", or "subscript". * @since 4.0.0 */ public void setVerticalAlignment(String verticalAlignment) { CTRPr pr = getRunProperties(true); CTVerticalAlignRun vertAlign = pr.isSetVertAlign() ? pr.getVertAlign() : pr.addNewVertAlign(); STVerticalAlignRun align = vertAlign.xgetVal(); if (align == null) { align = STVerticalAlignRun.Factory.newInstance(); } STVerticalAlignRun.Enum val = STVerticalAlignRun.Enum.forString(verticalAlignment); if (val != null) { align.setStringValue(val.toString()); vertAlign.xsetVal(align); } }