com.aspose.slides
Class SmartArt

java.lang.Object
  extended by com.aspose.slides.Shape
      extended by com.aspose.slides.GraphicalObject
          extended by com.aspose.slides.SmartArt
All Implemented Interfaces:
IGraphicalObject, IHyperlinkContainer, IPresentationComponent, IShape, ISlideComponent, ISmartArt

public class SmartArt
extends GraphicalObject
implements ISmartArt

Represents SmartArt object on a slide.


Example:
  
  [C#]
  Presentation pres = new Presentation();
  Slide slide = pres.Slides[0];
  SmartArt smart = slide.Shapes.AddSmartArt(0, 0, 400, 400, SmartArtLayoutType.BasicBlockList);
  
  [Visual Basic]
  Private pres As New Presentation()
  Private slide As Slide = pres.Slides(0)
  Private smart As SmartArt = slide.Shapes.AddSmartArt(0, 0, 400, 400, SmartArtLayoutType.BasicBlockList)
  
  [C#]
  Presentation pres = new Presentation("demo.pptx");
  foreach (Shape shape in pres.Slides[0].Shapes)
             {
                 if (shape is SmartArt)
                  SmartArt smart = (SmartArt) pres.Slides[0].Shapes[0];
             }
  
  [Visual Basic]
  Dim pres As New Presentation("demo.pptx")
  For Each shape As Shape In pres.Slides(0).Shapes
        If TypeOf shape Is SmartArt Then
                Dim smart As SmartArt = DirectCast(pres.Slides(0).Shapes(0), SmartArt)
        End If
  Next  
  


Method Summary
 ISmartArtNodeCollection getAllNodes()
           Returns collections of all nodes in SmartArt object
 int getColorStyle()
           Return or set color style of smart art object
 int getLayout()
           Return layout of smartart object
 int getQuickStyle()
           Return or set quick style of smartart object
 void setColorStyle(int value)
           
 void setQuickStyle(int value)
           
 
Methods inherited from class com.aspose.slides.GraphicalObject
getShapeLock
 
Methods inherited from class com.aspose.slides.Shape
addPlaceholder, createEffectFormatEffective, createFillFormatEffective, createLineFormatEffective, createThreeDFormatEffective, getAlternativeText, getCustomData, getEffectFormat, getFillFormat, getFrame, getHeight, getHidden, getHLinkClick, getHLinkMouseOver, getHyperlinkClick, getHyperlinkManager, getHyperlinkMouseOver, getLineFormat, getName, getParentGroup, getPlaceholder, getPresentation, getRawFrame, getRotation, getSlide, getTags, getThreeDFormat, getThumbnail, getThumbnail, getUniqueId, getWidth, getX, getY, getZOrderPosition, isGrouped, isTextHolder, removePlaceholder, setAlternativeText, setFrame, setHeight, setHidden, setHLinkClick, setHLinkMouseOver, setHyperlinkClick, setHyperlinkMouseOver, setName, setRawFrame, setRotation, setWidth, setX, setY
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aspose.slides.IGraphicalObject
getShapeLock
 
Methods inherited from interface com.aspose.slides.IShape
addPlaceholder, createEffectFormatEffective, createFillFormatEffective, createLineFormatEffective, createThreeDFormatEffective, getAlternativeText, getCustomData, getEffectFormat, getFillFormat, getFrame, getHeight, getHidden, getLineFormat, getName, getParentGroup, getPlaceholder, getRawFrame, getRotation, getThreeDFormat, getThumbnail, getThumbnail, getUniqueId, getWidth, getX, getY, getZOrderPosition, isGrouped, isTextHolder, removePlaceholder, setAlternativeText, setFrame, setHeight, setHidden, setName, setRawFrame, setRotation, setWidth, setX, setY
 
Methods inherited from interface com.aspose.slides.ISlideComponent
getSlide
 
Methods inherited from interface com.aspose.slides.IPresentationComponent
getPresentation
 
Methods inherited from interface com.aspose.slides.IHyperlinkContainer
getHyperlinkClick, getHyperlinkManager, getHyperlinkMouseOver, setHyperlinkClick, setHyperlinkMouseOver
 

Method Detail

getAllNodes

public ISmartArtNodeCollection getAllNodes()

Returns collections of all nodes in SmartArt object


 
 [C#]
 Presentation pres = new Presentation("demo.pptx");
 SmartArt smart = (SmartArt)pres.Slides[0].Shapes[0];
 for ( int i = 0; i < smart.AllNodes.Count; i++)
 {
     SmartArtNode node = smart.AllNodes[i];
     string outString = string.Format("i = {0}, Text = {1},  Level = {2}, Position = {3}", i, node.TextFrame.Text,
     node.Level, node.Position);
     Console.WriteLine(outString);
 }
 
 [Visual Basic]
 Dim pres As New Presentation("demo.pptx")
 Dim smart As SmartArt = DirectCast(pres.Slides(0).Shapes(0), SmartArt)
 Dim i As Integer = 0
 While i < smart.AllNodes.Count
 Dim node As SmartArtNode = smart.AllNodes(i)
 Dim outString As String = String.Format("i = {0}, Text = {1},  Level = {2}, Position = {3}", i, node.TextFrame.Text, node.Level, node.Position)
 Console.WriteLine(outString)
 System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
 End While
 

Specified by:
getAllNodes in interface ISmartArt

getLayout

public int getLayout()

Return layout of smartart object


 
 [C#]
 Presentation pres = new Presentation("demo.pptx");
 foreach (Shape shape in pres.Slides[0].Shapes)
            {
                if (shape is SmartArt)
                 {
                     SmartArt smart = (SmartArt) pres.Slides[0].Shapes[0];
                     if (smart.Layout == SmartArtLayoutType.BasicBlockList)
                     {...do something }
                 }
            }
 
 [Visual Basic]
 Dim pres As New Presentation("demo.pptx")
 For Each shape As Shape In pres.Slides(0).Shapes
        If TypeOf shape Is SmartArt Then
     Dim smart As SmartArt = DirectCast(pres.Slides(0).Shapes(0), SmartArt)
         If smart.Layout = SmartArtLayoutType.BasicBlockList Then
            ...do something
         End If
        End If
 Next
 

Specified by:
getLayout in interface ISmartArt

getQuickStyle

public int getQuickStyle()

Return or set quick style of smartart object


 
 [C#]
 Presentation pres = new Presentation("demo.pptx");
 foreach (Shape shape in pres.Slides[0].Shapes)
            {
                if (shape is SmartArt)
                 {
                     SmartArt smart = (SmartArt) pres.Slides[0].Shapes[0];
                     if (smart.QuickStyle == SmartArtQuickStyleType.BirdsEyeScene)
                     {smart.QuickStyle = SmartArtQuickStyleType.Cartoon;}
                 }
            }
 
 [Visual Basic]
 Dim pres As New Presentation("demo.pptx")
 For Each shape As Shape In pres.Slides(0).Shapes
        If TypeOf shape Is SmartArt Then
         Dim smart As SmartArt = DirectCast(pres.Slides(0).Shapes(0), SmartArt)
         If smart.QuickStyle = SmartArtQuickStyleType.BirdsEyeScene Then
            smart.QuickStyle = SmartArtQuickStyleType.Cartoon
         End If
        End If
 Next   
 

Specified by:
getQuickStyle in interface ISmartArt

setQuickStyle

public void setQuickStyle(int value)
Specified by:
setQuickStyle in interface ISmartArt

getColorStyle

public int getColorStyle()

Return or set color style of smart art object


 
 [C#]
 Presentation pres = new Presentation("demo.pptx");
 foreach (Shape shape in pres.Slides[0].Shapes)
            {
                if (shape is SmartArt)
                {
                     SmartArt smart = (SmartArt) pres.Slides[0].Shapes[0];
                     if (smart.ColorStyle == SmartArtColorType.ColoredFillAccent1)
                     {smart.ColorStyle =SmartArtColorType.TransparentGradientRangeAccent1;}
                }
            }
 
 [Visual Basic]
 Dim pres As New Presentation("demo.pptx")
 For Each shape As Shape In pres.Slides(0).Shapes
        If TypeOf shape Is SmartArt Then
                Dim smart As SmartArt = DirectCast(pres.Slides(0).Shapes(0), SmartArt)
                If smart.ColorStyle = SmartArtColorType.ColoredFillAccent1 Then
                smart.ColorStyle = SmartArtColorType.TransparentGradientRangeAccent1
                End If
        End If
 Next
 

Specified by:
getColorStyle in interface ISmartArt

setColorStyle

public void setColorStyle(int value)
Specified by:
setColorStyle in interface ISmartArt