Java Code Examples for javafx.scene.shape.Polyline#setTranslateY()

The following examples show how to use javafx.scene.shape.Polyline#setTranslateY() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomNodeExample.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
@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);
}
 
Example 2
Source File: JFaceCustomNodeExample.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
@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);
}