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


Java GridPane.setPrefSize方法代码示例

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


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

示例1: start

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public void start(Stage primaryStage) {

        canvas = new GridPane();
        canvas.setPrefSize(800,800);
        canvas.setGridLinesVisible(true);
        final int numCols = 9 ;
        final int numRows = 8 ;
        for (int i = 0; i < numCols; i++) {
            ColumnConstraints colConst = new ColumnConstraints();
            colConst.setPercentWidth(100.0 / numCols);
            canvas.getColumnConstraints().add(colConst);
        }
        for (int i = 0; i < numRows; i++) {
            RowConstraints rowConst = new RowConstraints();
            rowConst.setPercentHeight(100.0 / numRows);
            canvas.getRowConstraints().add(rowConst);
        }


        scene = new Scene(canvas, 800, 800);
        primaryStage.setScene(scene);
        bubble = new Bubble(scene);
        primaryStage.show();

        scene.setFill(createGridPattern());


    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:29,代码来源:Circles_handler2.java

示例2: start

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
	GridPane pane = new GridPane();
	pane.setAlignment(Pos.CENTER);
	pane.setMaxSize(800, 600);
	pane.setPrefSize(800, 600);
	pane.setManaged(true);
	pane.setVgap(3);
	pane.setHgap(3);
	pane.addRow(1, new Label("Chess Master"));
	ComboBox<RenderWrapper> renderCombo = new ComboBox<>();
	renderCombo.getItems().addAll(new RenderWrapper(new BGFXRenderer()), new RenderWrapper(new OpenGLRenderer()));
	ChessMaster.getPluginManager().getExtensions(Renderer.class).stream().map(RenderWrapper::new).forEach(renderCombo.getItems()::add);
	pane.addRow(2, new Label("Select a renderer:"), renderCombo);
	Button button = new Button("Start!");
	button.setOnAction(event -> {
		ChessMaster.getLogger().info("Using renderer: {} ({})", renderCombo.getSelectionModel().getSelectedItem().renderer.getName(), renderCombo.getSelectionModel().getSelectedItem().renderer.getClass().getName());
		renderCombo.getSelectionModel().getSelectedItem().renderer.render();
		primaryStage.close();
	});
	pane.addRow(3, button);
	primaryStage.setScene(new Scene(pane));
	primaryStage.show();
}
 
开发者ID:HuajiStudio,项目名称:ChessMaster,代码行数:25,代码来源:RenderEngineSelector.java

示例3: start

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {

    canvas = new GridPane();
    canvas.setPrefSize(800,800);
    canvas.setGridLinesVisible(true);
    final int numCols = 9 ;
    final int numRows = 8 ;
    for (int i = 0; i < numCols; i++) {
        ColumnConstraints colConst = new ColumnConstraints();
        colConst.setPercentWidth(100.0 / numCols);
        canvas.getColumnConstraints().add(colConst);
    }
    for (int i = 0; i < numRows; i++) {
        RowConstraints rowConst = new RowConstraints();
        rowConst.setPercentHeight(100.0 / numRows);
        canvas.getRowConstraints().add(rowConst);
    }


    scene = new Scene(canvas, 800, 800);
    primaryStage.setScene(scene);
    bubble = new Bubble(scene);
    primaryStage.show();

    scene.setFill(createGridPattern());


}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:30,代码来源:Circles_handler.java

示例4: start

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {

    canvas = new GridPane();
    canvas.setPrefSize(800,800);
    canvas.setGridLinesVisible(true);
    final int numCols = 9 ;
    final int numRows = 8 ;
    for (int i = 0; i < numCols; i++) {
        ColumnConstraints colConst = new ColumnConstraints();
        colConst.setPercentWidth(100.0 / numCols);
        canvas.getColumnConstraints().add(colConst);
    }
    for (int i = 0; i < numRows; i++) {
        RowConstraints rowConst = new RowConstraints();
        rowConst.setPercentHeight(100.0 / numRows);
        canvas.getRowConstraints().add(rowConst);
    }

    scene = new Scene(canvas, 800, 800);
    primaryStage.setScene(scene);
    bubble = new Bubble(scene);
    primaryStage.show();

    scene.setFill(createGridPattern());


}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:29,代码来源:Circles_points_handler.java

示例5: start

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public void start(Stage primaryStage) {

        canvas = new GridPane();

        canvas.setPrefSize(1300,741);
        canvas.setGridLinesVisible(false);
        final int numCols = 13 ;
        final int numRows = 13 ;
        for (int i = 0; i < numCols; i++) {
            ColumnConstraints colConst = new ColumnConstraints();
            colConst.setPercentWidth(100.0 / numCols);
            canvas.getColumnConstraints().add(colConst);
        }
        for (int i = 0; i < numRows; i++) {
            RowConstraints rowConst = new RowConstraints();
            rowConst.setPercentHeight(100.0 / numRows);
            canvas.getRowConstraints().add(rowConst);
        }

        scene = new Scene(canvas);
        primaryStage.setScene(scene);

        //primaryStage.sizeToScene();
        //primaryStage.setFullScreen(true);
        primaryStage.show();

        scene.setFill(createGridPattern());

    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:30,代码来源:HeatMap.java


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