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


Java Pane.getChildren方法代码示例

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


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

示例1: positionToButtonIndex

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
/**
 * Get the index into the panes children that this node should be inserted to.
 * @param screenX Drop screen x position
 * @param screenY Drop screen y position
 * @param pane The pane of interest.
 * @return The index to insert the button into the panes children.
 */
private int positionToButtonIndex(Pane pane, double screenX, double screenY) {
    int idx = pane.getChildren().size();
    for (Node node: pane.getChildren()) {
        Bounds bounds = node.localToScreen(node.getBoundsInLocal());
        if (bounds.contains(screenX, screenY)) {
            idx = pane.getChildren().indexOf(node);
        }
    }
    return idx;
}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:18,代码来源:DragPaneDecorator.java

示例2: clear

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
/**
 * Clear children of a pane.
 *
 * @param pane the pane.
 */
@FXThread
public static void clear(@NotNull final Pane pane) {
    final ObservableList<Node> children = pane.getChildren();
    children.forEach(UIUtils::unbind);
    children.clear();
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:12,代码来源:UIUtils.java

示例3: resetGraphColor

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
/**
 * Imposta il colore c come colore di tutti i figli del pannello passato
 * @param graphPane padre dei componenti grafici da colorare.
 * @param c colore da applicare agli elementi
 */
public static void resetGraphColor(final Pane graphPane, final Color c) {
	for (javafx.scene.Node n : graphPane.getChildren()) {
		if (n instanceof Arrow)
			((Arrow) n).setColor(c);	// coloro la freccia di nero
		else {
			StackPane sp = ((StackPane) n);
			
			// coloro il cerchio ed il testo di nero
((Shape) sp.getChildren().get(0)).setStroke(c);
((Shape) sp.getChildren().get(1)).setStroke(c);
		}
	}
}
 
开发者ID:steppp,项目名称:Breadth-First-Search,代码行数:19,代码来源:MainController.java

示例4: renderAccountCard

import javafx.scene.layout.Pane; //导入方法依赖的package包/类
private void renderAccountCard(Account account) {
	Pane pane = new AnchorPane();
	addCssClass(pane, "account-card");
	pane.setPrefHeight(70.0);
	pane.setMinHeight(70.0);
	pane.setMaxHeight(70.0);
	List<Node> children = pane.getChildren();

	Label domainLabel = new Label(account.getDomain());
	children.add(domainLabel);
	addCssClass(domainLabel, "domain-label");
	UiCommons.assignAnchors(domainLabel, 5.0, 100.0, null, 5.0);

	Label usernameLabel = new Label(account.getUsername());
	children.add(usernameLabel);
	addCssClass(usernameLabel, "username-label");
	UiCommons.assignAnchors(usernameLabel, 10.0, 100.0, 15.0, 10.0);

	Button showButton = new Button("Show");
	children.add(showButton);
	addCssClass(showButton, "control");
	showButton.setFocusTraversable(false);
	showButton.setOnAction(event -> showModal(new PasswordRevealModal(), account));
	UiCommons.assignAnchors(showButton, 5.0, 10.0, null, null);

	MenuButton accountMenu = new MenuButton("\u2699");
	children.add(accountMenu);
	addCssClass(accountMenu, "control");
	accountMenu.setFocusTraversable(false);
	UiCommons.assignAnchors(accountMenu, null, 10.0, 5.0, null);

	List<MenuItem> menuItems = accountMenu.getItems();
	MenuItem updateMenuItem = new MenuItem("Update");
	menuItems.add(updateMenuItem);
	updateMenuItem.setOnAction(event -> showModalWithReload(new SaveAccountModal(), Optional.of(account)));

	MenuItem deleteMenuItem = new MenuItem("Delete");
	menuItems.add(deleteMenuItem);
	deleteMenuItem.setOnAction(event -> showModalWithReload(new DeleteAccountModal(), account));

	viewPane.getChildren()
			.add(pane);
}
 
开发者ID:kana0011,项目名称:symmetrical-memory,代码行数:44,代码来源:MainFormController.java


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