Search in sources :

Example 6 with CTShapeStyle

use of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle in project poi by apache.

the class XSSFConnector method prototype.

/**
     * Initialize default structure of a new auto-shape
     *
     */
protected static CTConnector prototype() {
    if (prototype == null) {
        CTConnector shape = CTConnector.Factory.newInstance();
        CTConnectorNonVisual nv = shape.addNewNvCxnSpPr();
        CTNonVisualDrawingProps nvp = nv.addNewCNvPr();
        nvp.setId(1);
        nvp.setName("Shape 1");
        nv.addNewCNvCxnSpPr();
        CTShapeProperties sp = shape.addNewSpPr();
        CTTransform2D t2d = sp.addNewXfrm();
        CTPositiveSize2D p1 = t2d.addNewExt();
        p1.setCx(0);
        p1.setCy(0);
        CTPoint2D p2 = t2d.addNewOff();
        p2.setX(0);
        p2.setY(0);
        CTPresetGeometry2D geom = sp.addNewPrstGeom();
        geom.setPrst(STShapeType.LINE);
        geom.addNewAvLst();
        CTShapeStyle style = shape.addNewStyle();
        CTSchemeColor scheme = style.addNewLnRef().addNewSchemeClr();
        scheme.setVal(STSchemeColorVal.ACCENT_1);
        style.getLnRef().setIdx(1);
        CTStyleMatrixReference fillref = style.addNewFillRef();
        fillref.setIdx(0);
        fillref.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_1);
        CTStyleMatrixReference effectRef = style.addNewEffectRef();
        effectRef.setIdx(0);
        effectRef.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_1);
        CTFontReference fontRef = style.addNewFontRef();
        fontRef.setIdx(STFontCollectionIndex.MINOR);
        fontRef.addNewSchemeClr().setVal(STSchemeColorVal.TX_1);
        prototype = shape;
    }
    return prototype;
}
Also used : CTTransform2D(org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D) CTPoint2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D) CTShapeStyle(org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle) CTConnector(org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTConnector) CTShapeProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties) CTPresetGeometry2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D) CTNonVisualDrawingProps(org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps) CTSchemeColor(org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor) CTStyleMatrixReference(org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference) CTPositiveSize2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D) CTFontReference(org.openxmlformats.schemas.drawingml.x2006.main.CTFontReference) CTConnectorNonVisual(org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTConnectorNonVisual)

Aggregations

CTShapeStyle (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle)6 PackagePart (org.apache.poi.openxml4j.opc.PackagePart)3 DrawPaint (org.apache.poi.sl.draw.DrawPaint)3 PaintStyle (org.apache.poi.sl.usermodel.PaintStyle)3 SolidPaint (org.apache.poi.sl.usermodel.PaintStyle.SolidPaint)3 PropertyFetcher (org.apache.poi.xslf.model.PropertyFetcher)3 XSLFFillProperties (org.apache.poi.xslf.usermodel.XSLFPropertiesDelegate.XSLFFillProperties)3 CTSchemeColor (org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor)3 CTStyleMatrixReference (org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference)3 CTStyleMatrix (org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrix)2 CharacterPropertyFetcher (org.apache.poi.xslf.model.CharacterPropertyFetcher)1 XSLFEffectProperties (org.apache.poi.xslf.usermodel.XSLFPropertiesDelegate.XSLFEffectProperties)1 CTBaseStyles (org.openxmlformats.schemas.drawingml.x2006.main.CTBaseStyles)1 CTEffectStyleItem (org.openxmlformats.schemas.drawingml.x2006.main.CTEffectStyleItem)1 CTFontReference (org.openxmlformats.schemas.drawingml.x2006.main.CTFontReference)1 CTLineProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties)1 CTLineStyleList (org.openxmlformats.schemas.drawingml.x2006.main.CTLineStyleList)1 CTNonVisualDrawingProps (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps)1 CTOuterShadowEffect (org.openxmlformats.schemas.drawingml.x2006.main.CTOuterShadowEffect)1 CTPoint2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D)1