當前位置: 首頁>>代碼示例>>Java>>正文


Java GridPane.setGridLinesVisible方法代碼示例

本文整理匯總了Java中javafx.scene.layout.GridPane.setGridLinesVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java GridPane.setGridLinesVisible方法的具體用法?Java GridPane.setGridLinesVisible怎麽用?Java GridPane.setGridLinesVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.layout.GridPane的用法示例。


在下文中一共展示了GridPane.setGridLinesVisible方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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(final Stage primaryStage) {
    GridPane gridPane = new GridPane();
    gridPane.setStyle("-fx-background-color: #252525");
    gridPane.setHgap(5.0);
    gridPane.setGridLinesVisible(true);

    gridPane.add(new AnchorPane(new Alarm()),       0, 0);
    gridPane.add(new AnchorPane(new Display()),     1, 0);
    gridPane.add(new AnchorPane(new Generator()),   2, 0);
    gridPane.add(new AnchorPane(new LevelBar()),    3, 0);
    gridPane.add(new AnchorPane(new Load()),        4, 0);
    gridPane.add(new AnchorPane(new Switch()),      5, 0);
    gridPane.add(new AnchorPane(new Transformer()), 6, 0);

    Scene scene = new Scene(gridPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}
 
開發者ID:assemblits,項目名稱:dynamo,代碼行數:20,代碼來源:DynamoTest.java

示例3: createBody

import javafx.scene.layout.GridPane; //導入方法依賴的package包/類
/**
 * Creates the node used for the body part of each cell.
 *
 * In this default implementation the body consists of a grid pane with
 * three columns. The middle column is used for showing the title of
 * calendar entries. This column will get whatever space is left after
 * the icon and the time column have used what they need. This means
 * that a very long title will automatically be truncated.
 *
 * @return the body node
 */
protected Node createBody() {
    // icon column
    ColumnConstraints iconColumn = new ColumnConstraints();

    // title column
    ColumnConstraints descriptionColumn = new ColumnConstraints();
    descriptionColumn.setFillWidth(true);
    descriptionColumn.setHgrow(Priority.SOMETIMES);
    descriptionColumn.setMinWidth(0);
    descriptionColumn.setPrefWidth(0);

    // time column
    ColumnConstraints timeColumn = new ColumnConstraints();
    timeColumn.setHalignment(HPos.RIGHT);

    gridPane = new GridPane();
    gridPane.setGridLinesVisible(true);
    gridPane.setMinWidth(0);
    gridPane.setPrefWidth(0);
    gridPane.getStyleClass().add(AGENDA_VIEW_BODY);
    gridPane.getColumnConstraints().addAll(iconColumn, descriptionColumn, timeColumn);

    return gridPane;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:36,代碼來源:AgendaView.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,代碼行數:30,代碼來源:Circles_handler.java

示例5: 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

示例6: 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

示例7: createPredefinedTagsGrid

import javafx.scene.layout.GridPane; //導入方法依賴的package包/類
private GridPane createPredefinedTagsGrid() {
	final GridPane grid = new GridPane();
	grid.setHgap(GRID_GAP);
	grid.setVgap(GRID_GAP);
	grid.setPadding(new Insets(GRID_GAP));
	grid.setGridLinesVisible(false);
	//-------------------------------------------------------------------- Column #0
	//
	final Label idLabel = new Label("ID");
	grid.add(idLabel, 0, 0);
	GridPane.setHalignment(idLabel, HPos.RIGHT);
	//
	final Label nameLabel = new Label("Name");
	grid.add(nameLabel, 0, 1);
	GridPane.setHalignment(nameLabel, HPos.RIGHT);
	//
	final Label titleLabel = new Label("Title");
	grid.add(titleLabel, 0, 2);
	GridPane.setHalignment(titleLabel, HPos.RIGHT);
	//
	//-------------------------------------------------------------------- Column #1
	//
	grid.add(ID_TAG_FIELD, 1, 0);
	grid.add(NAME_TAG_FIELD, 1, 1);
	grid.add(TITLE_TAG_FIELD, 1, 2);
	//
	//-------------------------------------------------------------------- Constraints
	//
	for (int i = 0; i < 2; i++) {
		final ColumnConstraints column = new ColumnConstraints();
		column.setFillWidth(true);
		column.setHgrow(Priority.NEVER);
		grid.getColumnConstraints().add(column);
	}
	for (int i = 0; i < 3; i++) {
		final RowConstraints row = new RowConstraints();
		row.setFillHeight(true);
		row.setVgrow(Priority.NEVER);
		grid.getRowConstraints().add(row);
	}
	//
	grid.getColumnConstraints().get(1).setHgrow(Priority.SOMETIMES);
	//
	//-------------------------------------------------------------------- Style
	//
	ID_TAG_FIELD.setStyle(READ_ONLY_STYLE);
	NAME_TAG_FIELD.setStyle(READ_ONLY_STYLE);
	TITLE_TAG_FIELD.setStyle(READ_ONLY_STYLE);
	//
	//-------------------------------------------------------------------- Editable
	//
	ID_TAG_FIELD.setEditable(false);
	NAME_TAG_FIELD.setEditable(false);
	TITLE_TAG_FIELD.setEditable(false);
	//
	return grid;
}
 
開發者ID:mikelaud,項目名稱:fx-media-catalog,代碼行數:58,代碼來源:FxMediaCatalog.java

示例8: createForm

import javafx.scene.layout.GridPane; //導入方法依賴的package包/類
private Pane createForm() {
	final GridPane grid = new GridPane();
	grid.setHgap(SMALL_GRID_GAP);
	grid.setVgap(SMALL_GRID_GAP);
	grid.setPadding(new Insets(GRID_GAP));
	grid.setGridLinesVisible(false);
	//-------------------------------------------------------------------- Row #0
	//
	grid.add(CONTENT_PROGRESS, 0, 0);
	CONTENT_PROGRESS.setMaxWidth(Double.MAX_VALUE);
	CONTENT_PROGRESS.setMinHeight(0);
	CONTENT_PROGRESS.setMinWidth(0);
	CONTENT_PROGRESS.setProgress(0);
	//
	grid.add(CONTENT_VOLUME, 1, 0);
	CONTENT_VOLUME.setMaxWidth(Double.MAX_VALUE);
	CONTENT_PROGRESS.prefHeightProperty().bind(CONTENT_VOLUME.heightProperty());
	CONTENT_VOLUME.setMin(0);
	CONTENT_VOLUME.setMax(1);
	CONTENT_VOLUME.setValue(0);
	//
	//-------------------------------------------------------------------- Row #1
	//
	grid.add(CONTENT_VIEWER, 0, 1);
	CONTENT_VIEWER.volumeProperty().bindBidirectional(CONTENT_VOLUME.valueProperty());
	grid.add(createCatalogPane(), 1, 1, 1, 2);
	//
	//-------------------------------------------------------------------- Row #2
	//
	grid.add(createDescriptionPane(), 0, 2);
	//
	//-------------------------------------------------------------------- Constraints
	//
	for (int i = 0; i < 2; i++) {
		final ColumnConstraints column = new ColumnConstraints();
		column.setFillWidth(true);
		column.setHgrow(Priority.NEVER);
		grid.getColumnConstraints().add(column);
	}
	for (int i = 0; i < 3; i++) {
		final RowConstraints row = new RowConstraints();
		row.setFillHeight(true);
		row.setVgrow(Priority.NEVER);
		grid.getRowConstraints().add(row);
	}
	//
	grid.getColumnConstraints().get(0).setPrefWidth(RESOLUTION.getWidth());
	grid.getColumnConstraints().get(0).setMinWidth(RESOLUTION.getWidth());
	grid.getColumnConstraints().get(0).setMaxWidth(RESOLUTION.getWidth());
	grid.getColumnConstraints().get(1).setHgrow(Priority.SOMETIMES);
	//
	grid.getRowConstraints().get(1).setPrefHeight(RESOLUTION.getHeight());
	grid.getRowConstraints().get(1).setMinHeight(RESOLUTION.getHeight());
	grid.getRowConstraints().get(1).setMaxHeight(RESOLUTION.getHeight());
	grid.getRowConstraints().get(2).setVgrow(Priority.SOMETIMES);
	//
	//-------------------------------------------------------------------- Style
	//
	CONTENT_VIEWER.setStyle(READ_ONLY_STYLE);
	SNAPSHOTS_GALLERY.setStyle(READ_ONLY_STYLE);
	SNAPSHOTS_GALLERY2.setStyle(READ_ONLY_STYLE);
	//
	//-------------------------------------------------------------------- Editable
	//
	CATALOG_TREE.setEditable(false);
	CONTENT_TAGS_TABLE.setEditable(false);
	DESCRIPTION_AREA.setEditable(false);
	//
	return grid;
}
 
開發者ID:mikelaud,項目名稱:fx-media-catalog,代碼行數:71,代碼來源:FxMediaCatalog.java


注:本文中的javafx.scene.layout.GridPane.setGridLinesVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。