/* * BlueTheme.fx * * Created on Feb 8, 2008, 9:56:43 PM */ package themes; import javafx.scene.CustomNode; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.shape.Rectangle; import javafx.scene.paint.Color; import javafx.scene.paint.LinearGradient; import javafx.scene.paint.Stop; import javafx.scene.text.Text; import javafx.scene.text.Font; import javafx.scene.input.MouseEvent; /** * @author Vaibhav Choudhary */ var sceneWidth = bind Main.width; var sceneHeight = bind Main.height; public class GreenTheme extends CustomNode { public var op = 0.3; public override function create(): Node { return Group { content: [ Rectangle { x: 0, y: 0 width: bind sceneWidth - 1 height: bind sceneHeight - 1 fill: Color.TRANSPARENT stroke: Color.BLACK strokeWidth: 2 }, Rectangle { x: 1, y: 1 width: bind sceneWidth - 1, height: 30 opacity: 0.8 fill: LinearGradient { startX: 0.0 startY: 0.0 endX: 0.0 endY: 1.0 stops: [ Stop { color: Color.GREEN offset: 0.0 }, Stop { color: Color.DARKGREEN offset: 0.7 }, Stop { color: Color.GREEN offset: 1.0 }, ] } }, Rectangle { x: bind sceneWidth - 25, y: 5 width: 20, height: 20 opacity: bind op onMouseClicked: function( e: MouseEvent ):Void { FX.exit(); } onMouseMoved: function( e: MouseEvent ):Void { op = 0.6; } onMouseExited: function( e: MouseEvent ):Void { op = 0.3; } fill: LinearGradient { startX: 0.0 startY: 0.0 endX: 0.0 endY: 1.0 stops: [ Stop { color: Color.LIGHTGREEN offset: 0.0 }, Stop { color: Color.DARKGREEN offset: 0.5 }, Stop { color: Color.LIGHTGREEN offset: 1.0 }, ] } arcHeight: 5 arcWidth: 5 }, Text { font: Font { size: 20 } x: bind sceneWidth - 20, y: 20 content: "x" } ] }; } }