[]
        
(Showing Draft Content)

IShapeRange

Interface IShapeRange

All Superinterfaces:
Iterable<IShape>

public interface IShapeRange extends Iterable<IShape>
Represents a shape range ( IShapeRange), which is a set of shapes on a document.

 IShapes shapes = worksheet.getShapes();
 shapes.addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
 shapes.addShape(AutoShapeType.Oval, 140, 20, 100, 60);
 IShapeRange shapeRange = shapes.getRange(new int[] {0, 1});
 int count = shapeRange.getCount();
 
  • Method Summary

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

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • get

      IShape get(int index)
      Returns a single object from a collection.
      
       IShapes shapes = worksheet.getShapes();
       shapes.addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       shapes.addShape(AutoShapeType.Oval, 140, 20, 100, 60);
       IShapeRange shapeRange = shapes.getRange(new int[] {0, 1});
       IShape firstShape = shapeRange.get(0);
       
      Parameters:
      index - Required int. The index number for the object.
      Returns:
      The IShape object at the specified index; see IShape.
    • get

      IShape get(String index)
      Returns a single object from a collection.
      
       IShapes shapes = worksheet.getShapes();
       IShape rectangle = shapes.addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       rectangle.setName("Rectangle 1");
       IShape oval = shapes.addShape(AutoShapeType.Oval, 140, 20, 100, 60);
       oval.setName("Oval 1");
       IShapeRange shapeRange = shapes.getRange(new String[] {"Rectangle 1", "Oval 1"});
       IShape ovalShape = shapeRange.get("Oval 1");
       
      Parameters:
      index - Required string. The name of the object.
      Returns:
      A single object from a collection.
    • getCount

      int getCount()
      Returns the number of objects in the collection.
      
       IShapes shapes = worksheet.getShapes();
       shapes.addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       shapes.addShape(AutoShapeType.Oval, 140, 20, 100, 60);
       IShapeRange shapeRange = shapes.getRange(new int[] {0, 1});
       int count = shapeRange.getCount();
       
      Returns:
      The number of objects in the collection.
    • group

      IShape group()
      Groups the shapes in the specified range.
      
       IShapes shapes = worksheet.getShapes();
       shapes.addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       shapes.addShape(AutoShapeType.Oval, 140, 20, 100, 60);
       IShapeRange shapeRange = shapes.getRange(new int[] {0, 1});
       IShape groupShape = shapeRange.group();
       
      Returns:
      A Shape object that represents the grouped shape.