Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram("AddingNewShape.vsdx"); // get page by name page = diagram.getPages().getPage("Page-3"); for (it = page.getShapes().iterator(); it.hasNext();) { shape = it.next(); if (shape.getName() == "Process1") { for (prop_it = shape.getProps().iterator(); prop_it.hasNext();) { prop = prop_it.next(); console.log(prop.getLabel().getValue() + ": " + prop.getValue().getVal()); } break; } }
Property Getters/Setters Summary | ||
---|---|---|
function | getCount() | |
Gets the number of elements actually contained in the collection. | ||
function | get(index) | |
Gets the element at the specified index. |
Method Summary | ||
---|---|---|
function | add(item) | |
Add the shape in the collection. | ||
function | clear() | → inherited from Collection |
Removes all elements from collection. | ||
function | getShape(name) | |
Gets the element at the specified name. | ||
function | getShape(ID) | |
Gets the element at the specified ID. | ||
function | group(groupItems) | |
Group the shapes. | ||
function | isExist(index) | → inherited from Collection |
Is exist item in the collection. | ||
function | iterator() | → inherited from Collection |
Supports a simple iteration over a nongeneric collection. | ||
function | remove(item) | |
Remove the shape from the collection. |
Property Getters/Setters Detail |
---|
getCount : Number | |
function getCount() |
get : Shape | |
function get(index) |
index
- Method Detail |
---|
add | |
function add(item) |
item: Shape
- remove | |
function remove(item) |
item: Shape
- Shapegroup | |
function group(groupItems) |
groupItems: Shape[]
- the group items.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);
getShape | |
function getShape(name) |
name: String
- getShape | |
function getShape(ID) |
ID: long
- iterator | |
function iterator() |
isExist | |
function isExist(index) |
index: Number
- index of element.clear | |
function clear() |