This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.vb
54 lines (45 loc) · 2.03 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Imports DevExpress.XtraTreeMap
Imports System
Imports System.Windows.Forms
Namespace LayoutAlgorithmCustomization
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
InitializeLayoutAlgorithmListBox()
InitializeLayoutDirectionListBox()
End Sub
Private Sub InitializeLayoutAlgorithmListBox()
lbLayoutAlgorithm.DataSource = New ITreeMapLayoutAlgorithm() { _
New TreeMapSliceAndDiceLayoutAlgorithm(), _
New TreeMapSquarifiedLayoutAlgorithm(), _
New TreeMapStripedLayoutAlgorithm() _
}
End Sub
Private Sub InitializeLayoutDirectionListBox()
lbLayoutDirection.DataSource = System.Enum.GetValues(GetType(TreeMapLayoutDirection))
End Sub
Private Sub SetLayoutAlgorithm()
If lbLayoutAlgorithm.SelectedValue Is Nothing Then
Return
End If
treeMap.LayoutAlgorithm = TryCast(lbLayoutAlgorithm.SelectedValue, ITreeMapLayoutAlgorithm)
End Sub
Private Sub SetLayoutDirection()
If lbLayoutDirection.SelectedValue Is Nothing Then
Return
End If
Dim layoutAlgorithm As TreeMapLayoutAlgorithmBase = TryCast(treeMap.LayoutAlgorithm, TreeMapLayoutAlgorithmBase)
layoutAlgorithm.Direction = CType(lbLayoutDirection.SelectedValue, TreeMapLayoutDirection)
End Sub
Private Sub lbLayoutAlgorithm_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles lbLayoutAlgorithm.SelectedIndexChanged
SetLayoutAlgorithm()
SetLayoutDirection()
End Sub
Private Sub lbLayoutDirection_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles lbLayoutDirection.SelectedIndexChanged
SetLayoutDirection()
End Sub
End Class
End Namespace