fun draw(x: Double = 10.0, y: Double = 10.0, gc: GraphicsContext) : Box{ xPos = x yPos = y with(gc) { textBaseline = VPos.TOP strokeRoundRect(x, y, textLength + 6, textfield.layoutBounds.height + 6, 10.0, 10.0) fillText(textfield.text, x + 3, y + 3) } return this } fun connect(gc: GraphicsContext) : Box{ with (gc) { if (connectTo != null) { beginPath() moveTo(xPos + (textLength + 6) / 2, yPos) lineTo(connectTo.connectPoint().first, connectTo.connectPoint().second) stroke() } } return this