public class GroupShape extends Shape
Example
//Instantiate a new Workbook.
Workbook excelbook = new Workbook();
//Add a group box to the first worksheet.
GroupBox box = excelbook.getWorksheets().get(0).getShapes().addGroupBox(1, 0, 1, 0, 300, 250);
//Set the caption of the group box.
box.setText("Age Groups");
box.setPlacement(PlacementType.FREE_FLOATING);
//Make it 2-D box.
box.setShadow(false);
//Add a radio button.
RadioButton radio1 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(3, 0, 2, 0, 30, 110);
//Set its text string.
radio1.setText("20-29");
//Set A1 cell as a linked cell for the radio button.
radio1.setLinkedCell("A1");
//Make the radio button 3-D.
radio1.setShadow(true);
//Make the line format visible.
radio1.getLine().setFillType(FillType.SOLID);
//Make the fill format visible.
radio1.getFill().setFillType(FillType.SOLID);
//Set the foreground color of the radio button.
radio1.getFill().getSolidFill().setColor(Color.getLightGreen());
//Set the line style of the radio button.
radio1.getLine().setCompoundType(MsoLineStyle.THICK_THIN);
//Set the weight of the radio button.
radio1.getLine().setWeight(4);
//Set the line color of the radio button.
radio1.getLine().getSolidFill().setColor(Color.getBlue());
//Set the dash style of the radio button.
radio1.getLine().setDashStyle(MsoLineDashStyle.SOLID);
//Add another radio button.
RadioButton radio2 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(6, 0, 2, 0, 30, 110);
//Set its text string.
radio2.setText("30-39");
//Set A1 cell as a linked cell for the radio button.
radio2.setLinkedCell("A1");
//Make the radio button 3-D.
radio2.setShadow(true);
//Make the line format visible.
radio2.getLine().setFillType(FillType.SOLID);
//Make the fill format visible.
radio2.getFill().setFillType(FillType.SOLID);
//Set the foreground color of the radio button.
radio2.getFill().getSolidFill().setColor(Color.getLightGreen());
//Set the line style of the radio button.
radio2.getLine().setCompoundType(MsoLineStyle.THICK_THIN);
//Set the weight of the radio button.
radio2.getLine().setWeight(4);
//Set the line color of the radio button.
radio2.getLine().getSolidFill().setColor(Color.getBlue());
//Set the dash style of the radio button.
radio2.getLine().setDashStyle(MsoLineDashStyle.SOLID);
//Add another radio button.
RadioButton radio3 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(9, 0, 2, 0, 30, 110);
//Set its text string.
radio3.setText("40-49");
//Set A1 cell as a linked cell for the radio button.
radio3.setLinkedCell("A1");
//Make the radio button 3-D.
radio3.setShadow(true);
//Make the line format visible.
radio3.getLine().setFillType(FillType.SOLID);
//Make the fill format visible.
radio3.getFill().setFillType(FillType.SOLID);
//Set the foreground color of the radio button.
radio3.getFill().getSolidFill().setColor(Color.getLightGreen());
//Set the line style of the radio button.
radio3.getLine().setCompoundType(MsoLineStyle.THICK_THIN);
//Set the weight of the radio button.
radio3.getLine().setWeight(4);
//Set the line color of the radio button.
radio3.getLine().getSolidFill().setColor(Color.getBlue());
//Set the dash style of the radio button.
radio3.getLine().setDashStyle(MsoLineDashStyle.SOLID);
//Get the shapes.
Shape[] shapeobjects = new Shape[] { box, radio1, radio2, radio3 };
//Group the shapes.
GroupShape group = excelbook.getWorksheets().get(0).getShapes().group(shapeobjects);
//Save the excel file.
excelbook.save("groupshapes.xls");
| Modifier and Type | Method and Description |
|---|---|
Shape |
get(int index)
Gets the child shape by index.
|
Shape[] |
getGroupedShapes()
Gets the shapes grouped by this shape.
|
void |
ungroup()
Ungroups the shape items.
|
addHyperlink, alignTopRightCorner, calculateTextSize, characters, fitToTextSize, formatCharacters, getActiveXControl, getActualBox, getActualLowerRightRow, getAlternativeText, getAnchorType, getAutoShapeType, getBottom, getCharacters, getConnectionPoints, getControlData, getCreateId, getFill, getFillFormat, getFont, getFormatPicture, getGeometry, getGlow, getGroup, getHeight, getHeightCM, getHeightInch, getHeightInShape, getHeightPt, getHeightScale, getHtmlText, getHyperlink, getId, getInputRange, getInputRange, getLeft, getLeftCM, getLeftInch, getLeftInShape, getLeftToCorner, getLine, getLineFormat, getLinkedCell, getLinkedCell, getLockedProperty, getLowerDeltaX, getLowerDeltaY, getLowerRightColumn, getLowerRightRow, getMacroName, getMsoDrawingType, getName, getPaths, getPlacement, getReflection, getRelativeToOriginalPictureSize, getResultOfSmartArt, getRichFormattings, getRight, getRotationAngle, getShadowEffect, getSoftEdges, getSpid, getSpt, getText, getTextBody, getTextBoxOptions, getTextDirection, getTextEffect, getTextHorizontalAlignment, getTextHorizontalOverflow, getTextOptions, getTextOrientationType, getTextShapeType, getTextVerticalAlignment, getTextVerticalOverflow, getThreeDFormat, getTitle, getTop, getTopCM, getTopInch, getTopInShape, getTopToCorner, getType, getUpperDeltaX, getUpperDeltaY, getUpperLeftColumn, getUpperLeftRow, getWidth, getWidthCM, getWidthInch, getWidthInShape, getWidthPt, getWidthScale, getWorksheet, getX, getY, getZOrderPosition, hasLine, isAspectRatioLocked, isDecorative, isEquation, isFilled, isFlippedHorizontally, isFlippedVertically, isGroup, isHidden, isInGroup, isLockAspectRatio, isLocked, isPrintable, isRichText, isSameSetting, isSmartArt, isTextWrapped, isWordArt, moveToRange, removeActiveXControl, removeHyperlink, setAlternativeText, setAnchorType, setAspectRatioLocked, setAutoShapeType, setBottom, setCreateId, setDecorative, setFilled, setFlippedHorizontally, setFlippedVertically, setFont, setHasLine, setHeight, setHeightCM, setHeightInch, setHeightInShape, setHeightPt, setHeightScale, setHidden, setHtmlText, setInputRange, setInputRange, setLeft, setLeftCM, setLeftInch, setLeftInShape, setLeftToCorner, setLinkedCell, setLinkedCell, setLockAspectRatio, setLocked, setLockedProperty, setLowerDeltaX, setLowerDeltaY, setLowerRightColumn, setLowerRightRow, setMacroName, setName, setPlacement, setPrintable, setRelativeToOriginalPictureSize, setRight, setRotationAngle, setSoftEdges, setText, setTextDirection, setTextHorizontalAlignment, setTextHorizontalOverflow, setTextOptions, setTextOrientationType, setTextShapeType, setTextVerticalAlignment, setTextVerticalOverflow, setTextWrapped, setTitle, setTop, setTopCM, setTopInch, setTopInShape, setTopToCorner, setUpperDeltaX, setUpperDeltaY, setUpperLeftColumn, setUpperLeftRow, setWidth, setWidthCM, setWidthInch, setWidthInShape, setWidthPt, setWidthScale, setX, setY, setZOrderPosition, toFrontOrBack, toImage, toImage, toImage, updateSelectedValuepublic Shape get(int index)
index - the child shape index.public void ungroup()
Remarks
If the group shape is grouped by another group shape,nothing will be done.public Shape[] getGroupedShapes()
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.