当前位置: 首页>>代码示例>>Java>>正文


Java Rectangle.setStroke方法代码示例

本文整理汇总了Java中javafx.scene.shape.Rectangle.setStroke方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.setStroke方法的具体用法?Java Rectangle.setStroke怎么用?Java Rectangle.setStroke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.shape.Rectangle的用法示例。


在下文中一共展示了Rectangle.setStroke方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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;
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:27,代码来源:FrmGerenciarHorario.java

示例2: 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;
}
 
开发者ID:dev-andremonteiro,项目名称:AlphaLab,代码行数:17,代码来源:FrmPedidosReserva.java

示例3: createIconContent

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();
    AnchorPane anchorPane = new AnchorPane();

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    anchorPane.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle r1 = new Rectangle(14, 14, Color.web("#1c89f4"));
    Rectangle r2 = new Rectangle(45, 10, Color.web("#349b00"));
    Rectangle r3 = new Rectangle(35, 14, Color.web("#349b00"));

    anchorPane.getChildren().addAll(r1, r2, r3);
    AnchorPane.setTopAnchor(r1, Double.valueOf(1));
    AnchorPane.setLeftAnchor(r1, Double.valueOf(1));
    AnchorPane.setTopAnchor(r2, Double.valueOf(20));
    AnchorPane.setLeftAnchor(r2, Double.valueOf(1));
    AnchorPane.setBottomAnchor(r3, Double.valueOf(1));
    AnchorPane.setRightAnchor(r3, Double.valueOf(5));

    sp.getChildren().addAll(rectangle, anchorPane);
    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:AnchorPaneSample.java

示例4: createRectangles

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private void createRectangles(){
    top = new Rectangle();
    body = new Rectangle();
    changeHeight(getRefNode().getHeight());
    changeWidth(getRefNode().getWidth());

    top.setX(getRefNode().getX());
    top.setY(getRefNode().getY());
    top.setFill(Color.LIGHTSKYBLUE);
    top.setStroke(Color.BLACK);

    body.setX(getRefNode().getX());
    body.setY(getRefNode().getY() + top.getHeight());
    body.setFill(Color.LIGHTSKYBLUE);
    body.setStroke(Color.BLACK);

}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:18,代码来源:PackageNodeView.java

