本文整理汇总了Java中javafx.scene.shape.Rectangle.setStrokeWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.setStrokeWidth方法的具体用法?Java Rectangle.setStrokeWidth怎么用?Java Rectangle.setStrokeWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Rectangle
的用法示例。
在下文中一共展示了Rectangle.setStrokeWidth方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildBoxHorario
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
/**
* Constroi a caixa de hor�rio exibida na tabPreencherDados
*
* @return
*/
private StackPane buildBoxHorario() {
VBox vbox = new VBox(7);
vbox.setAlignment(Pos.CENTER);
Rectangle rect = new Rectangle(200, 150);
rect.setStroke(Color.BLACK);
rect.setStrokeWidth(2);
rect.setFill(Color.TRANSPARENT);
Text data = new Text(new SimpleDateFormat("dd/MM/yyyy").format(dtSolicitacaoReserva));
data.setFont(Font.font("Verdana", FontWeight.BOLD, 12.0));
vbox.getChildren().add(data);
for (Horario horario : listaHorariosSelecionados) {
vbox.getChildren().add(new Text(horario.getEstampa()));
}
StackPane caixa = new StackPane(rect, vbox);
return caixa;
}
示例2: 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();
}
示例3: buildBoxHorarios
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private StackPane buildBoxHorarios(List<Horario> horarios) {
VBox vbox = new VBox(7);
vbox.setAlignment(Pos.CENTER);
Rectangle rect = new Rectangle(150, 100);
rect.setStroke(Color.BLACK);
rect.setStrokeWidth(2);
rect.setFill(Color.TRANSPARENT);
for (Horario horario : horarios) {
vbox.getChildren().add(new Text(horario.getEstampa()));
}
StackPane caixa = new StackPane(rect, vbox);
return caixa;
}
示例4: buildBoxHorario
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private List<StackPane> buildBoxHorario() {
List<StackPane> boxHorarios = new ArrayList<>();
for (ReservaEntity reservaEntity : novasReservas) {
VBox vbox = new VBox(7);
vbox.setAlignment(Pos.CENTER);
Rectangle rect = new Rectangle(100, 150);
rect.setStroke(Color.BLACK);
rect.setStrokeWidth(2);
rect.setFill(Color.TRANSPARENT);
Text data = new Text(new SimpleDateFormat("dd/MM/yyyy").format(reservaEntity.getDataInicio()));
data.setFont(Font.font("Verdana", FontWeight.BOLD, 12.0));
vbox.getChildren().add(data);
for (Horario horario : reservaEntity.getHorarios()) {
vbox.getChildren().add(new Text(horario.getEstampa()));
}
boxHorarios.add(new StackPane(rect, vbox));
}
return boxHorarios;
}
示例5: RubberBandSelection
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public RubberBandSelection( Pane group) {
this.group = group;
rect = new Rectangle( 0,0,0,0);
rect.setStroke(Color.BLUE);
rect.setStrokeWidth(1);
rect.setStrokeLineCap(StrokeLineCap.ROUND);
rect.setFill(Color.LIGHTBLUE.deriveColor(0, 1.2, 1, 0.6));
group.addEventHandler(MouseEvent.MOUSE_PRESSED, onMousePressedEventHandler);
group.addEventHandler(MouseEvent.MOUSE_DRAGGED, onMouseDraggedEventHandler);
group.addEventHandler(MouseEvent.MOUSE_RELEASED, onMouseReleasedEventHandler);
}
示例6: createIconContent
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
Rectangle rectangle = new Rectangle(40,40);
rectangle.setStroke(Color.web("#b9c0c5"));
rectangle.setStrokeWidth(5);
rectangle.getStrokeDashArray().addAll(15d,15d);
rectangle.setFill(null);
javafx.scene.effect.InnerShadow effect = new javafx.scene.effect.InnerShadow();
effect.setOffsetX(1);
effect.setOffsetY(1);
effect.setRadius(3);
effect.setColor(Color.rgb(0,0,0,0.6));
rectangle.setEffect(effect);
return rectangle;
}
示例7: createBackground
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private Rectangle createBackground(Color stroke, Color fill) {
Rectangle background = new Rectangle(14, 17, fill);
background.setStroke(stroke);
background.setStrokeWidth(2);
background.setEffect(new Lighting());
background.setCache(true);
return background;
}
示例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: start
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
Group root = new Group();
Line seeSaw = new Line (60,340,340,140);
seeSaw.setStroke(Color.BLACK);
seeSaw.setStrokeWidth(15);
Circle circle = new Circle(70,280,40);
circle.setStroke(Color.GREENYELLOW);
circle.setFill(Color.ORANGE);
circle.setStrokeWidth(5);
Rectangle rect = new Rectangle(240,90,80,70);
rect.setStroke(Color.MEDIUMPURPLE);
rect.setStrokeWidth(5);
rect.setFill(Color.MEDIUMPURPLE);
Line left = new Line (200,240,160,340);
left.setStrokeWidth(5);
Line right = new Line(200,240,240,340);
right.setStrokeWidth(5);
root.getChildren().addAll(seeSaw,rect,circle,left,right);
Scene scene = new Scene(root, 400, 400,Color.WHITE);
primaryStage.setTitle("SeeSaw");
primaryStage.setScene(scene);
primaryStage.show();
}
示例10: doorOpen
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public void doorOpen() {
// Draw trim
Rectangle rgDT = new Rectangle(WIDTH, HEIGHT);
rgDT.setFill(Color.TRANSPARENT);
rgDT.setStroke(Color.web("4d2626"));
rgDT.setStrokeWidth((WIDTH / (WIDTH / 2)));
this.getChildren().add(rgDT);
// Draw three hinges
VBox vbHinges = new VBox(WIDTH / 3);
Rectangle rgDH1 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH1.setFill(Color.web("a5a5a5"));
Rectangle rgDH2 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH2.setFill(Color.web("a5a5a5"));
Rectangle rgDH3 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH3.setFill(Color.web("a5a5a5"));
vbHinges.getChildren().addAll(rgDH1, rgDH2, rgDH3);
vbHinges.setTranslateX(rgDH1.getWidth() / 2);
vbHinges.setTranslateY(rgDH1.getHeight());
this.getChildren().add(vbHinges);
// Draw door
Rectangle rgDD = new Rectangle(WIDTH - (WIDTH / (WIDTH / 4)), HEIGHT);
rgDD.setTranslateX((WIDTH / (WIDTH / 2)) - rgDD.getWidth());
rgDD.setTranslateY((HEIGHT / (HEIGHT / 2)) / 2);
rgDD.setFill(Color.web("673232"));
this.getChildren().add(rgDD);
}
示例11: doorOpen
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public void doorOpen() {
// Draw trim
Rectangle rgDT = new Rectangle(WIDTH, HEIGHT);
rgDT.setFill(Color.TRANSPARENT);
rgDT.setStroke(Color.web("4d2626"));
rgDT.setStrokeWidth((WIDTH / (WIDTH / 2)));
this.getChildren().add(rgDT);
// Draw three hinges
VBox vbHinges = new VBox(WIDTH / 3);
Rectangle rgDH1 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH1.setFill(Color.web("a5a5a5"));
Rectangle rgDH2 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH2.setFill(Color.web("a5a5a5"));
Rectangle rgDH3 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH3.setFill(Color.web("a5a5a5"));
vbHinges.getChildren().addAll(rgDH1, rgDH2, rgDH3);
vbHinges.setTranslateX(rgDH1.getWidth() / 2);
vbHinges.setTranslateY(rgDH1.getHeight());
this.getChildren().add(vbHinges);
// Draw door
Rectangle rgDD = new Rectangle(WIDTH - (WIDTH / (WIDTH / 4)) , HEIGHT);
rgDD.setTranslateX((WIDTH / (WIDTH / 2)) - rgDD.getWidth());
rgDD.setTranslateY((HEIGHT / (HEIGHT / 2)) / 2);
rgDD.setFill(Color.web("673232"));
this.getChildren().add(rgDD);
}
示例12: createDotBackground
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private Rectangle createDotBackground() {
Rectangle background = new Rectangle(8, 17, Color.TRANSPARENT);
background.setStroke(Color.TRANSPARENT);
background.setStrokeWidth(2);
return background;
}
示例13: ScaleSample
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public ScaleSample() {
super(180,180);
// simple rectangle
Rectangle rect1 = new Rectangle(0, 25, 25, 25);
rect1.setArcHeight(15);
rect1.setArcWidth(15);
rect1.setFill(Color.WHITE);
rect1.setStroke(Color.DODGERBLUE);
rect1.setStrokeWidth(3);
Polygon arrow = createArrow();
arrow.setLayoutX(46);
arrow.setLayoutY(22);
arrow.setRotate(90);
// simple rectangle with scale 2 in X axis and 0.5 in Y
Rectangle rect2 = new Rectangle(95, 25, 25, 25);
rect2.setArcHeight(15);
rect2.setArcWidth(15);
rect2.setFill(Color.WHITE);
rect2.setStroke(Color.DODGERBLUE);
rect2.setStrokeWidth(3);
rect2.setScaleX(2);
rect2.setScaleY(0.5);
// rectangle with adjustable scale
Rectangle rect3 = new Rectangle(40, 130, 25, 25);
rect3.setArcHeight(15);
rect3.setArcWidth(15);
rect3.setFill(Color.WHITE);
rect3.setStroke(Color.DODGERBLUE);
rect3.setStrokeWidth(3);
rect3.setScaleX(6);
rect3.setScaleY(0.5);
rect3.setTranslateX(rect3.getTranslateX()+30);
//getChildren().addAll(rect1, rect2, rect3);
getChildren().addAll(rect1, arrow, rect2, rect3);
// REMOVE ME
setControls(
new SimplePropertySheet.PropDesc("Scale X", rect3.scaleXProperty(), 0.1d, 16d),
new SimplePropertySheet.PropDesc("Scale Y", rect3.scaleYProperty(), 0.1d, 4d)
);
// END REMOVE ME
}
示例14: doorHalf
import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public void doorHalf() {
// Draw trim
Rectangle rgDT = new Rectangle(WIDTH, HEIGHT);
rgDT.setFill(Color.TRANSPARENT);
rgDT.setStroke(Color.web("4d2626"));
rgDT.setStrokeWidth((WIDTH / (WIDTH / 2)));
this.getChildren().add(rgDT);
// Draw three hinges
VBox vbHinges = new VBox(WIDTH / 3);
Rectangle rgDH1 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH1.setFill(Color.web("a5a5a5"));
Rectangle rgDH2 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH2.setFill(Color.web("a5a5a5"));
Rectangle rgDH3 = new Rectangle((WIDTH / (WIDTH / 2)), (HEIGHT / (HEIGHT / 8)));
rgDH3.setFill(Color.web("a5a5a5"));
vbHinges.getChildren().addAll(rgDH1, rgDH2, rgDH3);
vbHinges.setTranslateX(rgDH1.getWidth() / 2);
vbHinges.setTranslateY(rgDH1.getHeight());
this.getChildren().add(vbHinges);
// Draw door
Rectangle rgDD = new Rectangle((WIDTH / (WIDTH / 2)) , HEIGHT);
rgDD.setTranslateX((WIDTH / (WIDTH / 2)) - rgDD.getWidth());
rgDD.setTranslateY((HEIGHT / (HEIGHT / 2)) / 2);
rgDD.setFill(Color.web("673232"));
this.getChildren().add(rgDD);
// Draw door handle block
Rectangle rgDHM = new Rectangle((WIDTH / (WIDTH / 2)), (WIDTH / (WIDTH / 4)));
rgDHM.setTranslateX(rgDD.getX() - rgDD.getWidth());
rgDHM.setTranslateY(rgDD.getY() + rgDD.getHeight() / 2 - rgDHM.getHeight() / 2);
rgDHM.setFill(Color.web("bfbfbf"));
this.getChildren().add(rgDHM);
// Draw door handle
Rectangle rgDHL = new Rectangle((WIDTH / (WIDTH / 2)), (WIDTH / (WIDTH / 2)));
rgDHL.setTranslateX(rgDD.getX() - rgDHL.getWidth() - rgDD.getWidth());
rgDHL.setTranslateY(rgDD.getY() + rgDD.getHeight() / 2 - rgDHL.getHeight() / 2);
rgDHL.setFill(Color.web("a5a5a5"));
this.getChildren().add(rgDHL);
}