Konvertieren Sie die SmartArt in eine Gruppenform
Mögliche Verwendungsszenarien
Sie können eine SmartArt-Form in eine Gruppenform mit der Methode Shape.getResultOfSmartArt() umwandeln. Dadurch können Sie die SmartArt-Form wie eine Gruppenform behandeln. Somit haben Sie Zugriff auf die einzelnen Teile oder Formen der Gruppenform.
Konvertieren des SmartArt in Gruppenform
Der folgende Beispielcode lädt die Beispiel-Excel-Datei mit einer SmartArt-Form, wie in diesem Screenshot gezeigt. Anschließend wird die SmartArt-Form in eine Gruppenform konvertiert und die Eigenschaft Shape.IsGroup ausgegeben. Bitte beachten Sie die Konsolenausgabe des untenstehenden Beispielcodes.
Beispielcode
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
//Load the sample smart art shape - Excel file | |
Workbook wb = new Workbook("sampleSmartArtShape_GetResultOfSmartArt.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
//Access first shape | |
Shape sh = ws.getShapes().get(0); | |
//Determine if shape is smart art | |
System.out.println("Is Smart Art Shape: " + sh.isSmartArt()); | |
//Determine if shape is group shape | |
System.out.println("Is Group Shape: " + sh.isGroup()); | |
//Convert smart art shape into group shape | |
System.out.println("Is Group Shape: " + sh.getResultOfSmartArt().isGroup()); |
Konsolenausgabe
Is Smart Art Shape: true
Is Group Shape: false
Is Group Shape: true