本文整理汇总了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());
}
示例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();
}
示例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;
}
示例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());
}
示例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());
}
示例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());
}
示例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;
}
示例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;
}