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


Java TreeItem.setValue方法代码示例

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


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

示例1: start

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
@Override
public void start(Stage aPrimaryStage) throws Exception {
	
	FxMediaCatalog mediaCatalog = new FxMediaCatalog();
	Scene scene = new Scene(mediaCatalog, mediaCatalog.getFormMinResolution().getWidth(), mediaCatalog.getFormMinResolution().getHeight());
	aPrimaryStage.setTitle(FxMediaCatalogDemo.class.getSimpleName());
	aPrimaryStage.setScene(scene);
	aPrimaryStage.setMinWidth(mediaCatalog.getFormMinResolution().getWidth());
	aPrimaryStage.setMinHeight(mediaCatalog.getFormMinResolution().getHeight());
	aPrimaryStage.sizeToScene();
	aPrimaryStage.centerOnScreen();
	aPrimaryStage.show();
	//
	//mediaCatalog.getModel().onDeleteMedia().set(tagsItem -> { System.out.println("OnDeleteMedia: " + tagsItem); throw new RuntimeException("RE 123");});
	mediaCatalog.getModel().setCatalogLocation(getCatalogLocation());
	TreeItem<TagsItem> rootItem = mediaCatalog.getModel().getRootItem();
	rootItem.setValue(new TagsItem("ABC", "Media Item 1", "Media 1", "Description AAA"));
	TreeItem<TagsItem> childItem = new TreeItem<TagsItem>(new TagsItem("XYZ", "Media Item 2", "Media 2", "Description BBB"));
	rootItem.getChildren().add(childItem);
	childItem.getChildren().add(new TreeItem<TagsItem>(new TagsItem("MNL", "Media Item 3", "Media 3", "Description CCC")));
	//
	System.out.println("Catalog location: " + mediaCatalog.getModel().getCatalogLocation());
}
 
开发者ID:mikelaud,项目名称:fx-media-catalog,代码行数:24,代码来源:FxMediaCatalogDemo.java

示例2: 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

示例3: customizeRootItem

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
/**
 * Initializes root item of prawnAuditTree TreeView based on whether the SquidPrefixTree has duplicates
 * @param hasDuplicates the SquidPrefixTree has duplicates
 * @param summaryStatsString summary of statistics from SquidPrefixTree to display
 * @return the root item depending on whether there are duplicates
 */
