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(); } }
/** * 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(); } }
/** * 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)); }
public LineEndLength getLineHeadLength() { CTLineProperties ln = getSpPr().getLn(); if (ln == null || !ln.isSetHeadEnd()) return LineEndLength.MEDIUM; STLineEndLength.Enum len = ln.getHeadEnd().getLen(); return len == null ? LineEndLength.MEDIUM : LineEndLength.values()[len.intValue() - 1]; }
public LineDecoration getLineTailDecoration() { CTLineProperties ln = getSpPr().getLn(); if (ln == null || !ln.isSetTailEnd()) return LineDecoration.NONE; STLineEndType.Enum end = ln.getTailEnd().getType(); return end == null ? LineDecoration.NONE : LineDecoration.values()[end.intValue() - 1]; }
/** * 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); }
/** * Specifies the line end decoration, such as a triangle or arrowhead. */ public void setLineHeadDecoration(LineDecoration style) { CTLineProperties ln = getSpPr().getLn(); CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd(); if (style == null) { if (lnEnd.isSetType()) lnEnd.unsetType(); } else { lnEnd.setType(STLineEndType.Enum.forInt(style.ordinal() + 1)); } }
/** * Specifies the line end width in relation to the line width. */ public void setLineHeadLength(LineEndLength style) { CTLineProperties ln = getSpPr().getLn(); CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd(); if (style == null) { if (lnEnd.isSetLen()) lnEnd.unsetLen(); } else { lnEnd.setLen(STLineEndLength.Enum.forInt(style.ordinal() + 1)); } }
/** * 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); }
/** * Specifies the line end decoration, such as a triangle or arrowhead. */ public void setLineTailDecoration(LineDecoration style) { CTLineProperties ln = getSpPr().getLn(); CTLineEndProperties lnEnd = ln.isSetTailEnd() ? ln.getTailEnd() : ln.addNewTailEnd(); if (style == null) { if (lnEnd.isSetType()) lnEnd.unsetType(); } else { lnEnd.setType(STLineEndType.Enum.forInt(style.ordinal() + 1)); } }
/** * specifies decorations which can be added to the head of a line. */ public void setLineHeadWidth(LineEndWidth style) { CTLineProperties ln = getSpPr().getLn(); CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd(); if (style == null) { if (lnEnd.isSetW()) lnEnd.unsetW(); } else { lnEnd.setW(STLineEndWidth.Enum.forInt(style.ordinal() + 1)); } }
/** * Specifies the line end width in relation to the line width. */ public void setLineTailLength(LineEndLength style) { CTLineProperties ln = getSpPr().getLn(); CTLineEndProperties lnEnd = ln.isSetTailEnd() ? ln.getTailEnd() : ln.addNewTailEnd(); if (style == null) { if (lnEnd.isSetLen()) lnEnd.unsetLen(); } else { lnEnd.setLen(STLineEndLength.Enum.forInt(style.ordinal() + 1)); } }