當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。