當前位置: 首頁>>代碼示例>>Java>>正文


Java TreeItem.isLeaf方法代碼示例

本文整理匯總了Java中javafx.scene.control.TreeItem.isLeaf方法的典型用法代碼示例。如果您正苦於以下問題:Java TreeItem.isLeaf方法的具體用法?Java TreeItem.isLeaf怎麽用?Java TreeItem.isLeaf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.TreeItem的用法示例。


在下文中一共展示了TreeItem.isLeaf方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: changed

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
@Override public void changed(ObservableValue<? extends TreeItem<Object>> observable, TreeItem<Object> oldValue,
        TreeItem<Object> newValue) {
    if (newValue == null) {
        okButton.setDisable(true);
        documentArea.setText("");
        argumentPane.getChildren().clear();
        return;
    }
    TreeItem<Object> item = tree.getSelectionModel().getSelectedItem();
    String doc = "";
    boolean disable = true;
    functionItem = item;
    Object value = item.getValue();
    if (value instanceof Module) {
        doc = ((Module) value).getDocumentation();
    } else {
        doc = ((Function) value).getDocumentation();
        disable = false;
    }
    okButton.setDisable(disable);
    documentArea.setText(doc);
    argumentPane.getChildren().clear();
    if (item.isLeaf()) {
        addArguments(item);
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:27,代碼來源:FunctionStage.java

示例2: onNextFailure

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
public void onNextFailure() {
    if (testTree.getRoot() == null) {
        return;
    }
    TreeItem<Test> item = testTree.getSelectionModel().getSelectedItem();
    TestTreeItem nextFailure = null;
    if (item != null) {
        if (item.isLeaf()) {
            nextFailure = findNextFailureInSiblings((TestTreeItem) item);
        } else {
            nextFailure = findNextFailureInChildren((TestTreeItem) item, true);
        }
    } else {
        nextFailure = findNextFailureInChildren((TestTreeItem) testTree.getRoot(), false);
    }
    if (nextFailure == null) {
        return;
    }
    isExpandNeeded(nextFailure);
    int failureIndex = testTree.getRow(nextFailure);
    testTree.getSelectionModel().clearAndSelect(failureIndex);
    testTree.scrollTo(failureIndex);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:24,代碼來源:TestRunner.java

示例3: findNextFailureInChildren

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
private TestTreeItem findNextFailureInChildren(TestTreeItem parent, boolean findInSibling) {
    TestTreeItem found = null;
    for (TreeItem<Test> child : parent.getChildren()) {
        if (child.isLeaf()
                && (((TestTreeItem) child).getState() == State.FAILURE || ((TestTreeItem) child).getState() == State.ERROR)) {
            found = (TestTreeItem) child;
            break;
        } else {
            found = findNextFailureInChildren((TestTreeItem) child, findInSibling);
            if (found != null) {
                break;
            }
        }
    }
    if (found == null && findInSibling) {
        TestTreeItem sib = (TestTreeItem) parent.nextSibling();
        if (isFailure(sib)) {
            found = sib;
        } else {
            if (sib != null) {
                found = findNextFailureInChildren(sib, true);
            }
        }
    }
    return found;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:27,代碼來源:TestRunner.java

示例4: LinkToTreeClass

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
private void LinkToTreeClass(TreeItem<TypeController> tree){
	
	if(tree.getValue() != null && tree.getValue().getType().getName().equals(this.classe.getName())) {
		this.treeClass = tree.getValue();
		this.treeClassTreeItem = tree;
		tree.getValue().getClassNameController().addObserver(this);
		tree.getValue().getClassColorController().addObserver(this);
		tree.getValue().getAddPropertySchemeController().addObserver(this);	
		tree.getValue().getRemovePropertySchemeController().addObserver(this);
		tree.getValue().GetAddPropertySchemeWithValueController().addObserver(this);
		tree.getValue().getAddClassSchemeController().addObserver(this);
		tree.getValue().getRemoveClassSchemeController().addObserver(this);
		return;
	}
	
	if(!tree.isLeaf()) {
		for(TreeItem<TypeController> t : tree.getChildren()) {
			LinkToTreeClass(t);
		}
	}
}
 
開發者ID:coco35700,項目名稱:uPMT,代碼行數:22,代碼來源:TypeClassRepresentationController.java

示例5: sortTree

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
/**
 * Sorts tree nodes recursively in order of branches before leaves, then alphabetically.
 *
 * @param root the root node to sort
 */
private void sortTree(TreeItem<? extends SourceEntry> root) {
  if (!root.isLeaf()) {
    FXCollections.sort(root.getChildren(),
        branchesFirst.thenComparing(alphabetical));
    root.getChildren().forEach(this::sortTree);
  }
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:13,代碼來源:MainWindowController.java

示例6: sort

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
/**
 * Sorts tree nodes recursively in order of branches before leaves, then alphabetically.
 *
 * @param node the root node to sort
 */
private void sort(TreeItem<? extends SourceEntry> node) {
  if (!node.isLeaf()) {
    FXCollections.sort(node.getChildren(),
        branchesFirst.thenComparing(alphabetical));
    node.getChildren().forEach(this::sort);
  }
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:13,代碼來源:NetworkTableTreeWidget.java

示例7: expandTreeView

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
private void expandTreeView(TreeItem<Resource> item) {
    if (item != null && !item.isLeaf()) {
        item.setExpanded(true);
        for (TreeItem<Resource> child : item.getChildren()) {
            expandTreeView(child);
        }
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:9,代碼來源:ResourceView.java

示例8: collapseTreeView

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
private void collapseTreeView(TreeItem<?> item) {
    if (item != null && !item.isLeaf()) {
        item.setExpanded(false);
        for (TreeItem<?> child : item.getChildren()) {
            collapseTreeView(child);
        }
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:9,代碼來源:ResourceView.java

示例9: expandTreeView

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
private void expandTreeView(TreeItem<Test> item) {
    if (item != null && !item.isLeaf()) {
        item.setExpanded(true);
        for (TreeItem<Test> child : item.getChildren()) {
            expandTreeView(child);
        }
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:9,代碼來源:TestRunner.java

示例10: writeToParent

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
private void writeToParent(TreeItem<Test> parent, JSONObject parentJSON) {
    ObservableList<TreeItem<Test>> children = parent.getChildren();
    for (TreeItem<Test> child : children) {
        if (child.isLeaf()) {
            writeLeafToParent(child, parentJSON);
        } else {
            writeToParent(child, createParentJSONObject(child, parentJSON));
        }
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:11,代碼來源:TestRunner.java

示例11: expandTreeView

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
private void expandTreeView(TreeItem<?> item){
    if(item != null && !item.isLeaf()){
        item.setExpanded(true);
        for(TreeItem<?> child:item.getChildren()){
            expandTreeView(child);
        }
    }
}
 
開發者ID:ztan5,項目名稱:TechnicalAnalysisTool,代碼行數:9,代碼來源:MarketDataTreeViewNode.java

示例12: collapseTreeView

import javafx.scene.control.TreeItem; //導入方法依賴的package包/類
private void collapseTreeView(TreeItem<?> item){
    if(item != null && !item.isLeaf()){
        item.setExpanded(false);
        for(TreeItem<?> child:item.getChildren()){
            collapseTreeView(child);
        }
    }
}
 
開發者ID:ztan5,項目名稱:TechnicalAnalysisTool,代碼行數:9,代碼來源:MarketDataTreeViewNode.java


注:本文中的javafx.scene.control.TreeItem.isLeaf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。