' Top Anchorpane Height used to set min / max position of the splitpane divider
Sub apTop_Resize (Width As Double, Height As Double)
Dim MinDividerPos As Double = 0.25
Dim MaxDividerPos As Double = 0.75
Dim dp As Double = getDividerPosition(split1, 0)
If dp <= MinDividerPos Then setDividerPosition(split1, 0, MinDividerPos)
If dp >= MaxDividerPos Then setDividerPosition(split1, 0, MaxDividerPos)
End Sub
'
' SECTION: SPLITPANE DIVIDER
' See http://docs.oracle.com/javafx/2/api/javafx/scene/control/SplitPane.html#getDividerPositions()
'
' Sets the position of the divider for a splitpane
' Parameter SplitPane: The SplitPane
' Parameter Index: The index of the Divider. Starting with 0
' Parameter Position: The position of the divider to be between range 0 to 1
Sub setDividerPosition(Split As Node, DividerIndex As Int, Position As Double)
Dim jo As JavaObject = Split
jo.RunMethod("setDividerPosition", Array As Object(DividerIndex, Position))
End Sub
' Gets the position of the divider for a splitpane
' Parameter Split: The SplitPane
' Parameter Index: Index of the Divider
' Return: Position of the Divider range 0 to 1
Sub getDividerPosition(Split As Node, DividerIndex As Int) As Double
Dim jo As JavaObject = Split
Dim dp() As Double
dp = jo.RunMethod("getDividerPositions", Null)
If (DividerIndex < 0) OR (DividerIndex > dp.Length) Then Return -1
Return dp(DividerIndex)
End Sub