public XDDFBodyProperties getBodyProperties() { return new XDDFBodyProperties(_body.getBodyPr()); }
/** * * @param wrap * whether to wrap words within the bounding rectangle */ public void setWordWrap(boolean wrap) { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { bodyPr.setWrap(wrap ? STTextWrappingType.SQUARE : STTextWrappingType.NONE); } }
protected CTTextBodyProperties getTextBodyPr(boolean create) { CTTextBody textBody = getTextBody(create); if (textBody == null) { return null; } CTTextBodyProperties textBodyPr = textBody.getBodyPr(); if (textBodyPr == null && create) { textBodyPr = textBody.addNewBodyPr(); } return textBodyPr; }
/** * @return whether to wrap words within the bounding rectangle */ public boolean getWordWrap() { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (bodyPr.isSetWrap()) { return bodyPr.getWrap() == STTextWrappingType.SQUARE; } } return true; }
/** * Gets the vertical orientation of the text * * @return vertical orientation of the text */ public TextDirection getTextDirection() { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { STTextVerticalType.Enum val = bodyPr.getVert(); if (val != null) { return TextDirection.values()[val.intValue() - 1]; } } return TextDirection.HORIZONTAL; }
/** * * @return type of autofit */ public TextAutofit getTextAutofit() { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (bodyPr.isSetNoAutofit()) { return TextAutofit.NONE; } else if (bodyPr.isSetNormAutofit()) { return TextAutofit.NORMAL; } else if (bodyPr.isSetSpAutoFit()) { return TextAutofit.SHAPE; } } return TextAutofit.NORMAL; }
/** * Returns the type of vertical overflow for the text. * * @return the type of vertical overflow */ public TextVerticalOverflow getTextVerticalOverflow() { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (bodyPr.isSetVertOverflow()) { return TextVerticalOverflow.values()[bodyPr.getVertOverflow().intValue() - 1]; } } return TextVerticalOverflow.OVERFLOW; }
/** * Returns the type of horizontal overflow for the text. * * @return the type of horizontal overflow */ public TextHorizontalOverflow getTextHorizontalOverflow() { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (bodyPr.isSetHorzOverflow()) { return TextHorizontalOverflow.values()[bodyPr.getHorzOverflow().intValue() - 1]; } } return TextHorizontalOverflow.OVERFLOW; }
/** * Returns the type of vertical alignment for the text within the shape. * * @return the type of vertical alignment */ public VerticalAlignment getVerticalAlignment() { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (bodyPr.isSetAnchor()) { return VerticalAlignment.values()[bodyPr.getAnchor().intValue() - 1]; } } return VerticalAlignment.TOP; }
/** * Sets the type of vertical overflow for the text. * * @param overflow * - the type of vertical overflow. A <code>null</code> values * unsets this property. */ public void setTextVerticalOverflow(TextVerticalOverflow overflow) { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (overflow == null) { if (bodyPr.isSetVertOverflow()) { bodyPr.unsetVertOverflow(); } } else { bodyPr.setVertOverflow(STTextVertOverflowType.Enum.forInt(overflow.ordinal() + 1)); } } }
/** * Sets the type of horizontal overflow for the text. * * @param overflow * - the type of horizontal overflow. A <code>null</code> values * unsets this property. */ public void setTextHorizontalOverflow(TextHorizontalOverflow overflow) { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (overflow == null) { if (bodyPr.isSetHorzOverflow()) { bodyPr.unsetHorzOverflow(); } } else { bodyPr.setHorzOverflow(STTextHorzOverflowType.Enum.forInt(overflow.ordinal() + 1)); } } }
/** * Sets the vertical orientation of the text * * @param orientation * vertical orientation of the text A <code>null</code> values * unsets this property. */ public void setTextDirection(TextDirection orientation) { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (orientation == null) { if (bodyPr.isSetVert()) { bodyPr.unsetVert(); } } else { bodyPr.setVert(STTextVerticalType.Enum.forInt(orientation.ordinal() + 1)); } } }
/** * Sets the type of vertical alignment for the text within the shape. * * @param anchor * - the type of alignment. A <code>null</code> values unsets * this property. */ public void setVerticalAlignment(VerticalAlignment anchor) { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (anchor == null) { if (bodyPr.isSetAnchor()) { bodyPr.unsetAnchor(); } } else { bodyPr.setAnchor(STTextAnchoringType.Enum.forInt(anchor.ordinal() + 1)); } } }
/** * @return font size in points or -1 if font size is not set. */ public double getFontSize(){ double scale = 1; double size = XSSFFont.DEFAULT_FONT_SIZE; // default font size CTTextNormalAutofit afit = getParentParagraph().getParentShape().getTxBody().getBodyPr().getNormAutofit(); if(afit != null) scale = (double)afit.getFontScale() / 100000; CTTextCharacterProperties rPr = getRPr(); if(rPr.isSetSz()){ size = rPr.getSz()*0.01; } return size * scale; }
if(lnSpc > 0) { CTTextNormalAutofit normAutofit = _shape.getTxBody().getBodyPr().getNormAutofit(); if(normAutofit != null) { double scale = 1 - (double)normAutofit.getLnSpcReduction() / 100000;
CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (bodyPr.isSetSpAutoFit()) {
thisTB.setBodyPr((CTTextBodyProperties) otherTB.getBodyPr().copy());
protected CTTextBodyProperties getTextBodyPr(boolean create) { CTTextBody textBody = getTextBody(create); if (textBody == null) { return null; } CTTextBodyProperties textBodyPr = textBody.getBodyPr(); if (textBodyPr == null && create) { textBodyPr = textBody.addNewBodyPr(); } return textBodyPr; }
/** * * @param wrap * whether to wrap words within the bounding rectangle */ public void setWordWrap(boolean wrap) { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { bodyPr.setWrap(wrap ? STTextWrappingType.SQUARE : STTextWrappingType.NONE); } }
/** * @return whether to wrap words within the bounding rectangle */ public boolean getWordWrap() { CTTextBodyProperties bodyPr = ctShape.getTxBody().getBodyPr(); if (bodyPr != null) { if (bodyPr.isSetWrap()) { return bodyPr.getWrap() == STTextWrappingType.SQUARE; } } return true; }