Namespace EasyXLS.Drawings

Class DrawingObject

  • Direct Known Subclasses:
    LineDrawingObject

    public class DrawingObject
    extends System.Object
    A drawing is a graphical object that can be included inside an Excel document, like shapes, images, textboxes, comments, charts and chart elements. This class stores the drawing shape.
    • Constructor Detail

      • DrawingObject

        public DrawingObject()
        Defines an instance of the drawing shape.
    • Method Detail

      • setLeftUpperOffset

        public void setLeftUpperOffset​(int horizontalOffset,
                                       int verticalOffset)
        Sets the left upper corner offsets of the drawing object.
        Parameters:
        horizontalOffset - represents the distance from the left border of the cell to the left border of the object if the object is added to an ExcelWorksheet; if it is added to an ExcelChartSheet object, it will be the distance from the left margin of the chart to the left border of the object
        verticalOffset - represents the distance from the top border of the cell to the top border of the object if the object is added to an ExcelWorksheet; if it is added to an ExcelChartSheet object, it will be the distance from the left margin of the chart to the top border of the object
        See Also:
        setSize(int, int)
      • setRelativeLeftUpperOffset

        public void setRelativeLeftUpperOffset​(double horizontalOffset,
                                               double verticalOffset)
        Internal use only
      • getHorizontalOffset

        public int getHorizontalOffset()
        Returns the horizontal offset of the drawing object
        Returns:
        the distance - in pixels - from the left border of the cell to the left border of the object if the object is added to an ExcelWorksheet; if it is added to an ExcelChartSheet object, it returns the distance from the left margin of the chart to the left border of the object
        See Also:
        setLeftUpperOffset(int, int), setSize(int, int), getVerticalOffset()
      • getRelativeHorizontalOffset

        public double getRelativeHorizontalOffset()
        Internal use only
      • getVerticalOffset

        public int getVerticalOffset()
        Returns the vertical offset of the drawing object
        Returns:
        the distance - in pixels - from the top border of the cell to the top border of the object if the object is added to an ExcelWorksheet; if it is added to an ExcelChartSheet object, it returns the distance from the left margin of the chart to the top border of the object
        See Also:
        setLeftUpperOffset(int, int), setSize(int, int), getHorizontalOffset()
      • getRelativeVerticalOffset

        public double getRelativeVerticalOffset()
        Internal use only
      • setSize

        public void setSize​(int width,
                            int height)
        Sets the drawing object size.
        Parameters:
        width - the object width
        height - the object height
        See Also:
        setLeftUpperOffset(int, int)
      • setRelativeSize

        public void setRelativeSize​(double width,
                                    double height)
        Internal use only
      • getRelativeHeight

        public double getRelativeHeight()
        Internal use only
      • getRelativeWidth

        public double getRelativeWidth()
        Internal use only