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


Java FlowPane.setPadding方法代码示例

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


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

示例1: initializeFlowPane

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private void initializeFlowPane() {
    LoggerFacade.getDefault().trace(this.getClass(), "Initialize FlowPane"); // NOI18N
    
    fpTerms = new FlowPane(7.0d, 7.0d);
    fpTerms.setPadding(DEFAULT_PADDING);
    fpTerms.setStyle("-fx-background-color:POWDERBLUE"); // NOI18N
    HBox.setHgrow(fpTerms, Priority.ALWAYS);
    
    super.getChildren().add(fpTerms);
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:11,代码来源:SignFlowPane.java

示例2: getTimerButtonsPane

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private FlowPane getTimerButtonsPane() {
    FlowPane timerButtonsPane = new FlowPane();
    timerButtonsPane.getChildren().add(resetButton);
    timerButtonsPane.getChildren().add(changeStateButton);
    timerButtonsPane.setHgap(10);
    timerButtonsPane.setPadding(new Insets(0, 0, 25, 0));
    timerButtonsPane.setAlignment(Pos.CENTER);
    return timerButtonsPane;
}
 
开发者ID:softish,项目名称:KetchupDesktop,代码行数:10,代码来源:KetchupDesktopView.java

示例3: getSignOutButtonPane

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private FlowPane getSignOutButtonPane() {
    FlowPane signOutButtonPane = new FlowPane();
    signOutButtonPane.setPadding(new Insets(25, 25, 25, 25));
    signOutButtonPane.setHgap(10);
    signOutButtonPane.getChildren().add(signedInUserLabel);
    signOutButtonPane.getChildren().add(currentUserLabel);
    signOutButtonPane.getChildren().add(signOutButton);
    return signOutButtonPane;
}
 
开发者ID:softish,项目名称:KetchupDesktop,代码行数:10,代码来源:KetchupDesktopView.java

示例4: getUserButtonsPane

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private FlowPane getUserButtonsPane() {
    FlowPane userButtonsPane = new FlowPane();
    userButtonsPane.getChildren().add(signInButton);
    userButtonsPane.getChildren().add(registerButton);
    userButtonsPane.setAlignment(Pos.CENTER);
    userButtonsPane.setHgap(10);
    userButtonsPane.setPadding(new Insets(25, 25, 25, 25));
    return userButtonsPane;
}
 
开发者ID:softish,项目名称:KetchupDesktop,代码行数:10,代码来源:SignInView.java

示例5: showAboutWindow

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private void showAboutWindow()
{
	String appName = Main.appTitle;
	String version = Main.releaseVersion;
	String website = Main.website;
	String email = Main.email;
	String copyrightNotice = Main.copyrightNotice;

	Alert about = new Alert(AlertType.INFORMATION, "About " + appName);
	about.initOwner(getStage());
	about.setTitle("About " + appName);
	about.setHeaderText(appName + " version " + version);
	
	FlowPane infoPane = generateLabelAndLinkPane("For more information visit", website, Font.getDefault().getSize() + 2);
	infoPane.setPadding(new Insets(0, 0, 15, 0));
	
	FlowPane copyright = generateLabelAndLinkPane(copyrightNotice, "mailto:" + email, Font.getDefault().getSize());
	Hyperlink mailLink = (Hyperlink) copyright.getChildren().get(1);
	mailLink.setText(email);
	copyright.setPadding(new Insets(0, 0, 15, 0));
	
	VBox aboutVBox = new VBox();
	aboutVBox.getChildren().addAll(infoPane, copyright, getAttributionLinksForAboutDialog());
	about.getDialogPane().setContent(aboutVBox);
	about.getDialogPane().setPrefWidth(440);
	
	about.showAndWait();
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:29,代码来源:GUIController.java

示例6: AddTab

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private void AddTab(Overlay[] overlays, String tabName)
{
	Tab tab = new Tab(tabName);
	FlowPane panel = new FlowPane(Orientation.HORIZONTAL);
	ScrollPane scrollPane = new ScrollPane(panel);
	scrollPane.setFitToWidth(true);
	
	panel.setPadding(new Insets(5));
	
	for (Overlay overlay : overlays)
	{
		Button b = new Button();
		b.setPrefHeight(30);
		b.setPrefWidth(30);
		b.graphicProperty().set(overlay.PaneThumbnail());
		b.tooltipProperty().set(new Tooltip(overlay.Name));
		b.addEventHandler(ActionEvent.ACTION, event ->
		{
			String name = b.getTooltip().getText();
			switch (name)
			{
				case "flag":
					LoadFlag();
					break;
				case "image":
					LoadImage();
					break;
				default:
					SetSelectedOverlay(OverlayFactory.GetInstanceByShortName(name, _defaultMaximumX, _defaultMaximumY));
					break;
			}
		});
		panel.getChildren().add(b);
	}
	
	tab.setContent(scrollPane);
	tabs.getTabs().add(tab);
}
 
开发者ID:andrewsarnold,项目名称:FlagMaker-2,代码行数:39,代码来源:OverlaySelector.java

示例7: createStad

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
/**
 * FlowPane met GebouwKaartViews
 */
private void createStad() {
    stadPane = new FlowPane();
    stadPane.setPadding(new Insets(125, 0, 5, 50));
    stadPane.setVgap(-40);
    stadPane.setHgap(-15);
    stadPane.setPrefWrapLength(360);
    // Loop  door gebouwKaartViews en voeg ze toe aan het FlowPane
    for (GebouwKaartView gebouwKaartView: gebouwKaartViews) {
        stadPane.getChildren().add(gebouwKaartView.view()); // Voeg view to aan Pane
    }
}
 
开发者ID:Badmuts,项目名称:Machiavelli,代码行数:15,代码来源:StadView.java

示例8: addCurrenciesGrid

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private void addCurrenciesGrid(boolean isEditable) {
    Label label = addLabel(gridPane, ++gridRow, Res.get("payment.supported.okpay"), 0);
    GridPane.setValignment(label, VPos.TOP);
    FlowPane flowPane = new FlowPane();
    flowPane.setPadding(new Insets(10, 10, 10, 10));
    flowPane.setVgap(10);
    flowPane.setHgap(10);

    if (isEditable)
        flowPane.setId("flow-pane-checkboxes-bg");
    else
        flowPane.setId("flow-pane-checkboxes-non-editable-bg");

    CurrencyUtil.getAllOKPayCurrencies().stream().forEach(e ->
    {
        CheckBox checkBox = new AutoTooltipCheckBox(e.getCode());
        checkBox.setMouseTransparent(!isEditable);
        checkBox.setSelected(okPayAccount.getTradeCurrencies().contains(e));
        checkBox.setMinWidth(60);
        checkBox.setMaxWidth(checkBox.getMinWidth());
        checkBox.setTooltip(new Tooltip(e.getName()));
        checkBox.setOnAction(event -> {
            if (checkBox.isSelected())
                okPayAccount.addCurrency(e);
            else
                okPayAccount.removeCurrency(e);

            updateAllInputsValid();
        });
        flowPane.getChildren().add(checkBox);
    });

    GridPane.setRowIndex(flowPane, gridRow);
    GridPane.setColumnIndex(flowPane, 1);
    gridPane.getChildren().add(flowPane);
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:37,代码来源:OKPayForm.java

示例9: createAssignedUserPane

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private FlowPane createAssignedUserPane() {
    FlowPane assignedUserPane = new FlowPane();
    assignedUserPane.setPadding(new Insets(5, 5, 5, 5));
    assignedUserPane.setHgap(3);
    assignedUserPane.setVgap(5);
    assignedUserPane.setStyle("-fx-border-radius: 3;");
    assignedUserPane.setId(IdGenerator.getAssigneePickerAssignedUserPaneId());
    return assignedUserPane;
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:10,代码来源:AssigneePickerDialog.java

示例10: createGroupPane

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private FlowPane createGroupPane(Insets padding) {
    FlowPane group = new FlowPane();
    group.setHgap(5);
    group.setVgap(5);
    group.setPadding(padding);
    return group;
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:8,代码来源:LabelPickerDialog.java

示例11: createRepoPane

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private FlowPane createRepoPane(Insets padding) {
    FlowPane repo = new FlowPane();
    repo.setHgap(5);
    repo.setVgap(5);
    repo.setPadding(padding);
    return repo;
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:8,代码来源:IssuePickerDialog.java

示例12: TokenInputSearchFlowControl

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
public TokenInputSearchFlowControl() {
	super();
	this.content = this;
	setPadding(new Insets(3));
	setSpacing(3);
	getStyleClass().add("tokenInput");
	itemsFlowBox = new FlowPane();
	itemsFlowBox.setVgap(6);
	itemsFlowBox.setPadding(new Insets(2,0,2,0));
	
	StringBuilder sb = new StringBuilder("-fx-background-color:linear-gradient(from 0px -19px to 0px 0px , repeat, #EEEEEE 76% , #CCC9C1 79% , #FFF0C7 89% );");
	sb.append("-fx-border-color:#CCC9C1;");
	sb.append("-fx-border-width:0px 1.5px 0px 1.5px;");
	sb.append("-fx-border-style: segments(62,14) phase 35;");
	itemsFlowBox.setStyle(sb.toString());
	
	getChildren().add(StackPaneBuilder.create().children(itemsFlowBox).style("-fx-background-color:#FFF0C7").padding(new Insets(0,10,3,10)).build());
	configureSearchField();
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:20,代码来源:TokenInputSearchFlowControl.java

示例13: start

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
	Rotate rotate = new Rotate();
	JFXButton button = new JFXButton("Rotation");
	button.getTransforms().add(rotate);
	button.addEventHandler(MouseEvent.MOUSE_CLICKED, e ->{
			angle += 10;
			rotate.setAngle(angle);
			rotate.setPivotX(button.getWidth()/2);
			rotate.setPivotY(button.getHeight()/2);
	});
	FlowPane root = new FlowPane();
	root.setAlignment(Pos.CENTER);
	root.setPadding(new Insets(25,25,25, angle));
	root.getChildren().add(button);
	Scene scene = new Scene(root,300,250);
	primaryStage.setTitle("Button Animation");
	primaryStage.setScene(scene);
	primaryStage.show();
	
}
 
开发者ID:naeemkhan12,项目名称:JavaFx-Material-Design,代码行数:22,代码来源:AnimatedButton.java

示例14: getFileExplorerViewCenter

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private ScrollPane getFileExplorerViewCenter(String pathName, String[] files) {
    pathName = pathName.replace("\\", "/");
    Button directoryUp = new Button("Up a directory");
    directoryUp.setOnAction(e -> {
        try {
            client.clientCommunicate("DIRECTORYUP");
        } catch (IOException e1) {
            Logger.log(Level.ERROR, e1.toString());
        }
    });
    Label title = (Label) Styler.styleAdd(new Label("Current Directory:"), "title");
    Label pathLabel = (Label) Styler.styleAdd(new Label(pathName), "label-bright");
    pathLabel.setWrapText(true);
    HBox pathNameBox = Styler.hContainer(5, Styler.vContainer(10, title, pathLabel, directoryUp));
    pathNameBox.setPrefHeight(100);
    pathNameBox.setPrefWidth(200);
    pathNameBox.setPadding(new Insets(5, 5, 5, 5));

    FlowPane flow = new FlowPane();
    flow.getChildren().add(pathNameBox);
    flow.setPadding(new Insets(10, 50, 10, 50));
    flow.getStylesheets().add(getClass().getResource("/css/global.css").toExternalForm());
    flow.setId("file-pane");
    flow.setVgap(10);
    flow.setHgap(10);
    flow.setAlignment(Pos.CENTER);
    HBox icons[] = new HBox[files.length];
    int rot = 0;
    for (String s : files) {
        HBox hBox = new HBox();
        hBox.setAlignment(Pos.CENTER);
        hBox.setPrefWidth(100);
        hBox.setPrefHeight(100);
        hBox.setId("file-icon");
        hBox.setPadding(new Insets(5, 5, 5, 5));
        VBox vBox = new VBox(5);
        vBox.setAlignment(Pos.CENTER);
        Label label;
        label = (Label) Styler.styleAdd(new Label(s), "label-bright");
        Tooltip t = new Tooltip(s);
        Tooltip.install(hBox, t);
        vBox.getChildren().addAll(new ImageView(new Image("/Images/Icons/FileExplorer/" + getExtensionImage(s))), label);
        hBox.getChildren().add(vBox);
        hBox.setOnMouseClicked(event -> {
            if (event.getButton().equals(MouseButton.SECONDARY)) {
                if (getExtensionImage(s).contains("folder.png")) {
                    FileContextMenu.getDirectoryMenu(hBox, s, event, client);
                } else {
                    FileContextMenu.getFileContextMenu(hBox, s, event, client);
                }
            }
        });
        icons[rot] = hBox;
        flow.getChildren().add(icons[rot]);
        rot++;
    }
    ScrollPane scroll = new ScrollPane();
    scroll.setId("scroll-pane");
    scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);    // Horizontal scroll bar
    scroll.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);    // Vertical scroll bar
    scroll.setContent(flow);
    scroll.viewportBoundsProperty().addListener((ov, oldBounds, bounds) -> {
        flow.setPrefWidth(bounds.getWidth());
        flow.setPrefHeight(bounds.getHeight());
    });
    return scroll;
}
 
开发者ID:Ghosts,项目名称:Maus,代码行数:68,代码来源:FileExplorerView.java

示例15: getIconFlow

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private FlowPane getIconFlow() {
    FlowPane flow = new FlowPane();
    flow.setPadding(new Insets(10, 50, 10, 50));
    flow.getStylesheets().add(getClass().getResource("/css/global.css").toExternalForm());
    flow.setId("iconFlow");
    flow.setVgap(15);
    flow.setHgap(15);

    HBox icons[] = new HBox[8];
    for (int i = 0; i < 7; i++) {
        HBox hBox = new HBox();
        hBox.setAlignment(Pos.CENTER);
        hBox.setPadding(new Insets(10, 10, 10, 10));
        hBox.setPrefWidth(115);
        hBox.setId("icon");

        VBox vBox = new VBox(10);
        vBox.setAlignment(Pos.CENTER);
        Label label;
        switch (i) {
            case 0:
                label = (Label) Styler.styleAdd(new Label("Clients"), "label-bright");
                vBox.getChildren().addAll(new ImageView(new Image(getClass().getResourceAsStream("/Images/Icons/clients.png"))), label);
                hBox.getChildren().add(vBox);
                icons[0] = hBox;
                icons[0].setOnMouseClicked(event -> Controller.changePrimaryStage(new ClientView().getClientView()));
                break;
            case 1:
                label = (Label) Styler.styleAdd(new Label("Build"), "label-bright");
                vBox.getChildren().addAll(new ImageView(new Image(getClass().getResourceAsStream("/Images/Icons/build.png"))), label);
                hBox.getChildren().addAll(vBox);
                icons[1] = hBox;
                icons[1].setOnMouseClicked(event -> Controller.changePrimaryStage(new ClientBuilderView().getClientBuilderView()));
                break;
            case 2:
                label = (Label) Styler.styleAdd(new Label("Mutate"), "label-bright");
                vBox.getChildren().addAll(new ImageView(new Image(getClass().getResourceAsStream("/Images/Icons/mutate.png"))), label);
                hBox.getChildren().addAll(vBox);
                icons[2] = hBox;
                break;
            case 3:
                label = (Label) Styler.styleAdd(new Label("Beacon"), "label-bright");
                vBox.getChildren().addAll(new ImageView(new Image(getClass().getResourceAsStream("/Images/Icons/beacon.png"))), label);
                hBox.getChildren().addAll(vBox);
                icons[3] = hBox;
                break;
            case 4:
                label = (Label) Styler.styleAdd(new Label("Statistics"), "label-bright");
                vBox.getChildren().addAll(new ImageView(new Image(getClass().getResourceAsStream("/Images/Icons/statistics.png"))), label);
                hBox.getChildren().addAll(vBox);
                icons[4] = hBox;
                icons[4].setOnMouseClicked(event -> Controller.changePrimaryStage(new StatisticsView().getStatisticsView()));
                break;
            case 5:
                label = (Label) Styler.styleAdd(new Label("Updates"), "label-bright");
                vBox.getChildren().addAll(new ImageView(new Image(getClass().getResourceAsStream("/Images/Icons/updates.png"))), label);
                hBox.getChildren().addAll(vBox);
                icons[5] = hBox;
                icons[5].setOnMouseClicked(event -> Controller.changePrimaryStage(new UpdatesView().getUpdatesView()));
                break;
            case 6:
                label = (Label) Styler.styleAdd(new Label("Settings"), "label-bright");
                vBox.getChildren().addAll(new ImageView(new Image(getClass().getResourceAsStream("/Images/Icons/settings.png"))), label);
                hBox.getChildren().addAll(vBox);
                icons[6] = hBox;
                icons[6].setOnMouseClicked(event -> Controller.changePrimaryStage(new SettingsView().getSettingsView()));
                break;
            case 7:
                break;
            default:
                break;
        }
        flow.getChildren().add(icons[i]);
    }
    return flow;
}
 
开发者ID:Ghosts,项目名称:Maus,代码行数:77,代码来源:MainView.java


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