<%@ jet package="cruise.ui.jfx.templates.impl" imports="java.util.* cruise.model.abstractObjects.BackingObject cruise.umple.compiler.* cruise.ui.jfx.* " class="IntegerBox" skeleton="../jfx.skeleton" %> <% String preffix=JFXProvider.properties.getProperty(cruise.model.Constants.PACKAGE_PREFIX); %> package <%=preffix%>.components; import javafx.scene.control.TextBox; import javafx.animation.Timeline; public class IntegerBox extends TextBox { def pValidate = java.util.regex.Pattern.compile('^\\d*$'); override function replaceSelection(repl) { def m = pValidate.matcher(repl); if (m.find()) { super.replaceSelection(repl); } else { Timeline { keyFrames: [ at(0s) { super.opacity => 1.0 } at(200ms) { super.opacity => 0.0 } at(500ms) { super.opacity => 1.0 } ] }.play(); } } }