本文整理汇总了Java中javafx.scene.shape.Rectangle.setArcHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.setArcHeight方法的具体用法?Java Rectangle.setArcHeight怎么用?Java Rectangle.setArcHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Rectangle
的用法示例。
在下文中一共展示了Rectangle.setArcHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StrokeTransitionSample
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public StrokeTransitionSample() {
super(150,150);
Rectangle rect = new Rectangle(0, 0, 150, 150);
rect.setArcHeight(20);
rect.setArcWidth(20);
rect.setFill(null);
rect.setStroke(Color.DODGERBLUE);
rect.setStrokeWidth(10);
getChildren().add(rect);
strokeTransition = StrokeTransitionBuilder.create()
.duration(Duration.seconds(3))
.shape(rect)
.fromValue(Color.RED)
.toValue(Color.DODGERBLUE)
.cycleCount(Timeline.INDEFINITE)
.autoReverse(true)
.build();
}
示例2: ScaleTransitionSample
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public ScaleTransitionSample() {
super(150,150);
Rectangle rect = new Rectangle(50, 50, 50, 50);
rect.setArcHeight(15);
rect.setArcWidth(15);
rect.setFill(Color.ORANGE);
getChildren().add(rect);
scaleTransition = ScaleTransitionBuilder.create()
.node(rect)
.duration(Duration.seconds(4))
.toX(3)
.toY(3)
.cycleCount(Timeline.INDEFINITE)
.autoReverse(true)
.build();
}
示例3: RotateTransitionSample
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public RotateTransitionSample() {
super(140,140);
Rectangle rect = new Rectangle(20, 20, 100, 100);
rect.setArcHeight(20);
rect.setArcWidth(20);
rect.setFill(Color.ORANGE);
getChildren().add(rect);
rotateTransition = RotateTransitionBuilder.create()
.node(rect)
.duration(Duration.seconds(4))
.fromAngle(0)
.toAngle(720)
.cycleCount(Timeline.INDEFINITE)
.autoReverse(true)
.build();
}
示例4: createIconContent
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
final Rectangle r1 = new Rectangle (50, 50, 14, 14);
r1.setArcHeight(4);
r1.setArcWidth(4);
r1.setFill(Color.web("#ed4b00"));
Polygon polygon = createArrow();
polygon.setLayoutX(68);
polygon.setLayoutY(25);
polygon.setRotate(45);
Rectangle r3 = new Rectangle (25, 25, 64, 64);
r3.setArcHeight(15);
r3.setArcWidth(15);
r3.setFill(Color.web("#f49b00"));
javafx.scene.Group g = new javafx.scene.Group(r3,r1, polygon);
return new javafx.scene.Group(g);
}
示例5: 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);
}
示例6: updateMenuItems
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private void updateMenuItems() {
ToggleGroup group = new ToggleGroup();
List<MenuItem> items = new ArrayList<>();
for (Calendar calendar : getSkinnable().getCalendars()) {
RadioMenuItem item = new RadioMenuItem(calendar.getName());
Rectangle icon = new Rectangle(10, 10);
icon.setArcHeight(2);
icon.setArcWidth(2);
icon.getStyleClass().add(calendar.getStyle() + "-icon"); //$NON-NLS-1$
item.setGraphic(icon);
item.setDisable(calendar.isReadOnly());
item.setOnAction(evt -> getSkinnable().setCalendar(calendar));
group.getToggles().add(item);
items.add(item);
if (calendar.equals(getSkinnable().getCalendar())) {
item.setSelected(true);
}
}
button.getItems().setAll(items);
}
示例7: createIconContent
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
double offset;
Stop[] stops = new Stop[255];
for (int y = 0; y < 255; y++) {
offset = (double) (1.0 / 255) * y;
int h = (int)((y / 255.0) * 360);
stops[y] = new Stop(offset, Color.hsb(h, 0.8, 0.9));
}
Rectangle rect = new Rectangle(80,80,
new LinearGradient(0f, 0f, 1f, 1f, true, CycleMethod.NO_CYCLE, stops));
rect.setArcWidth(20);
rect.setArcHeight(20);
return rect;
}
示例8: start
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
stage.setTitle("Toggle Button Sample");
stage.setWidth(250);
stage.setHeight(180);
HBox hbox = new HBox();
VBox vbox = new VBox();
Scene scene = new Scene(new Group(vbox));
stage.setScene(scene);
scene.getStylesheets().add("togglebuttonsample/ControlStyle.css");
Rectangle rect = new Rectangle();
rect.setHeight(50);
rect.setFill(Color.WHITE);
rect.setStroke(Color.DARKGRAY);
rect.setStrokeWidth(2);
rect.setArcHeight(10);
rect.setArcWidth(10);
final ToggleGroup group = new ToggleGroup();
group.selectedToggleProperty().addListener(
(ObservableValue<? extends Toggle> ov,
Toggle toggle, Toggle new_toggle) -> {
if (new_toggle == null)
rect.setFill(Color.WHITE);
else
rect.setFill((Color) group.getSelectedToggle().getUserData());
});
ToggleButton tb1 = new ToggleButton("Minor");
tb1.setToggleGroup(group);
tb1.setUserData(Color.LIGHTGREEN);
tb1.setSelected(true);
tb1.getStyleClass().add("toggle-button1");
ToggleButton tb2 = new ToggleButton("Major");
tb2.setToggleGroup(group);
tb2.setUserData(Color.LIGHTBLUE);
tb2.getStyleClass().add("toggle-button2");
ToggleButton tb3 = new ToggleButton("Critical");
tb3.setToggleGroup(group);
tb3.setUserData(Color.SALMON);
tb3.getStyleClass().add("toggle-button3");
hbox.getChildren().addAll(tb1, tb2, tb3);
vbox.getChildren().add(new Label("Priority:"));
vbox.getChildren().add(hbox);
vbox.getChildren().add(rect);
vbox.setPadding(new Insets(20, 10, 10, 20));
stage.show();
rect.setWidth(hbox.getWidth());
}
示例9: 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);
}
示例10: createIconContent
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
Rectangle rect = new Rectangle(80,80,new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] {
new Stop(0, Color.rgb(156,216,255)),
new Stop(0.5, Color.DODGERBLUE),
new Stop(1, Color.rgb(0,70,140))
}));
rect.setArcWidth(20);
rect.setArcHeight(20);
return rect;
}
示例11: createIconContent
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
Rectangle rect = new Rectangle(80,80,new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, new Stop[] {
new Stop(0, Color.rgb(156,216,255)),
new Stop(0.5, Color.DODGERBLUE),
new Stop(1, Color.rgb(0,70,140))
}));
rect.setArcWidth(20);
rect.setArcHeight(20);
return rect;
}
示例12: createIconContent
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
final Rectangle r1 = new Rectangle (22, 0, 64, 64);
r1.setArcHeight(4);
r1.setArcWidth(4);
r1.setFill(Color.web("#ed4b00",0.5));
r1.getTransforms().add(new Shear(-0.35, 0));
Polygon polygon = createArrow();
polygon.setLayoutX(-5);
polygon.setLayoutY(-2);
polygon.setRotate(90);
Rectangle r2 = new Rectangle (0, 0, 64, 64);
r2.setArcHeight(4);
r2.setArcWidth(4);
r2.setFill(Color.web("#ed4b00", 0.25));
javafx.scene.Group g = new javafx.scene.Group(r2,r1, polygon);
return new javafx.scene.Group(g);
}
示例13: PauseTransitionSample
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public PauseTransitionSample() {
super(400,150);
// create rectangle
Rectangle rect = new Rectangle(-25,-25,50, 50);
rect.setArcHeight(15);
rect.setArcWidth(15);
rect.setFill(Color.CRIMSON);
rect.setTranslateX(50);
rect.setTranslateY(75);
getChildren().add(rect);
animation = SequentialTransitionBuilder.create()
.node(rect)
.children(
TranslateTransitionBuilder.create()
.duration(Duration.seconds(2))
.fromX(50)
.toX(200)
.build(),
PauseTransitionBuilder.create()
.duration(Duration.seconds(2))
.build(),
TranslateTransitionBuilder.create()
.duration(Duration.seconds(2))
.fromX(200)
.toX(350)
.build()
)
.cycleCount(Timeline.INDEFINITE)
.autoReverse(true)
.build();
}
示例14: createCell
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private Rectangle createCell(int i, int j){
final double arcSize = CELL_SIZE / 6d;
Rectangle cell = new Rectangle(i * CELL_SIZE, j * CELL_SIZE, CELL_SIZE, CELL_SIZE);
// provide default style in case css are not loaded
cell.setFill(Color.WHITE);
cell.setStroke(Color.GREY);
cell.setArcHeight(arcSize);
cell.setArcWidth(arcSize);
cell.getStyleClass().add("game-grid-cell");
return cell;
}
示例15: SequentialTransitionSample
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public SequentialTransitionSample() {
super(400,100);
// create rectangle
Rectangle rect = new Rectangle(-25,-25,50, 50);
rect.setArcHeight(15);
rect.setArcWidth(15);
rect.setFill(Color.CRIMSON);
rect.setTranslateX(50);
rect.setTranslateY(50);
getChildren().add(rect);
// create 4 transitions
FadeTransition fadeTransition =
FadeTransitionBuilder.create()
.duration(Duration.seconds(1))
.fromValue(1)
.toValue(0.3)
.cycleCount(2)
.autoReverse(true)
.build();
TranslateTransition translateTransition =
TranslateTransitionBuilder.create()
.duration(Duration.seconds(2))
.fromX(50)
.toX(375)
.cycleCount(2)
.autoReverse(true)
.build();
RotateTransition rotateTransition =
RotateTransitionBuilder.create()
.duration(Duration.seconds(2))
.byAngle(180)
.cycleCount(4)
.autoReverse(true)
.build();
ScaleTransition scaleTransition =
ScaleTransitionBuilder.create()
.duration(Duration.seconds(2))
.toX(2)
.toY(2)
.cycleCount(2)
.autoReverse(true)
.build();
// create sequential transition to do 4 transitions one after another
sequentialTransition = SequentialTransitionBuilder.create()
.node(rect)
.children(fadeTransition, translateTransition, rotateTransition,
scaleTransition)
.cycleCount(Timeline.INDEFINITE)
.autoReverse(true)
.build();
}