/// <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; } }
/// <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; }
/** * 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); shape.Anchor = anchor; AddShape(shape); return(shape); }
/** * 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); }
/// <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 = ""; }
/// <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 = ""; }
/// <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; }
/// <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) { }
/// <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); }
public HSSFPolygon(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { }
/** * 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; }
/// <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); }
/// <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) { }
public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor):base(parent, anchor) { }
/** * 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); shape.Anchor = anchor; AddShape(shape); return shape; }
public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor) : base(parent, anchor) { }