@Override public void setBorderColor(BorderEdge edge, Color color) { if (color == null) { throw new IllegalArgumentException("Colors need to be specified."); } CTLineProperties ln = setBorderDefaults(edge); CTSolidColorFillProperties fill = ln.addNewSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); c.setColor(color); }
@SuppressWarnings("WeakerAccess") protected static PaintStyle selectPaint(CTSolidColorFillProperties solidFill, CTSchemeColor phClr, final XSLFTheme theme) { if (solidFill.isSetSchemeClr()) { // if there's a reference to the placeholder color, // stop evaluating further and let the caller select // the next style inheritance level // if (STSchemeColorVal.PH_CLR.equals(solidFill.getSchemeClr().getVal())) { // return null; // } if (phClr == null) { phClr = solidFill.getSchemeClr(); } } final XSLFColor c = new XSLFColor(solidFill, theme, phClr); return DrawPaint.createSolidPaint(c.getColorStyle()); }
@SuppressWarnings("WeakerAccess") public Color getBorderColor(BorderEdge edge) { CTLineProperties ln = getCTLine(edge, false); if (ln == null || ln.isSetNoFill() || !ln.isSetSolidFill()) { return null; } CTSolidColorFillProperties fill = ln.getSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); return c.getColor(); }
/** * Specifies a solid color fill. The shape is filled entirely with the * specified color. * * @param color * the solid color fill. The value of <code>null</code> unsets * the solidFIll attribute from the underlying xml */ @Override public void setFillColor(Color color) { CTTableCellProperties spPr = getCellProperties(true); if (color == null) { if (spPr.isSetSolidFill()) { spPr.unsetSolidFill(); } } else { CTSolidColorFillProperties fill = spPr.isSetSolidFill() ? spPr.getSolidFill() : spPr.addNewSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); c.setColor(color); } }
@Override public void setFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { LOG.log(POILogger.WARN, "Currently only SolidPaint is supported!"); return; } SolidPaint sp = (SolidPaint)color; Color c = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextCharacterProperties rPr = getRPr(true); CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill(); XSLFColor col = new XSLFColor(fill, getParentParagraph().getParentShape().getSheet().getTheme(), fill.getSchemeClr()); col.setColor(c); }
public XDDFColor getColor() { if (props.isSetHslClr()) { return new XDDFColorHsl(props.getHslClr()); } else if (props.isSetPrstClr()) { return new XDDFColorPreset(props.getPrstClr()); } else if (props.isSetSchemeClr()) { return new XDDFColorSchemeBased(props.getSchemeClr()); } else if (props.isSetScrgbClr()) { return new XDDFColorRgbPercent(props.getScrgbClr()); } else if (props.isSetSrgbClr()) { return new XDDFColorRgbBinary(props.getSrgbClr()); } else if (props.isSetSysClr()) { return new XDDFColorSystemDefined(props.getSysClr()); } return null; }
/** * @param color the color to paint the shape outline. * A <code>null</code> value turns off the shape outline. */ public void setLineColor(Color color) { CTLineProperties ln = getLn(this, true); if (ln == null) { return; } if (ln.isSetSolidFill()) { ln.unsetSolidFill(); } if (ln.isSetGradFill()) { ln.unsetGradFill(); } if (ln.isSetPattFill()) { ln.unsetPattFill(); } if (ln.isSetNoFill()) { ln.unsetNoFill(); } if (color == null) { ln.addNewNoFill(); } else { CTSolidColorFillProperties fill = ln.addNewSolidFill(); XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); col.setColor(color); } }
XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); col.setColor(color);
XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); col.setColor(color);
@SuppressWarnings("WeakerAccess") protected static PaintStyle selectPaint(CTSolidColorFillProperties solidFill, CTSchemeColor phClr, final XSLFTheme theme) { if (solidFill.isSetSchemeClr()) { // if there's a reference to the placeholder color, // stop evaluating further and let the caller select // the next style inheritance level // if (STSchemeColorVal.PH_CLR.equals(solidFill.getSchemeClr().getVal())) { // return null; // } if (phClr == null) { phClr = solidFill.getSchemeClr(); } } final XSLFColor c = new XSLFColor(solidFill, theme, phClr); return DrawPaint.createSolidPaint(c.getColorStyle()); }
@Override public void setBorderColor(BorderEdge edge, Color color) { if (color == null) { throw new IllegalArgumentException("Colors need to be specified."); } CTLineProperties ln = setBorderDefaults(edge); CTSolidColorFillProperties fill = ln.addNewSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); c.setColor(color); }
public boolean fetch(CTTextCharacterProperties props){ CTSolidColorFillProperties solidFill = props.getSolidFill(); if(solidFill != null) { boolean useCtxColor = (solidFill.isSetSchemeClr() && solidFill.getSchemeClr().getVal() == STSchemeColorVal.PH_CLR) || isFetchingFromMaster; Color c = new XSLFColor(solidFill, theme, useCtxColor ? phClr : null).getColor(); setValue(c); return true; } return false; } };
@SuppressWarnings("WeakerAccess") public Color getBorderColor(BorderEdge edge) { CTLineProperties ln = getCTLine(edge, false); if (ln == null || ln.isSetNoFill() || !ln.isSetSolidFill()) { return null; } CTSolidColorFillProperties fill = ln.getSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); return c.getColor(); }
/** * Specifies a solid color fill. The shape is filled entirely with the * specified color. * * @param color * the solid color fill. The value of <code>null</code> unsets * the solidFIll attribute from the underlying xml */ @Override public void setFillColor(Color color) { CTTableCellProperties spPr = getCellProperties(true); if (color == null) { if (spPr.isSetSolidFill()) { spPr.unsetSolidFill(); } } else { CTSolidColorFillProperties fill = spPr.isSetSolidFill() ? spPr.getSolidFill() : spPr.addNewSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); c.setColor(color); } }
@Override public void setFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { LOG.log(POILogger.WARN, "Currently only SolidPaint is supported!"); return; } SolidPaint sp = (SolidPaint)color; Color c = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextCharacterProperties rPr = getRPr(true); CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill(); XSLFColor col = new XSLFColor(fill, getParentParagraph().getParentShape().getSheet().getTheme(), fill.getSchemeClr()); col.setColor(c); }
public XDDFColor getColor() { if (props.isSetHslClr()) { return new XDDFColorHsl(props.getHslClr()); } else if (props.isSetPrstClr()) { return new XDDFColorPreset(props.getPrstClr()); } else if (props.isSetSchemeClr()) { return new XDDFColorSchemeBased(props.getSchemeClr()); } else if (props.isSetScrgbClr()) { return new XDDFColorRgbPercent(props.getScrgbClr()); } else if (props.isSetSrgbClr()) { return new XDDFColorRgbBinary(props.getSrgbClr()); } else if (props.isSetSysClr()) { return new XDDFColorSystemDefined(props.getSysClr()); } return null; }
/** * @param color the color to paint the shape outline. * A <code>null</code> value turns off the shape outline. */ public void setLineColor(Color color) { CTLineProperties ln = getLn(this, true); if (ln == null) { return; } if (ln.isSetSolidFill()) { ln.unsetSolidFill(); } if (ln.isSetGradFill()) { ln.unsetGradFill(); } if (ln.isSetPattFill()) { ln.unsetPattFill(); } if (ln.isSetNoFill()) { ln.unsetNoFill(); } if (color == null) { ln.addNewNoFill(); } else { CTSolidColorFillProperties fill = ln.addNewSolidFill(); XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); col.setColor(color); } }
XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); col.setColor(color);
XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); col.setColor(color);