示例#1
0
        /// <summary>
        /// Creates a polygon
        /// </summary>
        /// <param name="anchor">the client anchor describes how this Group Is attached
        /// to the sheet.</param>
        /// <returns>the newly Created shape.</returns>
        public HSSFPolygon CreatePolygon(HSSFChildAnchor anchor)
        {
            HSSFPolygon shape = new HSSFPolygon(this, anchor);

            shape.Parent = this;
            shape.Anchor = anchor;
            shapes.Add(shape);
            OnCreate(shape);
            return(shape);
        }
示例#2
0
        /// <summary>
        /// Create a new textbox Under this Group.
        /// </summary>
        /// <param name="anchor">the position of the shape.</param>
        /// <returns>the textbox</returns>
        public HSSFTextbox CreateTextbox(HSSFChildAnchor anchor)
        {
            HSSFTextbox shape = new HSSFTextbox(this, anchor);

            shape.Parent = this;
            shape.Anchor = anchor;
            shapes.Add(shape);
            OnCreate(shape);
            return(shape);
        }
示例#3
0
        /// <summary>
        /// Create another Group Under this Group.
        /// </summary>
        /// <param name="anchor">the position of the new Group.</param>
        /// <returns>the Group</returns>
        public HSSFShapeGroup CreateGroup(HSSFChildAnchor anchor)
        {
            HSSFShapeGroup group = new HSSFShapeGroup(this, anchor);

            group.Parent = this;
            group.Anchor = anchor;
            shapes.Add(group);
            OnCreate(group);
            return(group);
        }
示例#4
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj == this)
            {
                return(true);
            }
            if (obj.GetType() != GetType())
            {
                return(false);
            }
            HSSFChildAnchor anchor = (HSSFChildAnchor)obj;

            return(anchor.Dx1 == Dx1 && anchor.Dx2 == Dx2 && anchor.Dy1 == Dy1 &&
                   anchor.Dy2 == Dy2);
        }
示例#5
0
        /// <summary>
        /// Create a new simple shape Under this Group.
        /// </summary>
        /// <param name="anchor">the position of the shape.</param>
        /// <returns>the shape</returns>
        public HSSFSimpleShape CreateShape(HSSFChildAnchor anchor)
        {
            HSSFSimpleShape shape = new HSSFSimpleShape(this, anchor);

            shape.Parent = this;
            shape.Anchor = anchor;
            shapes.Add(shape);
            OnCreate(shape);
            EscherSpRecord sp = (EscherSpRecord)shape.GetEscherContainer().GetChildById(EscherSpRecord.RECORD_ID);

            if (shape.Anchor.IsHorizontallyFlipped)
            {
                sp.Flags = (sp.Flags | EscherSpRecord.FLAG_FLIPHORIZ);
            }
            if (shape.Anchor.IsVerticallyFlipped)
            {
                sp.Flags = (sp.Flags | EscherSpRecord.FLAG_FLIPVERT);
            }
            return(shape);
        }
示例#6
0
        public HSSFShapeGroup(EscherContainerRecord spgrContainer, ObjRecord objRecord)
            : base(spgrContainer, objRecord)
        {
            // read internal and external coordinates from spgrContainer
            EscherContainerRecord spContainer = spgrContainer.ChildContainers[0];

            _spgrRecord = (EscherSpgrRecord)spContainer.GetChild(0);
            foreach (EscherRecord ch in spContainer.ChildRecords)
            {
                switch (ch.RecordId)
                {
                case EscherSpgrRecord.RECORD_ID:
                    break;

                case EscherClientAnchorRecord.RECORD_ID:
                    anchor = new HSSFClientAnchor((EscherClientAnchorRecord)ch);
                    break;

                case EscherChildAnchorRecord.RECORD_ID:
                    anchor = new HSSFChildAnchor((EscherChildAnchorRecord)ch);
                    break;
                }
            }
        }