### Custom View SeparatorLine

' Custom View Class - SeparatorLine
' A horizontal or vertical separator line used for f.e. a toolbar or statusbar.
' NOTE: Not all Separator API methods are exposed.
' Refs: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Separator.html
' @author Robert W.B. Linn
' @version 20170906
' Set the separator orientation to VERTICAL or HORIZONTAL
DesignerProperty: Key: Orientation, DisplayName: Orientation, FieldType: String, DefaultValue: VERTICAL, LIST: VERTICAL|HORIZONTAL
`Sub Class_Globals
Private fx As JFX
Private mEventName As String 'ignore
Private mCallBack As Object 'ignore
Private mBase As Pane
Private mProps As Map
Private mSeparator As JavaObject
End Sub`
`Public Sub Initialize (Callback As Object, EventName As String)
mEventName = EventName
mCallBack = Callback
End Sub`
`Public Sub DesignerCreateView (Base As Pane, Lbl As Label, Props As Map)
mBase = Base
mProps = Props
mSeparator.InitializeNewInstance("javafx.scene.control.Separator", Array(mProps.Get("Orientation")))
mBase.AddNode(mSeparator, 0, 0, 0, 0)
CSSUtils.SetBorder(mSeparator, 0, fx.Colors.Transparent, 0)
End Sub`
`Private Sub Base_Resize (Width As Double, Height As Double)
mSeparator.RunMethod("setPrefWidth", Array(Width))
mSeparator.RunMethod("setPrefHeight", Array(Height))
End Sub`
`Public Sub GetBase As Pane
Return mBase
End Sub`
`Public Sub setPrefWidth(Width As Double)
mSeparator.RunMethod("setPrefWidth", Array(Width))
End Sub`
`Public Sub getPrefWidth As Double
Return mSeparator.RunMethod("getPrefWidth", Null)
End Sub`
`Public Sub setPrefHeight(Height As Double)
mSeparator.RunMethod("setPrefHeight", Array(Height))
End Sub`
`Public Sub getPrefHeight As Double
Return mSeparator.RunMethod("getPrefHeight", Null)
End Sub`
' Set the seperator orientation to VERTICAL orHORIZONTAL
`Public Sub setOrientation(Orientation As String)
mSeparator.RunMethod("setOrientation", Array(Orientation))
End Sub`
`Public Sub getOrientation As String
Return mSeparator.RunMethod("getOrientation", Null)
End Sub`

Changed: 2018-06-07 09:23, Category: Separator, File: T6C244M1772.htm, ID: 1772