[]
        
(Showing Draft Content)

IContainer

Interface IContainer

All Known Subinterfaces:
IBackgroundPicture, IShape

public interface IContainer
Represents a floating container in a worksheet drawing layer.

This interface defines the common position and size members for floating objects such as shapes, charts, and pictures. It provides coordinates and dimensions in worksheet units through methods such as getTop(), getLeft(), getWidth(), and getHeight(), and also provides pixel-based variants for the same measurements.

Objects that implement IContainer are typically obtained from drawing APIs that return related interfaces such as IShape.


 IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
 container.setTop(40);
 container.setLeft(50);
 double width = container.getWidth();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the height of the object.
    double
    Gets the height (in pixels) of the object.
    double
    Gets the distance from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
    double
    Gets the distance (in pixels) from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
    double
    Gets the distance from the top edge of the object to the top edge of the worksheet.
    double
    Gets the distance (in pixels) from the top edge of the object to the top edge of the worksheet.
    double
    Gets the width of the object.
    double
    Gets the width (in pixels) of the object.
    void
    setHeight(double value)
    Sets the height of the object.
    void
    setHeightInPixel(double value)
    Sets the height (in pixels) of the object.
    void
    setLeft(double value)
    Sets the distance from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
    void
    setLeftInPixel(double value)
    Sets the distance (in pixels) from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
    void
    setTop(double value)
    Sets the distance from the top edge of the object to the top edge of the worksheet.
    void
    setTopInPixel(double value)
    Sets the distance (in pixels) from the top edge of the object to the top edge of the worksheet.
    void
    setWidth(double value)
    Sets the width of the object.
    void
    setWidthInPixel(double value)
    Sets the width (in pixels) of the object.
  • Method Details

    • getTop

      double getTop()
      Gets the distance from the top edge of the object to the top edge of the worksheet.
      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       double top = container.getTop();
       
      Returns:
      The distance from the top edge of the object to the top edge of the worksheet.
    • setTop

      void setTop(double value)
      Sets the distance from the top edge of the object to the top edge of the worksheet.
      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       container.setTop(100.0);
       
      Parameters:
      value - The distance from the top edge of the object to the top edge of the worksheet.
    • getLeft

      double getLeft()
      Gets the distance from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       double left = container.getLeft();
       
      Returns:
      The distance from the left edge of the object to the left edge of column A(on a worksheet) or the left edge of the chart area (on a chart).
    • setLeft

      void setLeft(double value)
      Sets the distance from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       container.setLeft(100.0);
       
      Parameters:
      value - The distance from the left edge of the object to the left edge of column A(on a worksheet) or the left edge of the chart area (on a chart).
    • getWidth

      double getWidth()
      Gets the width of the object.

      This value is measured in worksheet units. Use getWidthInPixel() to retrieve the width in pixels.

      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       double width = container.getWidth();
       
      Returns:
      The width of the object.
    • setWidth

      void setWidth(double value)
      Sets the width of the object.

      This value is measured in worksheet units. Use getWidthInPixel() to retrieve the width in pixels.

      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       container.setWidth(100.0);
       
      Parameters:
      value - The width of the object.
    • getHeight

      double getHeight()
      Gets the height of the object.

      This value is measured in worksheet units. Use getHeightInPixel() to retrieve the height in pixels.

      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       double height = container.getHeight();
       
      Returns:
      The height of the object.
    • setHeight

      void setHeight(double value)
      Sets the height of the object.

      This value is measured in worksheet units. Use getHeightInPixel() to retrieve the height in pixels.

      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       container.setHeight(100.0);
       
      Parameters:
      value - The height of the object.
    • getTopInPixel

      double getTopInPixel()
      Gets the distance (in pixels) from the top edge of the object to the top edge of the worksheet.
      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       double top = container.getTopInPixel();
       
      Returns:
      The distance (in pixels) from the top edge of the object to the top edge of the worksheet.
    • setTopInPixel

      void setTopInPixel(double value)
      Sets the distance (in pixels) from the top edge of the object to the top edge of the worksheet.
      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       container.setTopInPixel(100.0);
       
      Parameters:
      value - The distance (in pixels) from the top edge of the object to the top edge of the worksheet.
    • getLeftInPixel

      double getLeftInPixel()
      Gets the distance (in pixels) from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       double left = container.getLeftInPixel();
       
      Returns:
      The distance, in pixels, from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
    • setLeftInPixel

      void setLeftInPixel(double value)
      Sets the distance (in pixels) from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       container.setLeftInPixel(100.0);
       
      Parameters:
      value - The distance, in pixels, from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
    • getWidthInPixel

      double getWidthInPixel()
      Gets the width (in pixels) of the object.

      Use this method to retrieve the pixel-based width of a floating object such as a shape, chart, or picture.

      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       double width = container.getWidthInPixel();
       
      Returns:
      The width of the object, in pixels.
    • setWidthInPixel

      void setWidthInPixel(double value)
      Sets the width (in pixels) of the object.

      Use this method to set the pixel-based width of a floating object such as a shape, chart, or picture.

      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       container.setWidthInPixel(100.0);
       
      Parameters:
      value - The width of the object, in pixels.
    • getHeightInPixel

      double getHeightInPixel()
      Gets the height (in pixels) of the object.

      Use this method to retrieve the pixel-based height of a floating object such as a shape, chart, or picture.

      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       double height = container.getHeightInPixel();
       
      Returns:
      The height of the object, in pixels.
    • setHeightInPixel

      void setHeightInPixel(double value)
      Sets the height (in pixels) of the object.

      Use this method to set the pixel-based height of a floating object such as a shape, chart, or picture.

      
       IContainer container = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 30, 120, 60);
       container.setHeightInPixel(100.0);
       
      Parameters:
      value - The height of the object, in pixels.