Ejemplo n.º 1
0
 /// <summary>
 /// Constructs a picture object.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
     base.ShapeType = (OBJECT_TYPE_PICTURE);
     CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];
     cod.ObjectType = CommonObjectType.PICTURE;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Construct a new textbox with the given parent and anchor.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">One of HSSFClientAnchor or HSSFChildAnchor</param>
 public HSSFTextbox(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
     HorizontalAlignment = HorizontalTextAlignment.Left;
     VerticalAlignment = VerticalTextAlignment.Top;
     this.String = (new HSSFRichTextString(""));
 }
Ejemplo n.º 3
0
 /**
  * creates shapes from existing file
  * @param spContainer
  * @param objRecord
  */
 public HSSFShape(EscherContainerRecord spContainer, ObjRecord objRecord)
 {
     this._escherContainer = spContainer;
     this._objRecord = objRecord;
     this._optRecord = (EscherOptRecord)spContainer.GetChildById(EscherOptRecord.RECORD_ID);
     this.anchor = HSSFAnchor.CreateAnchorFromEscher(spContainer);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates the anchor.
        /// </summary>
        /// <param name="userAnchor">The user anchor.</param>
        /// <returns></returns>
        public static EscherRecord CreateAnchor(HSSFAnchor userAnchor)
        {
            if (userAnchor is HSSFClientAnchor)
            {
                HSSFClientAnchor a = (HSSFClientAnchor)userAnchor;

                EscherClientAnchorRecord anchor = new EscherClientAnchorRecord();
                anchor.RecordId=EscherClientAnchorRecord.RECORD_ID;
                anchor.Options=(short)0x0000;
                anchor.Flag=(short)a.AnchorType;
                anchor.Col1=(short)Math.Min(a.Col1, a.Col2);
                anchor.Dx1=(short)a.Dx1;
                anchor.Row1=(short)Math.Min(a.Row1, a.Row2);
                anchor.Dy1=(short)a.Dy1;

                anchor.Col2=(short)Math.Max(a.Col1, a.Col2);
                anchor.Dx2=(short)a.Dx2;
                anchor.Row2=(short)Math.Max(a.Row1, a.Row2);
                anchor.Dy2=(short)a.Dy2;
                return anchor;
            }
            else
            {
                HSSFChildAnchor a = (HSSFChildAnchor)userAnchor;
                EscherChildAnchorRecord anchor = new EscherChildAnchorRecord();
                anchor.RecordId=EscherChildAnchorRecord.RECORD_ID;
                anchor.Options=(short)0x0000;
                anchor.Dx1=(short)Math.Min(a.Dx1, a.Dx2);
                anchor.Dy1=(short)Math.Min(a.Dy1, a.Dy2);
                anchor.Dx2=(short)Math.Max(a.Dx2, a.Dx1);
                anchor.Dy2=(short)Math.Max(a.Dy2, a.Dy1);
                return anchor;
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Create a new shape with the specified parent and anchor.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFShape(HSSFShape parent, HSSFAnchor anchor)
 {
     this.parent           = parent;
     this.anchor           = anchor;
     this._escherContainer = CreateSpContainer();
     _optRecord            = (EscherOptRecord)_escherContainer.GetChildById(EscherOptRecord.RECORD_ID);
     _objRecord            = CreateObjRecord();
 }
Ejemplo n.º 6
0
        public HSSFCombobox(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {
            base.ShapeType = (OBJECT_TYPE_COMBO_BOX);
            CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];

            cod.ObjectType = CommonObjectType.COMBO_BOX;
        }
Ejemplo n.º 7
0
        /**
         * Constructs a cell comment.
         *
         * @param anchor    the client anchor describes how this comment is attached
         *                  to the sheet.
         * @return      the newly created comment.
         */
        public HSSFComment CreateComment(HSSFAnchor anchor)
        {
            HSSFComment shape = new HSSFComment(null, anchor);

            AddShape(shape);
            OnCreate(shape);
            return(shape);
        }
Ejemplo n.º 8
0
        /**
         * YK: used to create autofilters
         *
         * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(int, int, int, int)
         */
        public HSSFSimpleShape CreateComboBox(HSSFAnchor anchor)
        {
            HSSFCombobox shape = new HSSFCombobox(null, anchor);

            AddShape(shape);
            OnCreate(shape);
            return(shape);
        }
Ejemplo n.º 9
0
        public HSSFCombobox(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {

            base.ShapeType = (OBJECT_TYPE_COMBO_BOX);
            CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];
            cod.ObjectType = CommonObjectType.ComboBox;
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Constructs a picture object.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="anchor">The anchor.</param>
        public HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {
            base.ShapeType = (OBJECT_TYPE_PICTURE);
            CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];

            cod.ObjectType = CommonObjectType.PICTURE;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Construct a new textbox with the given parent and anchor.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="anchor">One of HSSFClientAnchor or HSSFChildAnchor</param>
        public HSSFTextbox(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {

            HorizontalAlignment = (HORIZONTAL_ALIGNMENT_LEFT);
            VerticalAlignment = (VERTICAL_ALIGNMENT_TOP);
            this.String = (new HSSFRichTextString(""));
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Construct a new textbox with the given parent and anchor.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="anchor">One of HSSFClientAnchor or HSSFChildAnchor</param>
        public HSSFTextbox(HSSFShape parent, HSSFAnchor anchor):base(parent, anchor)
        {
            
            ShapeType = (OBJECT_TYPE_TEXT);

            halign = HORIZONTAL_ALIGNMENT_LEFT;
            valign = VERTICAL_ALIGNMENT_TOP;
        }
Ejemplo n.º 13
0
        /**
         * YK: used to create autofilters
         *
         * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(int, int, int, int)
         */
        public HSSFSimpleShape CreateComboBox(HSSFAnchor anchor)
        {
            HSSFSimpleShape shape = new HSSFSimpleShape(null, anchor);

            shape.ShapeType = HSSFSimpleShape.OBJECT_TYPE_COMBO_BOX;
            shape.Anchor    = anchor;
            AddShape(shape);
            return(shape);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Construct a new comment with the given parent and anchor.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="anchor">defines position of this anchor in the sheet</param>
        public HSSFComment(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor)
        {
            this.ShapeType = (OBJECT_TYPE_COMMENT);

            //default color for comments
            this.FillColor = 0x08000050;

            //by default comments are hidden
            visible = false;

            author = "";
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Construct a new comment with the given parent and anchor.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="anchor">defines position of this anchor in the sheet</param>
        public HSSFComment(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {
            this.ShapeType = (OBJECT_TYPE_COMMENT);

            //default color for comments
            this.FillColor = 0x08000050;

            //by default comments are hidden
            visible = false;

            author = "";
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Construct a new comment with the given parent and anchor.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="anchor">defines position of this anchor in the sheet</param>
        public HSSFComment(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {
            _note = CreateNoteRecord();

            //default color for comments
            this.FillColor = 0x08000050;

            //by default comments are hidden
            Visible = false;

            Author = "";
            CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];
            cod.ObjectType = CommonObjectType.COMMENT; 
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Construct a new comment with the given parent and anchor.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="anchor">defines position of this anchor in the sheet</param>
        public HSSFComment(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {
            _note = CreateNoteRecord();

            //default color for comments
            this.FillColor = 0x08000050;

            //by default comments are hidden
            Visible = false;

            Author = "";
            CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)GetObjRecord().SubRecords[0];

            cod.ObjectType = CommonObjectType.Comment;
        }
Ejemplo n.º 18
0
 /**
  * YK: used to create autofilters
  *
  * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(int, int, int, int)
  */
 public HSSFSimpleShape CreateComboBox(HSSFAnchor anchor)
 {
     HSSFSimpleShape shape = new HSSFSimpleShape(null, anchor);
     shape.ShapeType = HSSFSimpleShape.OBJECT_TYPE_COMBO_BOX;
     shape.Anchor = anchor;
     AddShape(shape);
     return shape;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HSSFSimpleShape"/> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFSimpleShape(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
     _textObjectRecord = CreateTextObjRecord();
 }
Ejemplo n.º 20
0
 public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
     _spgrRecord = (EscherSpgrRecord)((EscherContainerRecord)GetEscherContainer().GetChild(0)).GetChildById(EscherSpgrRecord.RECORD_ID);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HSSFSimpleShape"/> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFSimpleShape(HSSFShape parent, HSSFAnchor anchor)
     :base(parent, anchor)
 {
     _textObjectRecord = CreateTextObjRecord();
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Construct a new comment with the given parent and anchor.
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="anchor">defines position of this anchor in the sheet</param>
 public HSSFComment(HSSFShape parent, HSSFAnchor anchor) :
     this(parent, anchor, CreateNoteRecord())
 {
 }
Ejemplo n.º 23
0
 public static EscherRecord GetEscherAnchor(HSSFAnchor anchor)
 {
     return anchor.GetEscherAnchor();
 }
Ejemplo n.º 24
0
        /// <summary>
        /// Constructs a picture object.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="anchor">The anchor.</param>
        public HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {

            this.ShapeType = (OBJECT_TYPE_PICTURE);
        }
Ejemplo n.º 25
0
 /**
  * YK: used to create autofilters
  *
  * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(int, int, int, int)
  */
 public HSSFSimpleShape CreateComboBox(HSSFAnchor anchor)
 {
     HSSFCombobox shape = new HSSFCombobox(null, anchor);
     AddShape(shape);
     OnCreate(shape);
     return shape;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Constructs a cell comment.
 /// </summary>
 /// <param name="anchor">the client anchor describes how this comment is attached
 /// to the sheet.</param>
 /// <returns>the newly created comment.</returns>
 public HSSFComment CreateComment(HSSFAnchor anchor)
 {
     HSSFComment shape = new HSSFComment(null, anchor);
     shape.Anchor = anchor;
     shapes.Add(shape);
     return shape;
 }
Ejemplo n.º 27
0
 public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor):base(parent, anchor)
 {
     
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HSSFSimpleShape"/> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFSimpleShape(HSSFShape parent, HSSFAnchor anchor):base(parent, anchor)
 {
     
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Constructs a picture object.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
     this.ShapeType = (OBJECT_TYPE_PICTURE);
 }
Ejemplo n.º 30
0
 /// <summary>
 /// Create a new shape with the specified parent and anchor.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 protected HSSFShape(Shape parent, HSSFAnchor anchor)
 {
     this.parent = parent;
     this.Anchor = anchor;
 }
Ejemplo n.º 31
0
 public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor)
 {
 }
Ejemplo n.º 32
0
 /// <summary>
 /// Creates an escher anchor record from a HSSFAnchor.
 /// </summary>
 /// <param name="userAnchor">The high level anchor to Convert.</param>
 /// <returns>An escher anchor record.</returns>
 protected virtual EscherRecord CreateAnchor(HSSFAnchor userAnchor)
 {
     return ConvertAnchor.CreateAnchor(userAnchor);
 }
Ejemplo n.º 33
0
        public HSSFPolygon(HSSFShape parent, HSSFAnchor anchor)
            : base(parent, anchor)
        {

        }
Ejemplo n.º 34
0
 /**
  * Constructs a cell comment.
  *
  * @param anchor    the client anchor describes how this comment is attached
  *                  to the sheet.
  * @return      the newly created comment.
  */
 public HSSFComment CreateComment(HSSFAnchor anchor)
 {
     HSSFComment shape = new HSSFComment(null, anchor);
     AddShape(shape);
     OnCreate(shape);
     return shape;
 }
Ejemplo n.º 35
0
 public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
     _spgrRecord = (EscherSpgrRecord)((EscherContainerRecord)GetEscherContainer().GetChild(0)).GetChildById(EscherSpgrRecord.RECORD_ID);
 }
Ejemplo n.º 36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HSSFSimpleShape"/> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFSimpleShape(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor)
 {
 }
Ejemplo n.º 37
0
 /// <summary>
 /// Create a new shape with the specified parent and anchor.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 public HSSFShape(HSSFShape parent, HSSFAnchor anchor)
 {
     this.parent = parent;
     this.anchor = anchor;
     this._escherContainer = CreateSpContainer();
     _optRecord = (EscherOptRecord)_escherContainer.GetChildById(EscherOptRecord.RECORD_ID);
     _objRecord = CreateObjRecord();
 }
Ejemplo n.º 38
0
 /// <summary>
 /// Create a new shape with the specified parent and anchor.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="anchor">The anchor.</param>
 protected HSSFShape(HSSFShape parent, HSSFAnchor anchor)
 {
     this.parent = parent;
     this.anchor = anchor;
 }
Ejemplo n.º 39
0
 public HSSFPolygon(HSSFShape parent, HSSFAnchor anchor)
     : base(parent, anchor)
 {
 }