当前位置: 首页>>代码示例>>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;未经允许,请勿转载。