[]
        
(Showing Draft Content)

IGroupShapes

Interface IGroupShapes

All Superinterfaces:
Iterable<IShape>

public interface IGroupShapes extends Iterable<IShape>
Represents the individual shapes within a grouped shape.

Use this collection to inspect or retrieve the shapes that belong to a grouped shape returned by IShape.getGroupItems().


 IShape rectangle = worksheet.getShapes().addShape("rectangle", AutoShapeType.Rectangle, 20, 20, 80, 50);
 IShape oval = worksheet.getShapes().addShape("oval", AutoShapeType.Oval, 40, 40, 80, 50);
 IShape groupShape = worksheet.getShapes().getRange(new int[] {0, 1}).group();
 IGroupShapes groupItems = groupShape.getGroupItems();
 int count = groupItems.getCount();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int index)
    Returns a single object from a collection.
    get(String name)
    Returns a single object from a collection.
    int
    Returns the number of objects in the collection.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • getCount

      int getCount()
      Returns the number of objects in the collection.

      This method returns the number of shapes contained in an IGroupShapes collection obtained from a grouped shape, such as through IShape.getGroupItems().

      
       IShape shape1 = worksheet.getShapes().addShape("shape1", AutoShapeType.Rectangle, 20, 20, 60, 40);
       IShape shape2 = worksheet.getShapes().addShape("shape2", AutoShapeType.Oval, 100, 20, 60, 40);
       IShape groupShape = worksheet.getShapes().getRange(new String[] {"shape1", "shape2"}).group();
       int count = groupShape.getGroupItems().getCount();
       
      Returns:
      The number of objects in the collection.
    • get

      IShape get(int index)
      Returns a single object from a collection.

      Gets the grouped shape item at the specified zero-based index.

      
       IShape rectangle = worksheet.getShapes().addShape("rectangle", AutoShapeType.Rectangle, 20, 20, 80, 50);
       IShape oval = worksheet.getShapes().addShape("oval", AutoShapeType.Oval, 40, 40, 80, 50);
       IShape groupShape = worksheet.getShapes().getRange(new int[] {0, 1}).group();
       IShape firstShape = groupShape.getGroupItems().get(0);
       
      Parameters:
      index - The index number for the object.
      Returns:
      The IShape object at the specified index.
    • get

      IShape get(String name)
      Returns a single object from a collection.

      Gets the grouped shape item whose name matches the specified value.

      
       IShape rectangle = worksheet.getShapes().addShape("rectangle", AutoShapeType.Rectangle, 20, 20, 80, 50);
       IShape oval = worksheet.getShapes().addShape("oval", AutoShapeType.Oval, 40, 40, 80, 50);
       IShape groupShape = worksheet.getShapes().getRange(new int[] {0, 1}).group();
       IShape shape = groupShape.getGroupItems().get("oval");
       
      Parameters:
      name - The name for the object. This value identifies a shape within the grouped shape collection.
      Returns:
      The IShape object with the specified name, or null if no matching shape is found.