I have a diagram where I have to order to tree the knots.
Some knots have the side link and others the superior link and I should get a diagram with this layout:
0
|-----1
|
2
I have the following instead result:
0
|____
| |
2 |---1
how can I succeed in getting a layout that I desire?
I have used this following function:
Public Sub TreeAutoLayout(ByVal doc As GoDocument)
Dim Layout As GoLayoutTree = New GoLayoutTree
Layout.NodeIndent = 44
Layout.Document = doc
Layout.SetsPortSpot = False
Layout.SetsChildPortSpot = False
Layout.Path = GoLayoutTreePath.Destination
Layout.Arrangement = GoLayoutTreeArrangement.Horizontal
Layout.ArrangementOrigin = New PointF(20, 20)
Layout.ArrangementSpacing = New SizeF(50, 50)
Layout.Angle = 90
Layout.BreadthLimit = 0
Layout.LayerSpacing = 50
Layout.NodeSpacing = 20
Layout.RowSpacing = 25
Layout.Compaction = GoLayoutTreeCompaction.Block
Layout.Alignment = GoLayoutTreeAlignment.CenterChildren
Layout.NodeIndent = 0
Layout.Sorting = GoLayoutTreeSorting.Descending
Layout.AlternateDefaults.LayerSpacing = 0
Layout.AlternateDefaults.CopyInheritedPropertiesFrom(Layout.RootDefaults)
Layout.Style = GoLayoutTreeStyle.Layered
Layout.Document.StartTransaction()
Dim obj As GoObject
For Each obj In Layout.Document
If (TypeOf obj Is GoLink) Then
Dim link As GoLink = CType(obj, GoLink)
If Not link Is Nothing Then
link.AdjustingStyle = GoLinkAdjustingStyle.Calculate
End If
End If
Next
Layout.PerformLayout()
Layout.Document.FinishTransaction("tree node")
End Sub