Namespace EasyXLS.Drawings

Class DrawingObject

System.Object
EasyXLS.Drawings.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 Summary

    Constructors
    Constructor
    Description
    Defines an instance of the drawing shape.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the height of the drawing object.
    int
    Returns the horizontal offset of the drawing object
    double
    Internal use only
    double
    Internal use only
    double
    Internal use only
    double
    Internal use only
    int
    Returns the vertical offset of the drawing object
    int
    Returns the width of the drawing object.
    void
    setLeftUpperOffset​(int horizontalOffset, int verticalOffset)
    Sets the left upper corner offsets of the drawing object.
    void
    setRelativeLeftUpperOffset​(double horizontalOffset, double verticalOffset)
    Internal use only
    void
    setRelativeSize​(double width, double height)
    Internal use only
    void
    setSize​(int width, int height)
    Sets the drawing object size.

    Methods inherited from class System.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DrawingObject

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

    • 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
      Parameters:
      horizontalOffset - represents the distance from the left margin of the chart to the left border of the object, relative to chart area width
      verticalOffset - represents the distance from the left margin of the chart to the top border of the object, relative to chart area width
    • 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
      Returns:
      the distance from the left margin of the chart to the left border of the object, relative to chart area width
    • 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
      Returns:
      the distance from the left margin of the chart to the top border of the object, relative to chart area width
    • 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
      Parameters:
      width - the object relative width
      height - the object relative height
    • getHeight

      public int getHeight()
      Returns the height of the drawing object.
      Returns:
      the height of the drawing object.
      See Also:
      setSize(int, int), setLeftUpperOffset(int, int), getWidth()
    • getRelativeHeight

      public double getRelativeHeight()
      Internal use only
      Returns:
      the object relative height
    • getWidth

      public int getWidth()
      Returns the width of the drawing object.
      Returns:
      the width of the drawing object.
      See Also:
      setSize(int, int), setLeftUpperOffset(int, int), getHeight()
    • getRelativeWidth

      public double getRelativeWidth()
      Internal use only
      Returns:
      the object relative width