, , UX, . , , , :
private val DEF_PAD = 6.0
chart.paddingProperty.bind(boundValue(stage.widthProperty, stage.heightProperty) {
val w = stage.getWidth
val h = stage.getHeight
val extra = DEF_PAD + 0.5 * Math.abs(w - h)
if (w > h) {
new Insets(DEF_PAD, extra, DEF_PAD, extra)
} else if (h > w) {
new Insets(extra, DEF_PAD, extra, DEF_PAD)
} else {
new Insets(DEF_PAD)
}
})
( Scala. boundValue - , varargs)