本文整理汇总了Java中javafx.scene.layout.Pane.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Pane.getHeight方法的具体用法?Java Pane.getHeight怎么用?Java Pane.getHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.Pane
的用法示例。
在下文中一共展示了Pane.getHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: recomputePosition
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
public void recomputePosition() {
Pane parent = (Pane) this.getParent();
if (parent != null) {
handTranslateX = (parent.getWidth() - maxSize) / 2;
handTranslateY = parent.getHeight() - maxSize;
pieTranslateX = (parent.getWidth() - size) / 2;
pieTranslateY = parent.getHeight() - maxSize;
hand.setTranslateX(handTranslateX);
hand.setTranslateY(handTranslateY);
pie.setTranslateX(pieTranslateX);
pie.setTranslateY(pieTranslateY);
}
}
示例2: animiereBall
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
public Pane animiereBall() {
animationPane = new Pane();
animationPane.setPrefSize(pb, ph);
circle = new Circle(x, y, r, color);
Timeline timeline = new Timeline();
timeline.setCycleCount(Timeline.INDEFINITE);
KeyFrame moveBall = new KeyFrame(Duration.millis(intervall), new EventHandler<ActionEvent>() {
public void handle(ActionEvent event) {
if (((circle.getCenterX() + dx < r) && (dx < 0)) || ((circle.getCenterX() + dx > animationPane.getWidth() - r) && (dx > 0))) {
dx = -dx;
}
circle.setCenterX(circle.getCenterX() + dx);
if (((circle.getCenterY() + dy < r) && (dy < 0)) || ((circle.getCenterY() + dy > animationPane.getHeight() - r) && (dy > 0))) {
dy = -dy;
}
circle.setCenterY(circle.getCenterY() + dy);
}
});
timeline.getKeyFrames().add(moveBall);
timeline.play();
HBox hBox = this.navigiereAnimation(timeline);
animationPane.getChildren().addAll(circle, hBox);
return animationPane;
}
示例3: computeGameSizing
import javafx.scene.layout.Pane; //导入方法依赖的package包/类
public GameSizing computeGameSizing(Pane pane) {
Rectangle2D bounds = new Rectangle2D(0, 0, pane.getWidth(), pane.getHeight());
return computeGameSizing(bounds);
}