本文整理汇总了Java中javafx.scene.shape.Rectangle.setRotate方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.setRotate方法的具体用法?Java Rectangle.setRotate怎么用?Java Rectangle.setRotate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Rectangle
的用法示例。
在下文中一共展示了Rectangle.setRotate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createIconContent
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
final Rectangle r1 = new Rectangle (0, 0, 64, 64);
r1.setArcHeight(4);
r1.setArcWidth(4);
r1.setFill(Color.web("#ed4b00"));
Polygon polygon = createArrow();
polygon.setLayoutX(65);
polygon.setLayoutY(5);
polygon.setRotate(165);
Rectangle r2 = new Rectangle (0, 0, 64, 64);
r2.setArcHeight(15);
r2.setArcWidth(15);
r2.setFill(Color.web("#ed4b00"));
r2.setRotate(60);
r2.setOpacity(0.5);
javafx.scene.Group g = new javafx.scene.Group(r2,r1, polygon);
return new javafx.scene.Group(g);
}
示例2: createTic
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private Rectangle createTic(double angle, double width, double height) {
Rectangle rectangle = new Rectangle(-width / 2, -height / 2, width, height);
rectangle.setFill(Color.rgb(10, 10, 10));
rectangle.setRotate(angle);
rectangle.setLayoutX(radius * Math.cos(Math.toRadians(angle)));
rectangle.setLayoutY(radius * Math.sin(Math.toRadians(angle)));
return rectangle;
}
示例3: RotateSample
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public RotateSample() {
super(220, 270);
//create 2 rectangles
Rectangle rect1 = new Rectangle(90, 90, Color.web("#ed4b00", 0.75));
Rectangle rect2 = new Rectangle(90, 90, Color.web("#ed4b00", 0.5));
//rotate the second one
rect2.getTransforms().add(new Rotate(135, 90, 90)); // parameters are angle, pivotX and pivotY
// rectangle with adjustable rotate
Rectangle rect3 = new Rectangle(40, 180, 60, 60);
rect3.setFill(Color.DODGERBLUE);
rect3.setArcWidth(10);
rect3.setArcHeight(10);
rect3.setRotate(45);
//show the rectangles
getChildren().addAll(rect2, rect1, rect3);
// REMOVE ME
setControls(
new SimplePropertySheet.PropDesc("Rotate", rect3.rotateProperty(), 0d, 360d)
);
// END REMOVE ME
//create arrow
Polygon polygon = createArrow();
polygon.setLayoutX(110);
polygon.setLayoutY(15);
polygon.setRotate(135);
getChildren().addAll(polygon);
}