本文整理了Java中javafx.scene.control.Label.setTranslateY()
方法的一些代码示例,展示了Label.setTranslateY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setTranslateY()
方法的具体详情如下:
包路径:javafx.scene.control.Label
类名称:Label
方法名:setTranslateY
暂无
代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX
/**
* Create the labels and add them to the group.
* @param g group the labels are added to
* @param centerPoint central point around which the labels are placed.
*/
private void createAndAddLabels(Group g, final Point2D centerPoint) {
List<String> values = control.valuesProperty();
angles = new ArrayList<>(values.size());
double angle = currentRotation.doubleValue() + 180;
double step = (180.0 - 2 * currentRotation.doubleValue()) / (values.size() - 1);
int radius = 120;
for (String value : values) {
angles.add(angle);
Point2D basePoint = calculateBasePoint(centerPoint, radius, angle);
Dimension2D dim = sizeing.calculate(value, control.getFont());
Label l = new Label(value);
l.setFont(control.getFont());
l.getStyleClass().add("openPatricianSlider");
l.setTranslateX(basePoint.getX() - dim.getWidth() * calculateMoveFactor(angle));
l.setTranslateY(basePoint.getY() - dim.getHeight());
g.getChildren().add(l);
angle += step;
}
double initialAngle = Math.max(INITIAL_ROTATION, control.getSelectedIndex() * step);
currentRotation.setValue(initialAngle);
}
/**
代码示例来源:origin: com.bitplan.radolan/com.bitplan.radolan
/**
* draw a circle with given text on the given pane
*
* @param pane
* @param text
* @param radius
* @param color
* @param x
* @param y
*/
public static Circle drawCircleWithText(Pane pane, String text, double radius,
Color color, double x, double y) {
Circle circle = new Circle();
circle.setRadius(radius);
circle.setFill(color);
circle.setTranslateX(x);
circle.setTranslateY(y);
Label label = new Label(text);
label.setTranslateX(x + radius);
label.setTranslateY(y + radius);
label.setTextFill(color);
pane.getChildren().addAll(circle, label);
return circle;
}
代码示例来源:origin: com.github.almasb/fxgl-ui
barGroup.translateYProperty().bind(label.heightProperty());
label.translateXProperty().bind(width.divide(2).subtract(label.widthProperty().divide(2)));
label.setTranslateY(0);
break;
default:
代码示例来源:origin: com.github.almasb/fxgl-base
barGroup.translateYProperty().bind(label.heightProperty());
label.translateXProperty().bind(width.divide(2).subtract(label.widthProperty().divide(2)));
label.setTranslateY(0);
break;
default:
内容来源于网络,如有侵权,请联系作者删除!