import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.image.Image;
import javafx.scene.Node;
import javafx.scene.text.Text;
import javafx.scene.transform.Rotate;
import javafx.scene.transform.Transform;
import javafx.scene.shape.Rectangle;
import javafx.scene.effect.Reflection;
import javafx.scene.Group;
/**
* @author Smartken
*/
Stage{
height:600
width:800
visible:true
scene:Scene{
fill:LinearGradient{
startX:0
startY:0
endX:800
endY:600
proportional:false
stops:[Stop{
offset:0.0
color:Color.WHITESMOKE},
Stop{
offset:1.0
color:Color.BLACK}]
}
content:[Group{ //Group自身是一个Node,但它也可以包含多个Node
content: [Rectangle {
x: 400,
y: 300
width: 120,
height: 60
arcHeight:60
arcWidth:20
stroke: Color.BLACK
fill:null
},Circle {
centerX: 460,
centerY: 330
radius: 20
fill: Color.RED
} ]
effect:Reflection{fraction:0.8 topOffset:3 topOpacity:0.7 }
//reflection 对象字面值具有一个 fraction
实例变量,该变量用来定义在映像中可见的按钮区域的百分比。topOpacity
变量用来定义映像的不透明性度,topOffset
用来定义按钮底部与映像顶部之间的距离。
}
]
}
}