Search in sources :

Example 1 with CTConnectorNonVisual

use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTConnectorNonVisual in project poi by apache.

the class XSLFConnectorShape method prototype.

/**
     * @param shapeId 1-based shapeId
     */
static CTConnector prototype(int shapeId) {
    CTConnector ct = CTConnector.Factory.newInstance();
    CTConnectorNonVisual nvSpPr = ct.addNewNvCxnSpPr();
    CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr();
    cnv.setName("Connector " + shapeId);
    cnv.setId(shapeId + 1);
    nvSpPr.addNewCNvCxnSpPr();
    nvSpPr.addNewNvPr();
    CTShapeProperties spPr = ct.addNewSpPr();
    CTPresetGeometry2D prst = spPr.addNewPrstGeom();
    prst.setPrst(STShapeType.LINE);
    prst.addNewAvLst();
    /* CTLineProperties ln = */
    spPr.addNewLn();
    return ct;
}
Also used : CTConnector(org.openxmlformats.schemas.presentationml.x2006.main.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) CTConnectorNonVisual(org.openxmlformats.schemas.presentationml.x2006.main.CTConnectorNonVisual)

Example 2 with CTConnectorNonVisual

use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTConnectorNonVisual 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

CTNonVisualDrawingProps (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps)2 CTPresetGeometry2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D)2 CTShapeProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties)2 CTFontReference (org.openxmlformats.schemas.drawingml.x2006.main.CTFontReference)1 CTPoint2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D)1 CTPositiveSize2D (org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)1 CTSchemeColor (org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor)1 CTShapeStyle (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle)1 CTStyleMatrixReference (org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference)1 CTTransform2D (org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D)1 CTConnector (org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTConnector)1 CTConnectorNonVisual (org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTConnectorNonVisual)1 CTConnector (org.openxmlformats.schemas.presentationml.x2006.main.CTConnector)1 CTConnectorNonVisual (org.openxmlformats.schemas.presentationml.x2006.main.CTConnectorNonVisual)1