public XSSFConnector CreateConnector(XSSFClientAnchor anchor) { CT_Connector ctShape = this.CreateTwoCellAnchor((IClientAnchor)anchor).AddNewCxnSp(); ctShape.Set(XSSFConnector.Prototype()); XSSFConnector xssfConnector = new XSSFConnector(this, ctShape); xssfConnector.anchor = (XSSFAnchor)anchor; return(xssfConnector); }
/** * Creates a simple shape. This includes such shapes as lines, rectangles, * and ovals. * * @param anchor the client anchor describes how this group is attached * to the sheet. * @return the newly Created shape. */ public XSSFConnector CreateConnector(XSSFClientAnchor anchor) { CT_TwoCellAnchor ctAnchor = CreateTwoCellAnchor(anchor); CT_Connector ctShape = ctAnchor.AddNewCxnSp(); ctShape.Set(XSSFConnector.Prototype()); XSSFConnector shape = new XSSFConnector(this, ctShape); shape.anchor = anchor; return(shape); }
public XSSFConnector CreateConnector(XSSFChildAnchor anchor) { CT_Connector ctShape = this.ctGroup.AddNewCxnSp(); ctShape.Set(XSSFConnector.Prototype()); XSSFConnector xssfConnector = new XSSFConnector(this.GetDrawing(), ctShape); xssfConnector.parent = this; xssfConnector.anchor = (XSSFAnchor)anchor; xssfConnector.GetCTConnector().spPr.xfrm = anchor.GetCTTransform2D(); return(xssfConnector); }
/** * Creates a simple shape. This includes such shapes as lines, rectangles, * and ovals. * * @param anchor the child anchor describes how this shape is attached * to the group. * @return the newly Created shape. */ public XSSFConnector CreateConnector(XSSFChildAnchor anchor) { CT_Connector ctShape = ctGroup.AddNewCxnSp(); ctShape.Set(XSSFConnector.Prototype()); XSSFConnector shape = new XSSFConnector(GetDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.GetCTConnector().spPr.xfrm = (anchor.GetCTTransform2D()); return(shape); }
/** * Initialize default structure of a new auto-shape * */ public static CT_Connector Prototype() { CT_Connector shape = new CT_Connector(); CT_ConnectorNonVisual nv = shape.AddNewNvCxnSpPr(); NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_NonVisualDrawingProps nvp = nv.AddNewCNvPr(); nvp.id = (1); nvp.name = ("Shape 1"); nv.AddNewCNvCxnSpPr(); NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_ShapeProperties sp = shape.AddNewSpPr(); NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_Transform2D t2d = sp.AddNewXfrm(); CT_PositiveSize2D p1 = t2d.AddNewExt(); p1.cx = (0); p1.cy = (0); CT_Point2D p2 = t2d.AddNewOff(); p2.x = (0); p2.y = (0); CT_PresetGeometry2D geom = sp.AddNewPrstGeom(); geom.prst = (ST_ShapeType.line); geom.AddNewAvLst(); NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_ShapeStyle style = shape.AddNewStyle(); CT_SchemeColor scheme = style.AddNewLnRef().AddNewSchemeClr(); scheme.val = (ST_SchemeColorVal.accent1); style.lnRef.idx = (1); CT_StyleMatrixReference fillref = style.AddNewFillRef(); fillref.idx = (0); fillref.AddNewSchemeClr().val = (ST_SchemeColorVal.accent1); CT_StyleMatrixReference effectRef = style.AddNewEffectRef(); effectRef.idx = (0); effectRef.AddNewSchemeClr().val = (ST_SchemeColorVal.accent1); CT_FontReference fontRef = style.AddNewFontRef(); fontRef.idx = (ST_FontCollectionIndex.minor); fontRef.AddNewSchemeClr().val = (ST_SchemeColorVal.tx1); prototype = shape; return(prototype); }
public static CT_Connector Prototype() { if (XSSFConnector.prototype == null) { CT_Connector ctConnector = new CT_Connector(); CT_ConnectorNonVisual connectorNonVisual = ctConnector.AddNewNvCxnSpPr(); CT_NonVisualDrawingProps visualDrawingProps = connectorNonVisual.AddNewCNvPr(); visualDrawingProps.id = 1U; visualDrawingProps.name = "Shape 1"; connectorNonVisual.AddNewCNvCxnSpPr(); CT_ShapeProperties ctShapeProperties = ctConnector.AddNewSpPr(); CT_Transform2D ctTransform2D = ctShapeProperties.AddNewXfrm(); CT_PositiveSize2D ctPositiveSize2D = ctTransform2D.AddNewExt(); ctPositiveSize2D.cx = 0L; ctPositiveSize2D.cy = 0L; CT_Point2D ctPoint2D = ctTransform2D.AddNewOff(); ctPoint2D.x = 0L; ctPoint2D.y = 0L; CT_PresetGeometry2D presetGeometry2D = ctShapeProperties.AddNewPrstGeom(); presetGeometry2D.prst = ST_ShapeType.line; presetGeometry2D.AddNewAvLst(); CT_ShapeStyle ctShapeStyle = ctConnector.AddNewStyle(); ctShapeStyle.AddNewLnRef().AddNewSchemeClr().val = ST_SchemeColorVal.accent1; ctShapeStyle.lnRef.idx = 1U; CT_StyleMatrixReference styleMatrixReference1 = ctShapeStyle.AddNewFillRef(); styleMatrixReference1.idx = 0U; styleMatrixReference1.AddNewSchemeClr().val = ST_SchemeColorVal.accent1; CT_StyleMatrixReference styleMatrixReference2 = ctShapeStyle.AddNewEffectRef(); styleMatrixReference2.idx = 0U; styleMatrixReference2.AddNewSchemeClr().val = ST_SchemeColorVal.accent1; CT_FontReference ctFontReference = ctShapeStyle.AddNewFontRef(); ctFontReference.idx = ST_FontCollectionIndex.minor; ctFontReference.AddNewSchemeClr().val = ST_SchemeColorVal.tx1; XSSFConnector.prototype = ctConnector; } return(XSSFConnector.prototype); }
public XSSFConnector(XSSFDrawing drawing, CT_Connector ctShape) { this.drawing = drawing; this.ctShape = ctShape; }
public CT_Connector AddNewCxnSp() { connectorField = new CT_Connector(); return(connectorField); }