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


Java TreeItem.setGraphic方法代码示例

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


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

示例1: createObject

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
void createObject(Path path, boolean isRoot) {
    if (isRoot) {
        TreeItem<Path> rootNode = setRootItem(path);
        treeView.setRoot(rootNode);
    } else {
        TreeItem<Path> parent = getItem(treeView.getRoot(), path.getParent());

        WatcherStructure watcherStructure = null;
        if (Files.isDirectory(path)) {
            watcherStructure = new WatcherStructure(path, project, tabUpdater, this);
        }

        TreeItem<Path> newItem = new CustomTreeItem(path, watcherStructure, project, tabUpdater, this);
        CustomIcons customIcons = new CustomIcons();
        if (Files.isDirectory(path)) {
            newItem.setGraphic(new ImageView(customIcons.getFolderCollapseImage()));
            newItem.expandedProperty().addListener(expanderListener());
        } else {
            newItem.setGraphic(new ImageView(customIcons.getFileImage()));
        }

        parent.getChildren().add(newItem);

        sortItemsInTree(parent);
    }
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:27,代码来源:TreeUpdater.java

示例2: expanderListener

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
public ChangeListener<Boolean> expanderListener() {
    return (observable, oldValue, newValue) -> {
        BooleanProperty bb = (BooleanProperty) observable;

        TreeItem t = (TreeItem) bb.getBean();

        CustomIcons customIcons = new CustomIcons();
        t.setGraphic(new ImageView(newValue ? customIcons.getFolderExpandImage() : customIcons.getFolderCollapseImage()));

        if (newValue) {
            scheduleHighlight();
        }
    };
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:15,代码来源:TreeUpdater.java

示例3: loadTVDataBase

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
/**
 * 加载数据库到树集
 * 
 * @throws Exception
 */
public void loadTVDataBase() throws Exception {
	TreeItem<String> rootTreeItem = tvDataBase.getRoot();
	rootTreeItem.getChildren().clear();
	List<DatabaseConfig> item = null;
	item = ConfigUtil.getDatabaseConfig();
	for (DatabaseConfig dbConfig : item) {
		TreeItem<String> treeItem = new TreeItem<String>();
		treeItem.setValue(dbConfig.getConnName());
		ImageView dbImage = new ImageView("image/database.png");
		dbImage.setFitHeight(20);
		dbImage.setFitWidth(20);
		dbImage.setUserData(dbConfig);
		treeItem.setGraphic(dbImage);
		rootTreeItem.getChildren().add(treeItem);
	}
}
 
开发者ID:shenzhenMirren,项目名称:vertx-generator,代码行数:22,代码来源:IndexController.java

示例4: setRootItem

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private TreeItem<Path> setRootItem(Path path) {
    WatcherStructure rootInWatcher = new WatcherStructure(path, project, tabUpdater, this);

    TreeItem<Path> rootNode = new CustomTreeItem(path, rootInWatcher, project, tabUpdater, this);
    rootNode.setExpanded(true);
    CustomIcons customIcons = new CustomIcons();
    rootNode.setGraphic(new ImageView(customIcons.getFolderExpandImage()));
    rootNode.expandedProperty().addListener(expanderListener());

    return rootNode;
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:12,代码来源:TreeUpdater.java

示例5: createItem

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
public TreeItem<String> createItem(Collection collection) {
    TreeItem<String> item = new TreeItem<>(collection.getName());
    item.setGraphic(new TangoIconWrapper("places:folder"));
    return item;
}
 
开发者ID:AntonioGabrielAndrade,项目名称:LIRE-Lab,代码行数:6,代码来源:TreeItemBuilder.java

示例6: addNode

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
public static TreeItem<Object> addNode(final TreeItem<Object> item, final TreeItem<Object> parent, final boolean expanded, final GlyphIcons icon)
    {
//        TreeItem<String> item = new TreeItem<String>(title);

        item.setExpanded(expanded);

        if (icon != null)
            item.setGraphic(GlyphsDude.createIcon(icon, TREE_ICON_SIZE));

        parent.getChildren().add(item);

        return item;
    }
 
开发者ID:apache,项目名称:cayenne-modeler,代码行数:14,代码来源:TreeViewUtilities.java


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