public void setBulletColorFollowText() { if (props.isSetBuClr()) { props.unsetBuClr(); } if (props.isSetBuClrTx()) { // nothing to do: already set } else { props.addNewBuClrTx(); } }
public XDDFColor getBulletColor() { if (props.isSetBuClr()) { return XDDFColor.forColorContainer(props.getBuClr()); } else { return null; } }
/** * * @return the color of bullet characters within a given paragraph. A * <code>null</code> value means to use the text font color. */ public XDDFColor getBulletColor() { return findDefinedParagraphProperty(props -> props.isSetBuClr() || props.isSetBuClrTx(), props -> new XDDFParagraphBulletProperties(props).getBulletColor()).orElse(null); }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuClr()){ XSLFColor c = new XSLFColor(props.getBuClr(), theme, null); setValue(c.getColor()); return true; } return false; } };
public void setBulletColor(XDDFColor color) { if (props.isSetBuClrTx()) { props.unsetBuClrTx(); } if (color == null) { if (props.isSetBuClr()) { props.unsetBuClr(); } } else { props.setBuClr(color.getColorContainer()); } }
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ public void setBulletFontColor(Color color){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); }
props.unsetBuNone(); if (props.isSetBuClr()) { props.unsetBuClr();
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuClr()){ if(props.getBuClr().isSetSrgbClr()){ CTSRgbColor clr = props.getBuClr().getSrgbClr(); byte[] rgb = clr.getVal(); setValue(new Color(0xFF & rgb[0], 0xFF & rgb[1], 0xFF & rgb[2])); return true; } } return false; } };
/** * * @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 the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ @SuppressWarnings("WeakerAccess") public void setBulletFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { throw new IllegalArgumentException("Currently XSLF only supports SolidPaint"); } // TODO: implement setting bullet color to null SolidPaint sp = (SolidPaint)color; Color col = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) col.getRed(), (byte) col.getGreen(), (byte) col.getBlue()}); }
/** * 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"); } }
public XDDFColor getBulletColor() { if (props.isSetBuClr()) { return XDDFColor.forColorContainer(props.getBuClr()); } else { return null; } }
public void setBulletColorFollowText() { if (props.isSetBuClr()) { props.unsetBuClr(); } if (props.isSetBuClrTx()) { // nothing to do: already set } else { props.addNewBuClrTx(); } }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuClr()){ XSLFColor c = new XSLFColor(props.getBuClr(), theme, null); setValue(c.getColor()); return true; } return false; } };
/** * * @return the color of bullet characters within a given paragraph. A * <code>null</code> value means to use the text font color. */ public XDDFColor getBulletColor() { return findDefinedParagraphProperty(props -> props.isSetBuClr() || props.isSetBuClrTx(), props -> new XDDFParagraphBulletProperties(props).getBulletColor()).orElse(null); }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuClr()){ XSLFColor c = new XSLFColor(props.getBuClr(), theme, null); setValue(c.getColor()); return true; } return false; } };
public void setBulletColor(XDDFColor color) { if (props.isSetBuClrTx()) { props.unsetBuClrTx(); } if (color == null) { if (props.isSetBuClr()) { props.unsetBuClr(); } } else { props.setBuClr(color.getColorContainer()); } }
public boolean fetch(CTTextParagraphProperties props){ if(props.isSetBuClr()){ if(props.getBuClr().isSetSrgbClr()){ CTSRgbColor clr = props.getBuClr().getSrgbClr(); byte[] rgb = clr.getVal(); setValue(new Color(0xFF & rgb[0], 0xFF & rgb[1], 0xFF & rgb[2])); return true; } } return false; } };
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ public void setBulletFontColor(Color color){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); }
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ public void setBulletFontColor(Color color){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); }