package org.coffeejolts.jfx.gui; import javafx.ui.*; import javafx.ui.canvas.*; import java.lang.System; public class ClockUI extends CompositeNode { public attribute ticking: Boolean; } operation ClockUI.composeNode() { var t = JfxClock {running: bind ticking}; return Group { transform: [translate(5,5),scale(1,1)] content: [ ImageView { image: Image {url: "http://sellmic.com/lab/dev/jfx/clock/images/clock_face.png"} }, Group { var hourHand = ImageView { transform: bind rotate((t.hours + t.minutes/60)*30,255,245) image: Image {url: "http://sellmic.com/lab/dev/jfx/clock/images/hour_hand.png"} antialias: false } var minuteHand = ImageView { transform: bind rotate((t.minutes + t.seconds/60) *6,255,245) image: Image {url: "http://sellmic.com/lab/dev/jfx/clock/images/minute_hand.png"} antialias: false } var secondHand = ImageView { transform: bind rotate(t.seconds * 6,255,245) image: Image {url: "http://sellmic.com/lab/dev/jfx/clock/images/second_hand.png"} antialias: false } content: [hourHand, minuteHand, secondHand] }, ImageView { transform: [] image: Image {url: "http://sellmic.com/lab/dev/jfx/clock/images/pin.png"} antialias: false }] }; } var c:ClockUI = new ClockUI(); Frame{ title: "Clock!" content: Canvas{ content: c } width: 525 height: 550 visible: true onClose: operation(){ c.ticking = false; System.exit(0); } } c.ticking = true;