示例5: onTouchPressed

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public void onTouchPressed(TouchEvent event){
    Rectangle dragRectangle = new Rectangle();
    dragRectangle.setFill(null);
    dragRectangle.setStroke(Color.BLACK);

    if(event.getSource() instanceof AbstractNodeView){
        dragRectangle.setX(event.getTouchPoint().getX() + ((AbstractNodeView) event.getSource()).getX());
        dragRectangle.setY(event.getTouchPoint().getY() + ((AbstractNodeView) event.getSource()).getY());
        dragStarts.put(event.getTouchPoint().getId(), new Point2D(
                event.getTouchPoint().getX() + ((AbstractNodeView) event.getSource()).getX()
                , event.getTouchPoint().getY() + ((AbstractNodeView) event.getSource()).getY()));

    } else {
        dragRectangle.setX(event.getTouchPoint().getX());
        dragRectangle.setY(event.getTouchPoint().getY());
        dragStarts.put(event.getTouchPoint().getId(), new Point2D(event.getTouchPoint().getX(), event.getTouchPoint().getY()));
    }

    dragRectangles.put(event.getTouchPoint().getId(), dragRectangle);
    aDrawPane.getChildren().add(dragRectangle);
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:22,代码来源:CreateNodeController.java

示例6: EmergencyStopControl

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public EmergencyStopControl() {
	super("Emergency Stop", FlashboardSendableType.ESTOP);
	
	statusRect = new Rectangle();
	statusRect.setWidth(160);
	statusRect.setHeight(40);
	statusRect.setFill(Color.GREEN);
	statusRect.setStroke(Color.BLACK);
	
	button = new javafx.scene.control.Button("Emergency Stop");
	button.setPrefWidth(160);
	button.setPrefHeight(40);
	button.setOnAction((e)->{
		change();
	});
	
	root = new VBox();
	root.setAlignment(Pos.CENTER);
	root.setSpacing(2.0);
	root.getChildren().addAll(button, statusRect);
}
 
开发者ID:Flash3388,项目名称:FlashLib,代码行数:22,代码来源:EmergencyStopControl.java

示例7: createIconContent

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();
    TilePane iconTilePane = new TilePane();
    iconTilePane.setAlignment(Pos.CENTER);

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    iconTilePane.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle[] rec = new Rectangle[9];
    for (int i = 0; i < rec.length; i++) {
        rec[i] = new Rectangle(14, 14, Color.web("#349b00"));
        TilePane.setMargin(rec[i], new Insets(2, 2, 2, 2));
    }
    iconTilePane.getChildren().addAll(rec);
    sp.getChildren().addAll(rectangle, iconTilePane);
    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:TilePaneSample.java

示例8: createIconContent

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();
    HBox hbox = new HBox(3);
    hbox.setAlignment(Pos.CENTER);

    Rectangle rectangle = new Rectangle(70, 25, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    hbox.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle r1 = new Rectangle(14, 14, Color.web("#1c89f4"));
    Rectangle r2 = new Rectangle(14, 14, Color.web("#349b00"));
    Rectangle r3 = new Rectangle(18, 14, Color.web("#349b00"));

    hbox.getChildren().addAll(r1, r2, r3);
    sp.getChildren().addAll(rectangle, hbox);

    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:HBoxSample.java

示例9: SelectController

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public SelectController(Pane pDrawPane, AbstractDiagramController diagramController){
    aDrawPane = pDrawPane;
    this.diagramController = diagramController;

    //init selectRectangle
    selectRectangle = new Rectangle();
    selectRectangle.setFill(null);
    selectRectangle.setStroke(Color.BLACK);
    selectRectangle.getStrokeDashArray().addAll(4.0,5.0,4.0,5.0);
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:11,代码来源:SelectController.java

示例10: MyEnsembleNode

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public MyEnsembleNode(String name) {
  text = new Text(name);
  text.setTextOrigin(VPos.TOP);
  text.setLayoutX(4);
  text.setLayoutY(2);
  rectangle = new Rectangle(50, 20, Color.WHITESMOKE);
  rectangle.setStroke(Color.BLACK);
  //add nodes as childrens, order matters, first is on the bottom
  getChildren().addAll(rectangle, text);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:CustomNodeSample.java

示例11: 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());
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:62,代码来源:ToggleButtonSample.java

示例12: setBorders

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private void setBorders() {
	Color rectBorderFillColor = Color.TRANSPARENT;
	Color rectBorderStrokeColor = Color.BLACK;

	rectBorder = new Rectangle(10, 10, WIDTH - 20, HEIGHT - 20);
	rectBorder.setFill(rectBorderFillColor);
	rectBorder.setStroke(rectBorderStrokeColor);

	getChildren().add(rectBorder);

}
 
开发者ID:JKostikiadis,项目名称:MultiAxisScatterChart,代码行数:12,代码来源:MultiAxisScatterChart.java

示例13: createIconContent

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    sp.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle biggerRec = new Rectangle(55, 55, Color.web("#1c89f4"));
    Rectangle smallerRec = new Rectangle(35, 35, Color.web("#349b00"));

    sp.getChildren().addAll(rectangle, biggerRec, smallerRec);
    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:14,代码来源:StackPaneSample.java

示例14: insertRectangles

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
protected void insertRectangles(){
    setLabel();
    if(showArrayList.size() >= 0){
        showList.getChildren().clear();
        if(showArrayList.size() >= capacitySize){
            capacitySize *= 1.5;
        }

        //根据容量添加
        for (int i = 0; i < capacitySize; i++) {

            Rectangle rectangle = new Rectangle(START_X + i * WIDTH, START_Y, WIDTH, HEIGHT);
            rectangle.setFill(Color.WHITE);
            rectangle.setStroke(Color.BLACK);
            rectangle.setOpacity(0.5);
            showList.getChildren().add(rectangle);

            //当有元素时
            if(i < showArrayList.size()) {
                Text text = new Text(rectangle.getX() + rectangle.getWidth() / 2, rectangle.getY() + rectangle.getHeight() / 2, showArrayList.get(i));
                showList.getChildren().add(text);
            }
            //当超过线性表大小
            else {
                Line line = new Line(rectangle.getX(), rectangle.getY() + HEIGHT, rectangle.getX() + WIDTH, rectangle.getY());
                showList.getChildren().add(line);
            }

        }
    }
}
 
开发者ID:fankaljead,项目名称:Curriculum-design-of-data-structure,代码行数:32,代码来源:ShowArrayListController.java

示例15: 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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:StopWatch.java


注:本文中的javafx.scene.shape.Rectangle.setStroke方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。