private TreeItem<String> customizeRootItem(String summaryStatsString, boolean hasDuplicates){
    TreeItem<String> rootItem = new TreeItem<>("Spots", null);
    if(hasDuplicates){
        rootItem.setValue(
                "***This file has duplicate names. Change names of duplicates in PrawnFile > Manage Spots & "
                        + "Choose Reference Materials***" + 
                "\n\nSpots by prefix: " + summaryStatsString);
    }else{
        rootItem.setValue("Spots by prefix:" + summaryStatsString);
    }
    return rootItem;
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:19,代码来源:SessionAuditController.java

示例4: populatePrefixTreeView

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
/**
 * Displays all nodes in the tree starting from the root. 
 * Displays only duplicate spot tree if showDupesOnly is true. Displays entire spot tree if hasBeenChecked is false.
 * @param parentItem the root item for this tree
 * @param squidPrefixTree the current instance of SquidPrefixTree
 * @param showDupesOnly implies both that SquidPrefixTree has duplicates, and that the CheckBox has been checked
 */
private void populatePrefixTreeView(TreeItem<String> parentItem, SquidPrefixTree squidPrefixTree, boolean showDupesOnly) {

    List<SquidPrefixTree> children = squidPrefixTree.getChildren();

    for (int i = 0; i < children.size(); i++) {
        if (!children.get(i).isleaf()) {
            TreeItem<String> childItem
                    = new TreeItem<>(children.get(i).getStringValue()
                            + children.get(i).buildSummaryDataString()
                    );
            if(showDupesOnly){
                if(children.get(i).getCountOfDups() > 0){
                    parentItem.getChildren().add(childItem);
                }
            }
            else{
                parentItem.getChildren().add(childItem);
            }

            if (children.get(i).hasChildren()) {
                populatePrefixTreeView(childItem, children.get(i), showDupesOnly);
            }

        } else {
            parentItem.setValue(children.get(i).getParent().getStringValue()
                    + " Dups=" + String.format("%1$ 2d", children.get(i).getParent().getCountOfDups())
                    + " Species=" + String.format("%1$ 2d", children.get(i).getCountOfSpecies())
                    + " Scans=" + String.format("%1$ 2d", children.get(i).getCountOfScans())
                    + ((String) (children.size() > 1 ? " ** see duplicates below **" : ""))
            );
        }
    }
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:41,代码来源:SessionAuditController.java

示例5: addClass

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
public void addClass(int classNumber){
	TreeItem<TypeController> newTypeController = new TreeItem<TypeController>();
       Type nt = new Classe("Classe "+classNumber);
       TypeController tc;
       if(getItem().getType().getClass().equals(Schema.class)){
       	tc = new TypeController(nt, getTreeItem().getValue().getType());
       }else{
       	tc = new TypeController(nt, getTreeItem().getParent().getValue().getType());
       }
       newTypeController.setValue(tc);
       getTreeItem().getChildren().add(newTypeController);
       getItem().getType().getTypes().add(nt);
       this.getTreeItem().setExpanded(true);
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:15,代码来源:TypeTreeView.java

示例6: addFolder

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
public void addFolder(int folderNumber){
	TreeItem<TypeController> newTypeController = new TreeItem<TypeController>();
       Type nt = new Dossier("Dossier "+folderNumber);
       TypeController tc;
       if(getItem().getType().getClass().equals(Schema.class)){
       	tc = new TypeController(nt, getTreeItem().getValue().getType());
       }else{
       	tc = new TypeController(nt, getTreeItem().getParent().getValue().getType());
       }
       tc = new TypeController(nt, getTreeItem().getValue().getType());
       newTypeController.setValue(tc);
       getTreeItem().getChildren().add(newTypeController);
       getItem().getType().getTypes().add(nt);
       this.getTreeItem().setExpanded(true);
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:16,代码来源:TypeTreeView.java

示例7: addProperty

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
public void addProperty(Type nt){
	TreeItem<TypeController> newType = new TreeItem<TypeController>();
	TypeController tc = new TypeController(nt, getTreeItem().getParent().getValue().getType());
       newType.setValue(tc);
       getTreeItem().getChildren().add(newType);
       this.getTreeItem().setExpanded(true);	
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:8,代码来源:TypeTreeView.java

示例8: execute

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
@Override
public void execute() {
	// adding the new property to the scheme
	TreeItem<TypeController> newType = new TreeItem<TypeController>();
	TypeController tc = new TypeController(newp, controller.getType());
       newType.setValue(tc);
       tree.getChildren().add(newType);
       tree.setExpanded(true);	
       controller.getAddPropertySchemeController().update(newp);
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:11,代码来源:AddPropertyToClassCommand.java

示例9: undo

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
@Override
public void undo() {
	controller.GetAddPropertySchemeWithValueController().update(oldp);;
	// adding the new property to the scheme
	TreeItem<TypeController> newType = new TreeItem<TypeController>();
	TypeController tc = new TypeController(oldp, controller.getType());
       newType.setValue(tc);
       tree.getChildren().add(newType);
       //getItem().getType().getTypes().add(nt);
       tree.setExpanded(true);	
}
 
开发者ID:coco35700,项目名称:uPMT,代码行数:12,代码来源:RemovePropertyFromClassCommand.java

示例10: updateObject

import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
void updateObject(Path oldPath, Path newPath) {
    TreeItem<Path> item = getItem(treeView.getRoot(), oldPath);
    item.setValue(newPath);

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


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