/* * Main.fx * * Created on Mar 15, 2009, 9:21:28 PM */ package ballthrowingon3d; import ballthrowingon3d.BallInSpace; import javafx.scene.Cursor; import javafx.scene.input.MouseEvent; import javafx.scene.paint.Color; import javafx.scene.paint.LinearGradient; import javafx.scene.paint.Stop; import javafx.scene.Scene; import javafx.scene.shape.Polygon; import javafx.scene.shape.Rectangle; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage; /** * @author Vaibhav Choudhary */ var gv: BallInSpace = BallInSpace{}; Stage { title: "Launch a ball in 3D space" width: 590 height: 680 scene: Scene { fill: Color.BLACK content: [ Polygon { translateX: 40 points: [ 250,200, 270,200, 320,500,200,500 ] fill: Color.GRAY } Polygon { translateX: 40 points: [ 250,200, 230,150, 180,400,200,500 ] fill: Color.LIGHTGREEN opacity: 0.3 } Polygon { translateX: 40 points: [ 270,200, 290,150, 340,400,320,500 ] fill: Color.LIGHTBLUE opacity: 0.3 } Polygon { translateX: 40 points: [ 230,150, 290,150, 340,400,180,400, ] fill: Color.LIGHTGRAY opacity: 0.4 } Rectangle { cursor: Cursor.HAND opacity: 0.5 x: 268, y: 470 width: 60, height: 20 fill: LinearGradient { startX: 0.0 startY: 0.0 endX: 0.0 endY: 1.0 stops: [ Stop { color: Color.BLACK offset: 0.0 }, Stop { color: Color.WHITE offset: 1.0 }, ] } stroke: Color.WHITE onMouseClicked: function( e: MouseEvent ):Void { gv.timeline_g.playFromStart(); } } Text { fill: Color.WHITE font: Font { size: 12 name: "Arial Bold" } x: 278, y: 485 content: "Launch" } gv, ] } }