com.aspose.slides
Class SmartArtNode

java.lang.Object
  extended by com.aspose.slides.SmartArtNode
All Implemented Interfaces:
ISmartArtNode

public class SmartArtNode
extends java.lang.Object
implements ISmartArtNode

Represents node of SmartArt object


Method Summary
 IFillFormat getBulletFillFormat()
           Returns the FillFormat object that contains fill formatting properties for a node bullet Read-only FillFormat.
 ISmartArtNodeCollection getChildNodes()
           Returns collections of all child nodes of the current node Read-only SmartArtNodeCollection.
 int getLevel()
           Nesting level of node Read-only int
 int getPosition()
           Zero-based position of node among sibling nodes.
 ITextFrame getTextFrame()
           Return or set text of the SmartArt node.
 boolean isAssistant()
           Return or set node as assistant.
 boolean remove()
           Remove current node.
 void setAssistant(boolean value)
           
 void setPosition(int value)
           
 void setTextFrame(ITextFrame value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getChildNodes

public ISmartArtNodeCollection getChildNodes()

Returns collections of all child nodes of the current node Read-only SmartArtNodeCollection.


 
 [C#]
 Presentation pres = new Presentation("demo.pptx");
 SmartArt smart = (SmartArt)pres.Slides[0].Shapes[0];
 SmartArtNode node0 = smart.AllNodes[0];
 for ( int i = 0; i < node0.ChildNodes.Count; i++)
 {
     SmartArtNode node = node0.ChildNodes[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 node0 As SmartArtNode = smart.AllNodes(0);
 Dim i As Integer = 0
 While i < node0.ChildNodes.Count
 Dim node As SmartArtNode = node0.ChildNodes(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:
getChildNodes in interface ISmartArtNode

getTextFrame

public ITextFrame getTextFrame()

Return or set text of the SmartArt node. Read/write TextFrame


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

Specified by:
getTextFrame in interface ISmartArtNode

setTextFrame

public void setTextFrame(ITextFrame value)
Specified by:
setTextFrame in interface ISmartArtNode

isAssistant

public boolean isAssistant()

Return or set node as assistant. Read/write bool


 
 [C#]
 Presentation pres = new Presentation();
 Slide slide = pres.Slides[0];
 SmartArt smart = slide.Shapes.AddSmartArt(0, 0, 400, 400, SmartArtLayoutTypeEx.Hierarchy);
 foreach (SmartArtNode node in smart.AllNodes)
 {
       if (node.IsAssistant) node.IsAssistant = false;
 }
 
 [Visual Basic]
 Dim pres As New Presentation()
 Dim slide As SlideE = pres.Slides(0)
 Dim smart As SmartArt = slide.Shapes.AddSmartArt(0, 0, 400, 400, SmartArtLayoutTypeEx.Hierarchy)
 For Each node As SmartArtNode In smart.AllNodes
        If node.IsAssistant Then
        node.IsAssistant = False
        End If
 Next   
 

Specified by:
isAssistant in interface ISmartArtNode

setAssistant

public void setAssistant(boolean value)
Specified by:
setAssistant in interface ISmartArtNode

getLevel

public int getLevel()

Nesting level of node Read-only int


  
  [C#]
  Presentation pres = new Presentation("demo.pptx");
  SmartArt smart = (SmartArt)pres.Slides[0].Shapes[0];
  for ( int i = 0; i < smart.AllNodes.Count; i++)
  {
     if (smart.AllNodes[i].Level == 2)
     Console.WriteLine(smart.AllNodes[i].Level + " " + smart.AllNodes[i].TextFrame.Text);
  }
  
  [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
        If smart.AllNodes(i).Level = 2 Then
        Console.WriteLine(smart.AllNodes(i).Level + " " + smart.AllNodes(i).TextFrame.Text)
        End If
        System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
  End While
  

Specified by:
getLevel in interface ISmartArtNode

getBulletFillFormat

public IFillFormat getBulletFillFormat()

Returns the FillFormat object that contains fill formatting properties for a node bullet Read-only FillFormat. Note: can return null for certain types of SmartArt layout which does not provide bullets for nodes

Specified by:
getBulletFillFormat in interface ISmartArtNode

getPosition

public int getPosition()

Zero-based position of node among sibling nodes. Read/write int


 
 [C#]
 Presentation pres = new Presentation("demo.pptx");
 SmartArt smart = (SmartArt)pres.Slides[0].Shapes[0];
 SmartArtNode node = smart.AllNodes[0];
 if (node.ChildNodes.Count > 3)
     node.ChildNodes[0].Position = node.ChildNodes[0].Position + 1;
 
 [Visual Basic]
 Dim pres As New Presentation("demo.pptx")
 Dim smart As SmartArt = DirectCast(pres.Slides(0).Shapes(0), SmartArt)
 Dim node As SmartArtNode = smart.AllNodes(0)
 If node.ChildNodes.Count > 3 Then
        node.ChildNodes(0).Position = node.ChildNodes(0).Position + 1
 End If 
 

Specified by:
getPosition in interface ISmartArtNode
Throws:
com.aspose.ms.System.ArgumentOutOfRangeException - value is less than 0. -or- value is equal to or greater than siblings count

setPosition

public void setPosition(int value)
Specified by:
setPosition in interface ISmartArtNode

remove

public boolean remove()

Remove current node.


 
 Presentation pres = new Presentation("demo.pptx");
 SmartArt smart = (SmartArt)pres.Slides[0].Shapes[0];
 SmartArtNode node = smart.AllNodes[0];
 node.Remove();
 
 [Visual Basic]
 Dim pres As New Presentation("demo.pptx")
 Dim smart As SmartArt = DirectCast(pres.Slides(0).Shapes(0), SmartArt)
 Dim node As SmartArtNode = smart.AllNodes(0)
 node.Remove()
 

Specified by:
remove in interface ISmartArtNode
Returns:
True if removed succesfully, otherwise false