javafx.scene.shape.Polyline#setTranslateY ( )源码实例Demo

下面列出了javafx.scene.shape.Polyline#setTranslateY ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: gef   文件: CustomNodeExample.java
@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);
}
 
源代码2 项目: gef   文件: JFaceCustomNodeExample.java
@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);
}