Package com.aspose.slides

Examples of com.aspose.slides.SmartArt


      // Check if shape is of SmartArt type
      if (shape instanceof SmartArt)
      {
        // Typecast shape to SmartArt
        SmartArt smart = (SmartArt) shape;

        if (smart.getAllNodes().getCount() > 0)
        {
          // Accessing SmartArt node at index 0
          ISmartArtNode node = smart.getAllNodes().get_Item(0);

          if (node.getChildNodes().getCount() >= 2)
          {
            // Removing the child node at position 1
            ((SmartArtNodeCollection) node.getChildNodes())
View Full Code Here


      // Check if shape is of SmartArt type
      if (shape instanceof SmartArt)
      {

        // Typecast shape to SmartArt
        SmartArt smart = (SmartArt) shape;

        // Adding a new SmartArt Node
        SmartArtNode TemNode = (SmartArtNode) smart.getAllNodes().addNode();

        // Adding text
        TemNode.getTextFrame().setText("Test");

        // Adding new child node in parent node. It will be added in the end of collection
        SmartArtNode newNode = (SmartArtNode) TemNode.getChildNodes().addNode();

        // Adding text
        newNode.getTextFrame().setText("New Node Added");
      }
    }

    // Saving Presentation
    pres.save("data/AsposeAddSmartArtNode.pptx", SaveFormat.Pptx);
   
    //=========================================
    // Adding Smart Art to Specific Location
    //=========================================
   
    //Creating a presentation instance                                                                      
      Presentation pres1 = new Presentation();
                                                                                                              
      //Access the presentation slide                                                                         
      ISlide slide = pres1.getSlides().get_Item(0);                                                            
                                                                                                              
      //Add Smart Art IShape                                                                                  
      ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.StackedList);        
                                                                                                              
      //Accessing the SmartArt node at index 0                                                                
      ISmartArtNode node = smart.getAllNodes().get_Item(0);                                                   
                                                                                                              
      //Adding new child node at position 2 in parent node                                                    
      SmartArtNode chNode = (SmartArtNode)((SmartArtNodeCollection)node.getChildNodes()).addNodeByPosition(2);
                                                                                                              
      //Add Text                                                                                              
View Full Code Here

TOP

Related Classes of com.aspose.slides.SmartArt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.