本文整理汇总了Java中javafx.scene.layout.BorderPane.setLeft方法的典型用法代码示例。如果您正苦于以下问题:Java BorderPane.setLeft方法的具体用法?Java BorderPane.setLeft怎么用?Java BorderPane.setLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.BorderPane
的用法示例。
在下文中一共展示了BorderPane.setLeft方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane root = new BorderPane();
frame = new ImageView();
mask = new ImageView();
root.setLeft(frame);
root.setCenter(mask);
primaryStage.setTitle("Capture Color");
primaryStage.setScene(new Scene(root, 900, 400));
startLaserDetection();
startGameSync();
matBufferedSaver = new Saver<Mat>(){
@Override
protected void save(Mat item, int num) {
try {
ImageIO.write(Utils.matToBufferedImage(item),"jpeg", new File("images/im" + num+ ".jpg"));
} catch (IOException e) {
e.printStackTrace();
}
}
};
primaryStage.show();
}
示例2: initUI
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@PostConstruct
void initUI(BorderPane pane) {
try {
Button EnterButton = new Button();
TextArea textbox = new TextArea();
EnterButton.setText("Send Data");
EnterButton.setOnAction((event) -> {
String tmp = textbox.getText();
Helper.handleButton(tmp);
});
textbox.setMaxWidth(500);
textbox.setMaxHeight(100);
textbox.setWrapText(true);
textbox.setText("Type your sentence here");
pane.setLeft(EnterButton);
pane.setCenter(textbox);
}
catch (Exception e)
{
e.printStackTrace();
}
}
示例3: createHeader
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
/**
* Creates the header part for each cell. The header consists of a border pane
* with the weekday label in the "left" position and the date label in the "right"
* position.
*
* @return the header node
*/
protected Node createHeader() {
headerPane = new BorderPane();
headerPane.getStyleClass().add(AGENDA_VIEW_HEADER);
headerPane.setVisible(headerPaneVisible);
headerPane.managedProperty().bind(headerPane.visibleProperty());
weekdayLabel = new Label();
weekdayLabel.getStyleClass().add(AGENDA_VIEW_WEEKDAY_LABEL);
weekdayLabel.setMinWidth(0);
dateLabel = new Label();
dateLabel.setMinWidth(0);
dateLabel.getStyleClass().add(AGENDA_VIEW_DATE_LABEL);
headerPane.setLeft(weekdayLabel);
headerPane.setRight(dateLabel);
return headerPane;
}
示例4: initializeInputControls
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
private Node initializeInputControls(){
GridPane activatablecontrols = new GridPane();
activatablecontrols.setAlignment(Pos.CENTER);
activatablecontrols.setPadding(new Insets(10.0));
activatablecontrols.setVgap(10.0);
activatablecontrols.setHgap(10.0);
controlsActivatable_Pane = activatablecontrols;
GridPane inputcontrols = new GridPane();
inputcontrols.setAlignment(Pos.CENTER);
inputcontrols.setPadding(new Insets(10.0));
inputcontrols.setVgap(10.0);
inputcontrols.setHgap(15.0);
controlsInput_Pane = inputcontrols;
VBox estopBox = new VBox();
estopBox.setSpacing(5.0);
estopBox.setPadding(new Insets(10.0));
estopBox.setAlignment(Pos.CENTER);
estopBox.getChildren().addAll(Dashboard.getEmergencyStopControl().getRoot());
SplitPane controlsPane = new SplitPane();
controlsPane.setOrientation(Orientation.HORIZONTAL);
controlsPane.getItems().addAll(inputcontrols, activatablecontrols);
controlsPane.setMinSize(800.0, 150.0);
BorderPane root = new BorderPane();
root.setLeft(controlsPane);
root.setRight(estopBox);
return root;
}
示例5: createIconContent
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public static Node createIconContent() {
StackPane sp = new StackPane();
BorderPane borderPane = new BorderPane();
Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
rectangle.setStroke(Color.BLACK);
borderPane.setPrefSize(rectangle.getWidth(), rectangle.getHeight());
Rectangle recTop = new Rectangle(62, 5, Color.web("#349b00"));
recTop.setStroke(Color.BLACK);
Rectangle recBottom = new Rectangle(62, 14, Color.web("#349b00"));
recBottom.setStroke(Color.BLACK);
Rectangle recLeft = new Rectangle(20, 41, Color.TRANSPARENT);
recLeft.setStroke(Color.BLACK);
Rectangle recRight = new Rectangle(20, 41, Color.TRANSPARENT);
recRight.setStroke(Color.BLACK);
Rectangle centerRight = new Rectangle(20, 41, Color.TRANSPARENT);
centerRight.setStroke(Color.BLACK);
borderPane.setRight(recRight);
borderPane.setTop(recTop);
borderPane.setLeft(recLeft);
borderPane.setBottom(recBottom);
borderPane.setCenter(centerRight);
sp.getChildren().addAll(rectangle, borderPane);
return new Group(sp);
}
示例6: formatcomment
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public static BorderPane formatcomment(String timestamp, String comment){
BorderPane notice = new BorderPane();
notice.setPadding(new Insets(0,-20,0,10));
notice.setMaxWidth(340);
VBox noticeVB = new VBox(5);
noticeVB.setStyle("-fx-background-color: transparent; -fx-border-color: #333; -fx-border-width: 1,1,1,1; -fx-border-radius: 10; -fx-text-color: #333;");
Label commentLabel = new Label(comment);
commentLabel.setPadding(new Insets(5));
commentLabel.setFont(new Font("Cambria", 16));
commentLabel.setTextFill(Color.web("#191919"));
commentLabel.setWrapText(true);
commentLabel.setMaxWidth(320);
commentLabel.setAlignment(Pos.BOTTOM_LEFT);
Label time = new Label(timeStampChangeFormat.timeStampChangeFormat(timestamp));
time.setFont(new Font("Cambria", 12));
time.setTextFill(Color.web("#4c4c4c"));
time.setPadding(new Insets(5));
time.setMaxWidth(320);
time.setAlignment(Pos.BOTTOM_LEFT);
noticeVB.getChildren().addAll(commentLabel,time);
notice.setLeft(noticeVB);
noticeVB.setStyle("-fx-background-color: #fff");
return notice;
}
示例7: createLevelView
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
private void createLevelView (BorderPane gamePane) {
gamePane.setRight(mySideBar.draw());
gamePane.setLeft(myDisplay.draw());
gamePane.setTop(myTools.draw());
gamePane.setCenter(myRenderer.getPane());
addRendererClip();
}
示例8: start
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
originalImageView = new ImageView();
originalImageView.setFitHeight(sceneHeight);
originalImageView.setFitWidth(sceneWidth/2);
alteredImageView = new ImageView();
alteredImageView.setFitHeight(sceneHeight);
alteredImageView.setFitWidth(sceneWidth/2);
BorderPane pane = new BorderPane();
pane.setLeft(originalImageView);
pane.setRight(alteredImageView);
Scene scene = new Scene(pane, sceneWidth, sceneHeight);
primaryStage.setTitle("Image Segmentation App");
primaryStage.setScene(scene);
primaryStage.show();
BufferedImage originalImg = ImageIO.read(new File("./images/test.png"));
originalImageView.setImage(SwingFXUtils.toFXImage(originalImg, null));
int numOfClusters = 2;
ImageMatrix imageMatrix = new ImageMatrix(originalImg, numOfClusters);
Algorithm algorithm = new KMeansAlgorithm(imageMatrix);
algorithm.process();
BufferedImage segmentedImg = imageMatrix.getSegmentedImage();
alteredImageView.setImage(SwingFXUtils.toFXImage(segmentedImg, null));
}
示例9: buildUI
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
private Parent buildUI() {
BorderPane root = new BorderPane();
Insets margin = new Insets(10);
Node leftPane = buildLeftPane();
Node bottomPane = buildBottomPane();
Node centerPane = buildCenterPane();
root.setLeft(leftPane);
root.setBottom(bottomPane);
root.setCenter(centerPane);
BorderPane.setMargin(bottomPane, margin);
BorderPane.setMargin(centerPane, margin);
return root;
}
示例10: createRegisterControlPanel
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
private Node createRegisterControlPanel()
{
BorderPane registerPanel = new BorderPane();
Label watchRegisterLabel = new Label("Watch Register: ");
registerPanel.setLeft(watchRegisterLabel);
setAlignment(watchRegisterLabel, Pos.CENTER);
TextField registerNameField = new TextField();
registerPanel.setCenter(registerNameField);
setAlignment(registerNameField, Pos.CENTER);
Button watchRegisterButton = new Button("Add");
watchRegisterButton.setOnAction((event) -> watchRegister(registerNameField
.getText()));
registerPanel.setRight(watchRegisterButton);
setAlignment(watchRegisterButton, Pos.CENTER);
Pair<Node, ComboBox<String>> optionsRowPair = createDisplayOptionsRow();
Node displayOptions = optionsRowPair.getKey();
ComboBox<String> displayDropdown = optionsRowPair.getValue();
displayDropdown.setOnAction((event) -> {
String selection = displayDropdown.getSelectionModel().getSelectedItem();
Function<Long, String> function = valueDisplayOptions.get(selection);
registerDisplayFunction.set(function);
});
VBox controlPanel = new VBox();
controlPanel.getChildren().add(registerPanel);
controlPanel.getChildren().add(displayOptions);
controlPanel.setAlignment(Pos.CENTER);
setAlignment(controlPanel, Pos.CENTER);
controlPanel.setPadding(new Insets(CP_PADDING));
controlPanel.setSpacing(CP_SPACING);
return controlPanel;
}
示例11: createDisplayOptionsRow
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
private Pair<Node, ComboBox<String>> createDisplayOptionsRow()
{
BorderPane rowDisplay = new BorderPane();
Label label = new Label("Display values as: ");
rowDisplay.setLeft(label);
ComboBox<String> dropdown = createDisplayOptionsDropdown();
dropdown.setPrefWidth(Integer.MAX_VALUE);
rowDisplay.setCenter(dropdown);
return new Pair<>(rowDisplay, dropdown);
}
示例12: start
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
StackPane centerPane = new StackPane();
Button centerButton = new Button();
centerButton.setText("Center");
centerButton.setOnAction( new ButtonEventHandler("Center") );
centerPane.getChildren().add(centerButton);
StackPane bottomPane = new StackPane();
Button bottomButton = new Button();
bottomButton.setText("Bottom");
bottomButton.setOnAction( new ButtonEventHandler("Bottom") );
bottomPane.getChildren().add(bottomButton);
StackPane topPane = new StackPane();
Button topButton = new Button();
topButton.setText("Top");
topButton.setOnAction( new ButtonEventHandler("Top") );
topPane.getChildren().add(topButton);
StackPane leftPane = new StackPane();
Button leftButton = new Button();
leftButton.setText("Left");
leftButton.setOnAction( new ButtonEventHandler("Left") );
leftPane.getChildren().add(leftButton);
IHasAButton button = new IHasAButton("SOmething else");
StackPane rightPane = new StackPane();
Button rightButton = new Button();
rightButton.setText("Right");
rightButton.setOnAction( new ButtonEventHandler("Right") );
rightPane.getChildren().add(rightButton);
BorderPane root = new BorderPane();
root.setCenter(centerPane);
root.setTop(topPane);
root.setBottom(bottomPane);
root.setLeft(leftPane);
root.setRight(button.getStackPane());
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
示例13: buildStatusBar
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
private BorderPane buildStatusBar() {
BorderPane statusBar = new BorderPane();
statusBar.setLeft(statusLabel);
statusBar.setRight(bytesBar);
return statusBar;
}
示例14: ConfigurationContext
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
private ConfigurationContext(GazePlay gazePlay, BorderPane root, Scene scene) {
super(gazePlay, root, scene);
HomeButton homeButton = createHomeButtonInConfigurationManagementScreen(gazePlay);
HBox rightControlPane = new HBox();
ControlPanelConfigurator.getSingleton().customizeControlePaneLayout(rightControlPane);
rightControlPane.setAlignment(Pos.CENTER_RIGHT);
rightControlPane.getChildren().add(homeButton);
HBox leftControlPane = new HBox();
ControlPanelConfigurator.getSingleton().customizeControlePaneLayout(leftControlPane);
leftControlPane.setAlignment(Pos.CENTER_LEFT);
BorderPane bottomControlPane = new BorderPane();
bottomControlPane.setLeft(leftControlPane);
bottomControlPane.setRight(rightControlPane);
root.setBottom(bottomControlPane);
GridPane gridPane = buildConfigGridPane(this);
root.setCenter(gridPane);
root.setStyle(
"-fx-background-color: rgba(0, 0, 0, 1); -fx-background-radius: 8px; -fx-border-radius: 8px; -fx-border-width: 5px; -fx-border-color: rgba(60, 63, 65, 0.7); -fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, 0.8), 10, 0, 0, 0);");
}
示例15: display
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public static void display() {
window = new Stage();
window.setTitle("Home");
Label titleLabel = new Label("Master Hash");
titleLabel.setFont(Font.font("Verdana", FontWeight.BOLD, 30));
titleLabel.setAlignment(Pos.CENTER);
Button newLoginButton = new Button();
newLoginButton.setText("New Login");
newLoginButton.setOnAction(e -> NewLogin.display());
TableColumn<Table, String> nameCol = new TableColumn<>("Name");
nameCol.setMinWidth(200);
nameCol.setCellValueFactory(new PropertyValueFactory<>("name"));
TableColumn<Table, String> usernameCol = new TableColumn<>("Username");
usernameCol.setMinWidth(200);
usernameCol.setCellValueFactory(new PropertyValueFactory<>("username"));
TableColumn<Table, String> passwordCol = new TableColumn<>("Password");
passwordCol.setMinWidth(200);
passwordCol.setCellValueFactory(new PropertyValueFactory<>("password"));
BorderPane borderPane = new BorderPane();
borderPane.setLeft(titleLabel);
borderPane.setRight(newLoginButton);
borderPane.setPadding(new Insets(20, 20, 10, 20));
table = new TableView<>();
table.setItems(getTable());
ObservableList<TableColumn<Table, ?>> columns = table.getColumns();
columns.add(nameCol);
columns.add(usernameCol);
columns.add(passwordCol);
VBox vBox = new VBox(10);
vBox.getChildren().addAll(borderPane, table);
Scene scene = new Scene(vBox, 600, 600);
window.setScene(scene);
window.show();
}