This doesn't solve your problem, but since you are working with Kotlin I would suggest a Kotlin DSL.
Instead of a fluent API you would have something like this:
panel {
size = Size(10, 10)
position = Point(5, 5)
wrapBox {
shadow = true
title = "Test"
type = BoxType.SINGLE
}
}