public XDDFLineProperties getLineProperties() { if (props.isSetLn()) { return new XDDFLineProperties(props.getLn()); } else { return null; } }
public void setLineProperties(XDDFLineProperties properties) { if (properties == null) { if (props.isSetLn()) { props.unsetLn(); } } else { props.setLn(properties.getXmlObject()); } }
private static CTLineProperties getLn(XSLFShape shape, boolean create) { XmlObject pr = shape.getShapeProperties(); if (!(pr instanceof CTShapeProperties)) { LOG.log(POILogger.WARN, shape.getClass() +" doesn't have line properties"); return null; } CTShapeProperties spr = (CTShapeProperties)pr; return (spr.isSetLn() || !create) ? spr.getLn() : spr.addNewLn(); } }
/** * Specifies the width to be used for the underline stroke. * * @param lineWidth width in points */ public void setLineWidth( double lineWidth ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); ln.setW((int)(lineWidth*Units.EMU_PER_POINT)); }
/** * Sets the line style. * * @param lineStyle */ public void setLineStyle( int lineStyle ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTPresetLineDashProperties dashStyle = CTPresetLineDashProperties.Factory.newInstance(); dashStyle.setVal(STPresetLineDashVal.Enum.forInt(lineStyle+1)); ln.setPrstDash(dashStyle); }
@Override public void setLineStyleColor( int red, int green, int blue ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTSolidColorFillProperties fill = ln.isSetSolidFill() ? ln.getSolidFill() : ln.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
public XDDFLineProperties getLineProperties() { if (props.isSetLn()) { return new XDDFLineProperties(props.getLn()); } else { return null; } }
private static CTLineProperties getLn(XSLFShape shape, boolean create) { XmlObject pr = shape.getShapeProperties(); if (!(pr instanceof CTShapeProperties)) { LOG.log(POILogger.WARN, shape.getClass() +" doesn't have line properties"); return null; } CTShapeProperties spr = (CTShapeProperties)pr; return (spr.isSetLn() || !create) ? spr.getLn() : spr.addNewLn(); } }
public void setLineProperties(XDDFLineProperties properties) { if (properties == null) { if (props.isSetLn()) { props.unsetLn(); } } else { props.setLn(properties.getXmlObject()); } }
/** * * @param width line width in points. <code>0</code> means no line */ public void setLineWidth(double width) { CTShapeProperties spPr = getSpPr(); if (width == 0.) { if (spPr.isSetLn()) spPr.getLn().unsetW(); } else { CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr .addNewLn(); ln.setW(Units.toEMU(width)); } }
/** * Specifies the width to be used for the underline stroke. * * @param lineWidth width in points */ public void setLineWidth( double lineWidth ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); ln.setW((int)(lineWidth*Units.EMU_PER_POINT)); }
/** * Specifies the width to be used for the underline stroke. * * @param lineWidth width in points */ public void setLineWidth( double lineWidth ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); ln.setW((int)(lineWidth*EMU_PER_POINT)); }
/** * * @param cap the line end cap style */ public void setLineCap(LineCap cap) { CTShapeProperties spPr = getSpPr(); if (cap == null) { if (spPr.isSetLn()) spPr.getLn().unsetCap(); } else { CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr .addNewLn(); ln.setCap(STLineCap.Enum.forInt(cap.ordinal() + 1)); } }
/** * * @param dash a preset line dashing scheme to stroke thr shape outline */ public void setLineDash(LineDash dash) { CTShapeProperties spPr = getSpPr(); if (dash == null) { if (spPr.isSetLn()) spPr.getLn().unsetPrstDash(); } else { CTPresetLineDashProperties val = CTPresetLineDashProperties.Factory .newInstance(); val.setVal(STPresetLineDashVal.Enum.forInt(dash.ordinal() + 1)); CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr .addNewLn(); ln.setPrstDash(val); } }
/** * Sets the line style. * * @param lineStyle */ public void setLineStyle( int lineStyle ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTPresetLineDashProperties dashStyle = CTPresetLineDashProperties.Factory.newInstance(); dashStyle.setVal(STPresetLineDashVal.Enum.forInt(lineStyle+1)); ln.setPrstDash(dashStyle); }
/** * Sets the line style. * * @param lineStyle */ public void setLineStyle( int lineStyle ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTPresetLineDashProperties dashStyle = CTPresetLineDashProperties.Factory.newInstance(); dashStyle.setVal(STPresetLineDashVal.Enum.forInt(lineStyle+1)); ln.setPrstDash(dashStyle); }
/** * The color applied to the lines of this shape. */ public void setLineStyleColor( int red, int green, int blue ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTSolidColorFillProperties fill = ln.isSetSolidFill() ? ln.getSolidFill() : ln.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
@Override public void setLineStyleColor( int red, int green, int blue ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTSolidColorFillProperties fill = ln.isSetSolidFill() ? ln.getSolidFill() : ln.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
/** * @param color the color to paint the shape outline. * A <code>null</code> value turns off the shape outline. */ public void setLineColor(Color color) { CTShapeProperties spPr = getSpPr(); if (color == null) { if (spPr.isSetLn() && spPr.getLn().isSetSolidFill()) spPr.getLn().unsetSolidFill(); } else { CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr .addNewLn(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); CTSolidColorFillProperties fill = ln.isSetSolidFill() ? ln .getSolidFill() : ln.addNewSolidFill(); fill.setSrgbClr(rgb); if(fill.isSetHslClr()) fill.unsetHslClr(); if(fill.isSetPrstClr()) fill.unsetPrstClr(); if(fill.isSetSchemeClr()) fill.unsetSchemeClr(); if(fill.isSetScrgbClr()) fill.unsetScrgbClr(); if(fill.isSetSysClr()) fill.unsetSysClr(); } }