Methods

add(item) → Number

Add the shape in the collection.

Parameter

Name Type Optional Description

item

Shape

 

Returns

Number ID

clear()

Removes all elements from collection.

get(index) → Shape

Gets the element at the specified index.

Parameter

Name Type Optional Description

index

Number

 

Returns

Shape 

getCount()

Gets the number of elements actually contained in the collection.

getShape(name) → Shape

Gets the element at the specified name.

Parameter

Name Type Optional Description

name

String

 

Returns

Shape 

getShape(ID) → Shape

Gets the element at the specified ID.

Parameter

Name Type Optional Description

ID

long

 

Returns

Shape 

getShapeIncludingChild(name) → Shape

Gets the element including it's child shape at the specified name.

Parameter

Name Type Optional Description

name

String

 

Returns

Shape 

getShapeIncludingChild(name) → Shape

Gets the element including it's child shape at the specified id.

Parameter

Name Type Optional Description

name

 

 

Returns

Shape 

group(groupItems) → Shape

Group the shapes. The shape in the groupItems should not be grouped. The shape must be in this Shapes collection.

Example

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
var java = require("java");
diagram = new aspose.diagram.Diagram("GroupShapes.vsdx");
// get page by name
page = diagram.getPages().getPage("Page-3");
ss = new Array(3);
// extract and assign shapes to the array
ss[0] = page.getShapes().getShape(15);
ss[1] = page.getShapes().getShape(16);
ss[2] = page.getShapes().getShape(17);
// Initialize an array of shapes
jss = java.newArray('com.aspose.diagram.Shape', ss);
// mark array shapes as group
page.getShapes().group(jss);
diagram.save("out-GroupShapes.vsdx", aspose.diagram.SaveFileFormat.VSDX);

Parameter

Name Type Optional Description

groupItems

Array of Shape

 

the group items.

Returns

Shape Return the group shape.

isExist(index) → boolean

Is exist item in the collection.

Parameter

Name Type Optional Description

index

Number

 

index of element.

Returns

boolean 

iterator() → Iterator

Supports a simple iteration over a nongeneric collection.

Returns

Iterator 

remove(item)

Remove the shape from the collection.

Parameter

Name Type Optional Description

item

Shape

 

Shape

removeDependsOn(item)

Remove the shapes including DEPENDSON shapes from the collection.

Parameter

Name Type Optional Description

item

Shape

 

Shape