本文整理汇总了Java中javafx.geometry.Pos.getVpos方法的典型用法代码示例。如果您正苦于以下问题:Java Pos.getVpos方法的具体用法?Java Pos.getVpos怎么用?Java Pos.getVpos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.geometry.Pos
的用法示例。
在下文中一共展示了Pos.getVpos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: moveTo
import javafx.geometry.Pos; //导入方法依赖的package包/类
@Override
public RNode<T> moveTo(Duration d, Pos referencePoint, double _x, double _y) {
double x;
double y;
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
switch (referencePoint.getHpos()) {
case CENTER:
x = bounds.getMinX() + bounds.getWidth()/2;
break;
case RIGHT:
x = bounds.getMaxX();
break;
default:
x = bounds.getMinX();
break;
}
switch (referencePoint.getVpos()) {
case BOTTOM:
case BASELINE:
y = bounds.getMaxY();
break;
case CENTER:
y = bounds.getMinY() + bounds.getHeight()/2;
break;
default:
y = bounds.getMinY();
break;
}
controller.run(Move.to(d, x+_x, y+_y));
return this;
}
示例2: location
import javafx.geometry.Pos; //导入方法依赖的package包/类
@Override
public Point2D location(Pos position) {
double x;
double y;
Bounds bounds = node.localToScreen(node.getBoundsInLocal());
switch (position.getHpos()) {
case CENTER:
x = bounds.getMinX() + bounds.getWidth()/2;
break;
case RIGHT:
x = bounds.getMaxX();
break;
default:
x = bounds.getMinX();
break;
}
switch (position.getVpos()) {
case BOTTOM:
case BASELINE:
y = bounds.getMaxY();
break;
case CENTER:
y = bounds.getMinY() + bounds.getHeight()/2;
break;
default:
y = bounds.getMinY();
break;
}
return new Point2D(x, y);
}