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


Java TreeNode類代碼示例

本文整理匯總了Java中org.apache.pivot.wtk.content.TreeNode的典型用法代碼示例。如果您正苦於以下問題:Java TreeNode類的具體用法?Java TreeNode怎麽用?Java TreeNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TreeNode類屬於org.apache.pivot.wtk.content包,在下文中一共展示了TreeNode類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: nodeToPath

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
/**
 * Tree view Node to String array path from Tree view root
 * @param NODE
 * @return path array of parent groups
 */
public static String[] nodeToPath(TreeNode NODE) {
    java.util.List<String> backList = new java.util.ArrayList<String>();
    //Return back in hierarchy
    TreeNode Ntmp = NODE;
    do {
        backList.add(Ntmp.getText());
        Ntmp = Ntmp.getParent();
    } while(Ntmp != null);
    //Copy the hierarchy from top to bottom
    String[] PATH = new String[backList.size()];
    int i = 0;
    ListIterator<String> it = backList.listIterator(backList.size());
    while(it.hasPrevious()) {
        PATH[i++] = it.previous();
    }
    
    return PATH;
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:24,代碼來源:CastFactory.java

示例2: getCheckedPacks

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
/**
 * Get only packs checked in treeview
 * @param sequence of checked paths in treeview
 * @return list of checked packs
 */
public List<Pack> getCheckedPacks(Sequence<Path> list) {
    List<Pack> selected = new ArrayList<Pack>();

    if (list.getLength() > 0) {
        Path p;
        for(int i = 0; i < list.getLength(); i++) {
            p = list.get(i);
            TreeNode node = treeData.get(p.get(0));
            for(Pack P:packs) {
                if (node.getParent() == null && P.getName().equalsIgnoreCase(node.getText()) ) {
                    selected.add(P);
                    break;
                }
            }
        }
    }
    return selected;
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:24,代碼來源:ScanFacade.java

示例3: fromBean

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
public TreeNode fromBean(Object bean) {
    TreeBranch result = new TreeBranch();
    BeanAdapter beanAdapter;

    if (bean instanceof BeanAdapter) {
        beanAdapter = (BeanAdapter) bean;
    } else {
        beanAdapter = new BeanAdapter(bean);
    }

    for (String property : beanAdapter) {
        TreeNode node = new TreeNode();
        node.setText(property);
        result.add(node);
        Object propertyValue = beanAdapter.get(property);

        if (propertyValue != null) {
            result.add(fromBean(propertyValue));
        }
    }

    return null;
}
 
開發者ID:moosbusch,項目名稱:Lumpi,代碼行數:24,代碼來源:BeanListData.java

示例4: packToNode

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
/**
 * Pack model to Tree view node
 * @param P
 * @return pack's new node instance
 */
public static TreeNode packToNode(Pack P) {
    //TreeNode node = new TreeNode(P.getIcon(), P.getInstallName());
    TreeNode node = new TreeNode(P.getIcon(), P.getName());
    node.setUserData(P);//Save model data
    return node;
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:12,代碼來源:CastFactory.java

示例5: equals

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
@Override public boolean equals(Object obj)//Packs compare
{
    if (obj==null) return false;
    if (obj instanceof Pack) {//With a Pack model
        Pack P = (Pack) obj;
        return this.name.toLowerCase().equals(P.getName().toLowerCase())//Name
                && this.path.toLowerCase().equals(P.getPath().toLowerCase());//Path
    }
    else if (obj instanceof TreeNode) {//With a TreeView Node
        TreeNode node = (TreeNode) obj;
        return this.name.toLowerCase().equals(node.getText().toLowerCase())//Name
                && this.group.equals(node.getParent());//Group
    }
    else return super.equals(obj);
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:16,代碼來源:Pack.java

示例6: getPack

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
/**
 * Get Pack of a node
 * @param node to cast
 * @return Pack
 */
public Pack getPack(TreeNode node)
{
    for(Pack P : PackFactory.getPacks()) {
        if (P.getGroup() != null && P.equals(node))
            return P;
    }
    return null;
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:14,代碼來源:SetFacade.java

示例7: removeNode

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
/**
 * Remove a Group or Pack from TreeView
 * @param group to remove
 */
public void removeNode(TreeNode node)
{
    assert node != null;
    
    if (node instanceof TreeBranch)// Group
    {
        TreeBranch branch = (TreeBranch) node;
        Group group = getGroup(branch);
        String path = group.getPath();
        assert group != null;
        unlinkGroup(group);
        GroupFactory.removeGroup(group);
        //TreeBranch remove
        if (branch.getParent() != null)
            branch.getParent().remove(branch);
        else treeData.remove(branch);
        Out.print(LOG_LEVEL.DEBUG, "Group removed: " + path);
    }
    else if (node instanceof TreeNode)// Pack
    {
        TreeBranch branch = node.getParent();
        String name = getGroup(branch).getName();
        Pack P = getPack(node);
        P.setGroup(null);
        //TreeNode remove
        branch.remove(node);
        Out.print(LOG_LEVEL.DEBUG, "Pack '" + P.getName() + "' removed from Group: "+name);
    }
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:34,代碼來源:SetFacade.java

示例8: TaskDirScan

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
public TaskDirScan(ScanFrame source, String path, List<TreeNode> treeData, FilenameFilter filter,
                   String depthValue, boolean folderFilter)
{
    this.scanFrame = source;
    // point to data models lists
    this.groups = scanFrame.facade.getGroups();
    this.packs = scanFrame.facade.getPacks();
    
    this.path = path;
    this.treeData = treeData;
    this.filter= filter;
    
    this.depthValue = depthValue;
    this.folderFilter = folderFilter;
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:16,代碼來源:TaskDirScan.java

示例9: createTreeNode

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public TreeNode createTreeNode() {
    return new TreeNode();
}
 
開發者ID:moosbusch,項目名稱:Lumpi,代碼行數:8,代碼來源:AbstractPivotBeanConfiguration.java

示例10: render

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
@Override
public void render(Object node, Path path, int rowIndex, TreeView treeView,
        boolean expanded, boolean selected, NodeCheckState checkState,
        boolean highlighted, boolean disabled) {
    if (node != null) {
        RendererUtil.renderData(this, node);
    } else {
        super.render(new TreeNode(), path, rowIndex, treeView, expanded, selected,
                checkState, highlighted, disabled);
    }
}
 
開發者ID:moosbusch,項目名稱:Lumpi,代碼行數:12,代碼來源:AbstractTreeNodeRenderer.java

示例11: ScanFacade

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
public ScanFacade()
{
    treeData = new ArrayList<TreeNode>();
    packs = new ArrayList<Pack>();
    groups = new ArrayList<Group>();
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:7,代碼來源:ScanFacade.java

示例12: getTreeData

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
public List<TreeNode> getTreeData()
{
    return treeData;
}
 
開發者ID:DevComPack,項目名稱:setupmaker,代碼行數:5,代碼來源:ScanFacade.java

示例13: fromNode

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
public void fromNode(Node node) {
    clear();
    TreeNode treeNode = traverseNode(node);
    add(treeNode);
}
 
開發者ID:moosbusch,項目名稱:Lumpi,代碼行數:6,代碼來源:DomListData.java

示例14: createTreeNode

import org.apache.pivot.wtk.content.TreeNode; //導入依賴的package包/類
public TreeNode createTreeNode(); 
開發者ID:moosbusch,項目名稱:Lumpi,代碼行數:2,代碼來源:PivotBeanConfiguration.java


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