<%@ jet package="cruise.ui.jfx.templates.impl" imports="java.util.* cruise.model.abstractObjects.BackingObject cruise.umple.compiler.* cruise.ui.jfx.* " class="BorderPanel" skeleton="../jfx.skeleton" %> package jfx.components; import javafx.scene.Node; import javafx.scene.CustomNode; import javafx.scene.shape.Rectangle; import javafx.scene.layout.Panel; import javafx.scene.shape.ShapeSubtract; import javafx.scene.paint.Color; public class BorderPanel extends CustomNode{ var panel:Panel; public var content:Node[]; var border:ShapeSubtract; public var borderWidth; public var layoutPadding; public var borderColor:Color; override public function create():Node { return panel = Panel { content: bind [border, content] onLayout: function() { for (c in content) { c.layoutX = borderWidth + layoutPadding; c.layoutY = borderWidth + layoutPadding; } updateBorder(); } } } function updateBorder() { var width = panel.width + borderWidth * 2 + layoutPadding * 2; var height = panel.height + borderWidth * 2 + layoutPadding * 2; var rect = Rectangle { width: width height: height arcWidth: 10 arcHeight: 10 } var innerRect = Rectangle { width: width - borderWidth * 2 height: height - borderWidth * 2 x: borderWidth y: borderWidth arcWidth: 10 arcHeight: 10 } border = ShapeSubtract { fill: borderColor a: rect b: innerRect effect: effect } } }