/** * Returns the bullet size that is to be used within a paragraph. This may * be specified in three different ways, follows text size, percentage size * and font points size: * <p> * If returned value is instance of XDDFBulletSizeFollowText, then bullet * size is text size; If returned value is instance of * XDDFBulletSizePercent, then bullet size is a percentage of the font size; * If returned value is instance of XDDFBulletSizePoints, then bullet size * is specified in points. * </p> * * @return the bullet size */ public XDDFBulletSize getBulletSize() { return findDefinedParagraphProperty( props -> props.isSetBuSzPct() || props.isSetBuSzPts() || props.isSetBuSzTx(), props -> new XDDFParagraphBulletProperties(props).getBulletSize()).orElse(null); }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuSzPct()){ setValue(props.getBuSzPct().getVal() * 0.001); return true; } if(props.isSetBuSzPts()){ setValue( - props.getBuSzPts().getVal() * 0.01); return true; } return false; } };
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuSzPct()){ setValue(props.getBuSzPct().getVal() * 0.001); return true; } if(props.isSetBuSzPts()){ setValue( - props.getBuSzPts().getVal() * 0.01); return true; } return false; } };
public XDDFBulletSize getBulletSize() { if (props.isSetBuSzPct()) { return new XDDFBulletSizePercent(props.getBuSzPct(), null); } else if (props.isSetBuSzPts()) { return new XDDFBulletSizePoints(props.getBuSzPts()); } else if (props.isSetBuSzTx()) { return new XDDFBulletSizeFollowText(props.getBuSzTx()); } else { return null; } }
/** * Sets the bullet size that is to be used within a paragraph. * This may be specified in two different ways, percentage spacing and font point spacing: * <p> * If bulletSize >= 0, then bulletSize is a percentage of the font size. * If bulletSize < 0, then it specifies the size in points * </p> */ @SuppressWarnings("WeakerAccess") public void setBulletFontSize(double bulletSize){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(bulletSize >= 0) { CTTextBulletSizePercent pt = pr.isSetBuSzPct() ? pr.getBuSzPct() : pr.addNewBuSzPct(); pt.setVal((int)(bulletSize*1000)); if(pr.isSetBuSzPts()) pr.unsetBuSzPts(); } else { CTTextBulletSizePoint pt = pr.isSetBuSzPts() ? pr.getBuSzPts() : pr.addNewBuSzPts(); pt.setVal((int)(-bulletSize*100)); if(pr.isSetBuSzPct()) pr.unsetBuSzPct(); } }
/** * Sets the bullet size that is to be used within a paragraph. * This may be specified in two different ways, percentage spacing and font point spacing: * <p> * If bulletSize >= 0, then bulletSize is a percentage of the font size. * If bulletSize < 0, then it specifies the size in points * </p> */ public void setBulletFontSize(double bulletSize){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(bulletSize >= 0) { // percentage CTTextBulletSizePercent pt = pr.isSetBuSzPct() ? pr.getBuSzPct() : pr.addNewBuSzPct(); pt.setVal((int)(bulletSize*1000)); // unset points if percentage is now set if(pr.isSetBuSzPts()) pr.unsetBuSzPts(); } else { // points CTTextBulletSizePoint pt = pr.isSetBuSzPts() ? pr.getBuSzPts() : pr.addNewBuSzPts(); pt.setVal((int)(-bulletSize*100)); // unset percentage if points is now set if(pr.isSetBuSzPct()) pr.unsetBuSzPct(); } }
public void setBulletSize(XDDFBulletSize size) { if (props.isSetBuSzPct()) { props.unsetBuSzPct(); } if (props.isSetBuSzPts()) { props.unsetBuSzPts(); } if (props.isSetBuSzTx()) { props.unsetBuSzTx(); } if (size != null) { if (size instanceof XDDFBulletSizeFollowText) { props.setBuSzTx(((XDDFBulletSizeFollowText) size).getXmlObject()); } else if (size instanceof XDDFBulletSizePercent) { props.setBuSzPct(((XDDFBulletSizePercent) size).getXmlObject()); } else if (size instanceof XDDFBulletSizePoints) { props.setBuSzPts(((XDDFBulletSizePoints) size).getXmlObject()); } } }
props.unsetBuFontTx(); if (props.isSetBuSzPct()) { props.unsetBuSzPct();
/** * * @param flag whether text in this paragraph has bullets */ public void setBullet(boolean flag) { if(isBullet() == flag) return; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(flag) { pr.addNewBuFont().setTypeface("Arial"); pr.addNewBuChar().setChar("\u2022"); } else { if (pr.isSetBuFont()) pr.unsetBuFont(); if (pr.isSetBuChar()) pr.unsetBuChar(); if (pr.isSetBuAutoNum()) pr.unsetBuAutoNum(); if (pr.isSetBuBlip()) pr.unsetBuBlip(); if (pr.isSetBuClr()) pr.unsetBuClr(); if (pr.isSetBuClrTx()) pr.unsetBuClrTx(); if (pr.isSetBuFont()) pr.unsetBuFont(); if (pr.isSetBuFontTx()) pr.unsetBuFontTx(); if (pr.isSetBuSzPct()) pr.unsetBuSzPct(); if (pr.isSetBuSzPts()) pr.unsetBuSzPts(); if (pr.isSetBuSzTx()) pr.unsetBuSzTx(); pr.addNewBuNone(); } }
/** * Set or unset this paragraph as a bullet point * * @param flag whether text in this paragraph has bullets */ public void setBullet(boolean flag) { if(isBullet() == flag) return; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(!flag) { pr.addNewBuNone(); if(pr.isSetBuAutoNum()) pr.unsetBuAutoNum(); if(pr.isSetBuBlip()) pr.unsetBuBlip(); if(pr.isSetBuChar()) pr.unsetBuChar(); if(pr.isSetBuClr()) pr.unsetBuClr(); if(pr.isSetBuClrTx()) pr.unsetBuClrTx(); if(pr.isSetBuFont()) pr.unsetBuFont(); if(pr.isSetBuFontTx()) pr.unsetBuFontTx(); if(pr.isSetBuSzPct()) pr.unsetBuSzPct(); if(pr.isSetBuSzPts()) pr.unsetBuSzPts(); if(pr.isSetBuSzTx()) pr.unsetBuSzTx(); } else { if(pr.isSetBuNone()) pr.unsetBuNone(); if(!pr.isSetBuFont()) pr.addNewBuFont().setTypeface("Arial"); if(!pr.isSetBuAutoNum()) pr.addNewBuChar().setChar("\u2022"); } }
/** * Returns the bullet size that is to be used within a paragraph. This may * be specified in three different ways, follows text size, percentage size * and font points size: * <p> * If returned value is instance of XDDFBulletSizeFollowText, then bullet * size is text size; If returned value is instance of * XDDFBulletSizePercent, then bullet size is a percentage of the font size; * If returned value is instance of XDDFBulletSizePoints, then bullet size * is specified in points. * </p> * * @return the bullet size */ public XDDFBulletSize getBulletSize() { return findDefinedParagraphProperty( props -> props.isSetBuSzPct() || props.isSetBuSzPts() || props.isSetBuSzTx(), props -> new XDDFParagraphBulletProperties(props).getBulletSize()).orElse(null); }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuSzPct()){ setValue(props.getBuSzPct().getVal() * 0.001); return true; } if(props.isSetBuSzPts()){ setValue( - props.getBuSzPts().getVal() * 0.01); return true; } return false; } };
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuSzPct()){ setValue(props.getBuSzPct().getVal() * 0.001); return true; } if(props.isSetBuSzPts()){ setValue( - props.getBuSzPts().getVal() * 0.01); return true; } return false; } };
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuSzPct()){ setValue(props.getBuSzPct().getVal() * 0.001); return true; } if(props.isSetBuSzPts()){ setValue( - props.getBuSzPts().getVal() * 0.01); return true; } return false; } };
public XDDFBulletSize getBulletSize() { if (props.isSetBuSzPct()) { return new XDDFBulletSizePercent(props.getBuSzPct(), null); } else if (props.isSetBuSzPts()) { return new XDDFBulletSizePoints(props.getBuSzPts()); } else if (props.isSetBuSzTx()) { return new XDDFBulletSizeFollowText(props.getBuSzTx()); } else { return null; } }
/** * Sets the bullet size that is to be used within a paragraph. * This may be specified in two different ways, percentage spacing and font point spacing: * <p> * If bulletSize >= 0, then bulletSize is a percentage of the font size. * If bulletSize < 0, then it specifies the size in points * </p> * * @return the bullet size */ public void setBulletFontSize(double bulletSize){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(bulletSize >= 0) { CTTextBulletSizePercent pt = pr.isSetBuSzPct() ? pr.getBuSzPct() : pr.addNewBuSzPct(); pt.setVal((int)(bulletSize*1000)); if(pr.isSetBuSzPts()) pr.unsetBuSzPts(); } else { CTTextBulletSizePoint pt = pr.isSetBuSzPts() ? pr.getBuSzPts() : pr.addNewBuSzPts(); pt.setVal((int)(-bulletSize*100)); if(pr.isSetBuSzPct()) pr.unsetBuSzPct(); } }
/** * Sets the bullet size that is to be used within a paragraph. * This may be specified in two different ways, percentage spacing and font point spacing: * <p> * If bulletSize >= 0, then bulletSize is a percentage of the font size. * If bulletSize < 0, then it specifies the size in points * </p> */ @SuppressWarnings("WeakerAccess") public void setBulletFontSize(double bulletSize){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(bulletSize >= 0) { CTTextBulletSizePercent pt = pr.isSetBuSzPct() ? pr.getBuSzPct() : pr.addNewBuSzPct(); pt.setVal((int)(bulletSize*1000)); if(pr.isSetBuSzPts()) pr.unsetBuSzPts(); } else { CTTextBulletSizePoint pt = pr.isSetBuSzPts() ? pr.getBuSzPts() : pr.addNewBuSzPts(); pt.setVal((int)(-bulletSize*100)); if(pr.isSetBuSzPct()) pr.unsetBuSzPct(); } }
/** * Sets the bullet size that is to be used within a paragraph. * This may be specified in two different ways, percentage spacing and font point spacing: * <p> * If bulletSize >= 0, then bulletSize is a percentage of the font size. * If bulletSize < 0, then it specifies the size in points * </p> */ public void setBulletFontSize(double bulletSize){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(bulletSize >= 0) { // percentage CTTextBulletSizePercent pt = pr.isSetBuSzPct() ? pr.getBuSzPct() : pr.addNewBuSzPct(); pt.setVal((int)(bulletSize*1000)); // unset points if percentage is now set if(pr.isSetBuSzPts()) pr.unsetBuSzPts(); } else { // points CTTextBulletSizePoint pt = pr.isSetBuSzPts() ? pr.getBuSzPts() : pr.addNewBuSzPts(); pt.setVal((int)(-bulletSize*100)); // unset percentage if points is now set if(pr.isSetBuSzPct()) pr.unsetBuSzPct(); } }
public void setBulletSize(XDDFBulletSize size) { if (props.isSetBuSzPct()) { props.unsetBuSzPct(); } if (props.isSetBuSzPts()) { props.unsetBuSzPts(); } if (props.isSetBuSzTx()) { props.unsetBuSzTx(); } if (size != null) { if (size instanceof XDDFBulletSizeFollowText) { props.setBuSzTx(((XDDFBulletSizeFollowText) size).getXmlObject()); } else if (size instanceof XDDFBulletSizePercent) { props.setBuSzPct(((XDDFBulletSizePercent) size).getXmlObject()); } else if (size instanceof XDDFBulletSizePoints) { props.setBuSzPts(((XDDFBulletSizePoints) size).getXmlObject()); } } }
/** * * @param flag whether text in this paragraph has bullets */ public void setBullet(boolean flag) { if(isBullet() == flag) return; CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); if(flag) { pr.addNewBuFont().setTypeface("Arial"); pr.addNewBuChar().setChar("\u2022"); } else { if (pr.isSetBuFont()) pr.unsetBuFont(); if (pr.isSetBuChar()) pr.unsetBuChar(); if (pr.isSetBuAutoNum()) pr.unsetBuAutoNum(); if (pr.isSetBuBlip()) pr.unsetBuBlip(); if (pr.isSetBuClr()) pr.unsetBuClr(); if (pr.isSetBuClrTx()) pr.unsetBuClrTx(); if (pr.isSetBuFont()) pr.unsetBuFont(); if (pr.isSetBuFontTx()) pr.unsetBuFontTx(); if (pr.isSetBuSzPct()) pr.unsetBuSzPct(); if (pr.isSetBuSzPts()) pr.unsetBuSzPts(); if (pr.isSetBuSzTx()) pr.unsetBuSzTx(); pr.addNewBuNone(); } }