本文整理匯總了Java中javafx.scene.shape.Circle.centerYProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Circle.centerYProperty方法的具體用法?Java Circle.centerYProperty怎麽用?Java Circle.centerYProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.shape.Circle
的用法示例。
在下文中一共展示了Circle.centerYProperty方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: calculateXBinding
import javafx.scene.shape.Circle; //導入方法依賴的package包/類
private static ObservableDoubleValue calculateXBinding(final Circle source, final Point target) {
return new DoubleBinding() {
{
super.bind(source.centerXProperty(), source.centerYProperty());
super.bind(target.xProperty(), target.yProperty());
super.bind(source.radiusProperty());
}
@Override
protected double computeValue() {
double angle = Math.atan2(source.centerYProperty().get() - target.yProperty().get(), source.centerXProperty().get() - target.xProperty().get()) - Math.toRadians(180);
return source.centerXProperty().get() + source.radiusProperty().get() * Math.cos(angle);
}
};
}
示例2: calculateYBinding
import javafx.scene.shape.Circle; //導入方法依賴的package包/類
private static ObservableDoubleValue calculateYBinding(final Circle source, final Point target) {
return new DoubleBinding() {
{
super.bind(source.centerXProperty(), source.centerYProperty());
super.bind(target.xProperty(), target.yProperty());
super.bind(source.radiusProperty());
}
@Override
protected double computeValue() {
double angle = Math.atan2(source.centerYProperty().get() - target.yProperty().get(), source.centerXProperty().get() - target.xProperty().get()) - Math.toRadians(180);
return source.centerYProperty().get() + source.radiusProperty().get() * Math.sin(angle);
}
};
}
示例3: Point
import javafx.scene.shape.Circle; //導入方法依賴的package包/類
Point(final Circle circle) {
this.x = circle.centerXProperty();
this.y = circle.centerYProperty();
}