Exemplo n.º 1
0
        /**
         * Initialize default structure of a new graphic frame
         */
        public static CT_GraphicalObjectFrame Prototype()
        {
            CT_GraphicalObjectFrame graphicFrame = new CT_GraphicalObjectFrame();

            NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_GraphicalObjectFrameNonVisual nvGraphic = graphicFrame.AddNewNvGraphicFramePr();
            NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_NonVisualDrawingProps         props     = nvGraphic.AddNewCNvPr();
            props.id   = (0);
            props.name = ("Diagramm 1");
            nvGraphic.AddNewCNvGraphicFramePr();



            CT_Transform2D    transform = graphicFrame.AddNewXfrm();
            CT_PositiveSize2D extPoint  = transform.AddNewExt();
            CT_Point2D        offPoint  = transform.AddNewOff();

            extPoint.cx = (0);
            extPoint.cy = (0);
            offPoint.x  = (0);
            offPoint.y  = (0);

            CT_GraphicalObject graphic = graphicFrame.AddNewGraphic();

            prototype = graphicFrame;

            return(prototype);
        }
Exemplo n.º 2
0
        private XSSFGraphicFrame CreateGraphicFrame(XSSFClientAnchor anchor)
        {
            CT_GraphicalObjectFrame ctGraphicFrame = this.CreateTwoCellAnchor((IClientAnchor)anchor).AddNewGraphicFrame();

            ctGraphicFrame.Set(XSSFGraphicFrame.Prototype());
            long num = this.numOfGraphicFrames++;

            return(new XSSFGraphicFrame(this, ctGraphicFrame)
            {
                Anchor = anchor, Id = num, Name = "Diagramm" + (object)num
            });
        }
Exemplo n.º 3
0
        /**
         * Creates a new graphic frame.
         *
         * @param anchor    the client anchor describes how this frame is attached
         *                  to the sheet
         * @return  the newly Created graphic frame
         */
        private XSSFGraphicFrame CreateGraphicFrame(XSSFClientAnchor anchor)
        {
            CT_TwoCellAnchor        ctAnchor       = CreateTwoCellAnchor(anchor);
            CT_GraphicalObjectFrame ctGraphicFrame = ctAnchor.AddNewGraphicFrame();

            ctGraphicFrame.Set(XSSFGraphicFrame.Prototype());

            long             frameId      = numOfGraphicFrames++;
            XSSFGraphicFrame graphicFrame = new XSSFGraphicFrame(this, ctGraphicFrame);

            graphicFrame.Anchor = anchor;
            graphicFrame.Id     = frameId;
            graphicFrame.Name   = "Diagramm" + frameId;
            return(graphicFrame);
        }
Exemplo n.º 4
0
 public static CT_GraphicalObjectFrame Prototype()
 {
     if (XSSFGraphicFrame.prototype == null)
     {
         CT_GraphicalObjectFrame          graphicalObjectFrame = new CT_GraphicalObjectFrame();
         CT_GraphicalObjectFrameNonVisual objectFrameNonVisual = graphicalObjectFrame.AddNewNvGraphicFramePr();
         CT_NonVisualDrawingProps         visualDrawingProps   = objectFrameNonVisual.AddNewCNvPr();
         visualDrawingProps.id   = 0U;
         visualDrawingProps.name = "Diagramm 1";
         objectFrameNonVisual.AddNewCNvGraphicFramePr();
         CT_Transform2D    ctTransform2D    = graphicalObjectFrame.AddNewXfrm();
         CT_PositiveSize2D ctPositiveSize2D = ctTransform2D.AddNewExt();
         CT_Point2D        ctPoint2D        = ctTransform2D.AddNewOff();
         ctPositiveSize2D.cx = 0L;
         ctPositiveSize2D.cy = 0L;
         ctPoint2D.x         = 0L;
         ctPoint2D.y         = 0L;
         graphicalObjectFrame.AddNewGraphic();
         XSSFGraphicFrame.prototype = graphicalObjectFrame;
     }
     return(XSSFGraphicFrame.prototype);
 }
Exemplo n.º 5
0
 /**
  * Construct a new XSSFGraphicFrame object.
  *
  * @param Drawing the XSSFDrawing that owns this frame
  * @param ctGraphicFrame the XML bean that stores this frame content
  */
 public XSSFGraphicFrame(XSSFDrawing Drawing, CT_GraphicalObjectFrame ctGraphicFrame)
 {
     this.drawing      = Drawing;
     this.graphicFrame = ctGraphicFrame;
 }