下面列出了javafx.scene.shape.Polyline#setTranslateY ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
protected Group doCreateVisual() {
ImageView ian = new ImageView(new javafx.scene.image.Image(
getClass().getResource("ibull.jpg").toExternalForm()));
Polyline body = new Polyline(0, 0, 0, 60, 25, 90, 0, 60, -25, 90, 0,
60, 0, 25, 25, 0, 0, 25, -25, 0);
body.setTranslateX(ian.getLayoutBounds().getWidth() / 2
- body.getLayoutBounds().getWidth() / 2 - 5);
body.setTranslateY(-15);
labelText = new Text();
vbox = new VBox();
vbox.getChildren().addAll(ian, body, labelText);
return new Group(vbox);
}
@Override
protected Group doCreateVisual() {
ImageView ian = new ImageView(new javafx.scene.image.Image(
getClass().getResource("ibull.jpg").toExternalForm()));
Polyline body = new Polyline(0, 0, 0, 60, 25, 90, 0, 60, -25, 90, 0,
60, 0, 25, 25, 0, 0, 25, -25, 0);
body.setTranslateX(ian.getLayoutBounds().getWidth() / 2
- body.getLayoutBounds().getWidth() / 2 - 5);
body.setTranslateY(-15);
labelText = new Text();
vbox = new VBox();
vbox.getChildren().addAll(ian, body, labelText);
return new Group(vbox);
}