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


Java TreeNode.addChildren方法代码示例

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


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

示例1: addProfileData

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void addProfileData(TreeNode profile) {
    TreeNode socialNetworks = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_people, "Social")).setViewHolder(new HeaderHolder(getActivity()));
    TreeNode places = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_place, "Places")).setViewHolder(new HeaderHolder(getActivity()));

    TreeNode facebook = new TreeNode(new SocialViewHolder.SocialItem(R.string.ic_post_facebook)).setViewHolder(new SocialViewHolder(getActivity()));
    TreeNode linkedin = new TreeNode(new SocialViewHolder.SocialItem(R.string.ic_post_linkedin)).setViewHolder(new SocialViewHolder(getActivity()));
    TreeNode google = new TreeNode(new SocialViewHolder.SocialItem(R.string.ic_post_gplus)).setViewHolder(new SocialViewHolder(getActivity()));
    TreeNode twitter = new TreeNode(new SocialViewHolder.SocialItem(R.string.ic_post_twitter)).setViewHolder(new SocialViewHolder(getActivity()));

    TreeNode lake = new TreeNode(new PlaceHolderHolder.PlaceItem("A rose garden")).setViewHolder(new PlaceHolderHolder(getActivity()));
    TreeNode mountains = new TreeNode(new PlaceHolderHolder.PlaceItem("The white house")).setViewHolder(new PlaceHolderHolder(getActivity()));

    places.addChildren(lake, mountains);
    socialNetworks.addChildren(facebook, google, twitter, linkedin);
    profile.addChildren(socialNetworks, places);
}
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:17,代码来源:CustomViewHolderFragment.java

示例2: parseMetaDataAndAdd

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private static void parseMetaDataAndAdd(Bundle metaData, TreeNode parent) {
	if (metaData != null){
		TreeNode nodes = new TreeNode("meta-datas [" + metaData.keySet().size() + "]");
		Iterator<String> it = metaData.keySet().iterator();
		while (it.hasNext()) {
			String key = it.next();
			String value = "";
			value = metaData.getString(key);
			if (null == value) {
				value = "@" + metaData.getInt(key) + "";
			}

			TreeNode node = new TreeNode("meta-data");
			node.addChildren(new TreeNode("key: " + key), new TreeNode("value: " + value));
			nodes.addChild(node);
		}
		parent.addChild(nodes);
	}
}
 
开发者ID:luoqii,项目名称:apk_manifest_parser,代码行数:20,代码来源:MainActivity.java

示例3: addTrks2Node

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private static void addTrks2Node(TreeNode node, List<Track> trks) {
    for (Track trk : trks) {
        GpxHolder.GpxTreeItem.Builder trk_builder = new GpxHolder.GpxTreeItem.Builder();
        TreeNode trkNode = new TreeNode(trk_builder
                .setType(GpxHolder.ITEM_TYPE_TRACK)
                .setIcon(GpxHolder.ITEM_ICON_TRACK)
                .setName(trk.getTrackName())
                .setTrkOpts(GpxUtils.trk2TrkOpts(trk))
                .build());
        node.addChildren(trkNode);
    }
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:13,代码来源:GpxUtils.java

示例4: addWpts2Node

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private static void addWpts2Node(TreeNode node, List<WayPoint> wpts) {
    for (WayPoint wpt : wpts) {
        GpxHolder.GpxTreeItem.Builder wpt_builder = new GpxHolder.GpxTreeItem.Builder();
        TreeNode wptNode = new TreeNode(wpt_builder
                .setType(GpxHolder.ITEM_TYPE_WAYPOINT)
                .setIcon(GpxHolder.ITEM_ICON_WAYPOINT)
                .setName(wpt.getName())
                .setMarker(wpt)
                .build());
        node.addChildren(wptNode);
    }
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:13,代码来源:GpxUtils.java

示例5: createFileStructure

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Nullable
private TreeNode createFileStructure(@Nullable JavaProjectFolder projectFile) {
    if (projectFile == null) return null;
    File rootDir = projectFile.getProjectDir();
    TreeNode root = new TreeNode(new FolderHolder.TreeItem(rootDir, rootDir, listener));
    try {
        root.addChildren(getNode(rootDir, rootDir));
    } catch (Exception e) {
        e.printStackTrace();
    }
    return root;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:13,代码来源:FolderStructureFragment.java

示例6: onCreateView

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.fragment_default, null, false);
    final ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);
    rootView.findViewById(R.id.status_bar).setVisibility(View.GONE);

    final TreeNode root = TreeNode.root();

    TreeNode myProfile = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "My Profile")).setViewHolder(new ProfileHolder(getActivity()));
    TreeNode bruce = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Bruce Wayne")).setViewHolder(new ProfileHolder(getActivity()));
    TreeNode clark = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Clark Kent")).setViewHolder(new ProfileHolder(getActivity()));
    TreeNode barry = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Barry Allen")).setViewHolder(new ProfileHolder(getActivity()));
    addProfileData(myProfile);
    addProfileData(clark);
    addProfileData(bruce);
    addProfileData(barry);
    root.addChildren(myProfile, bruce, barry, clark);

    tView = new AndroidTreeView(getActivity(), root);
    tView.setDefaultAnimation(true);
    tView.setDefaultContainerStyle(R.style.TreeNodeStyleDivided, true);
    containerView.addView(tView.getView());

    if (savedInstanceState != null) {
        String state = savedInstanceState.getString("tState");
        if (!TextUtils.isEmpty(state)) {
            tView.restoreState(state);
        }
    }

    return rootView;
}
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:33,代码来源:CustomViewHolderFragment.java

示例7: onCreateView

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_selectable_nodes, null, false);
    rootView.findViewById(R.id.status).setVisibility(View.GONE);
    ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);

    TreeNode root = TreeNode.root();

    TreeNode s1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Folder with very long name ")).setViewHolder(new SelectableHeaderHolder(getActivity()));
    TreeNode s2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Another folder with very long name")).setViewHolder(new SelectableHeaderHolder(getActivity()));

    fillFolder(s1);
    fillFolder(s2);

    root.addChildren(s1, s2);

    tView = new AndroidTreeView(getActivity(), root);
    tView.setDefaultAnimation(true);
    tView.setUse2dScroll(true);
    tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
    containerView.addView(tView.getView());

    tView.expandAll();

    if (savedInstanceState != null) {
        String state = savedInstanceState.getString("tState");
        if (!TextUtils.isEmpty(state)) {
            tView.restoreState(state);
        }
    }
    return rootView;
}
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:33,代码来源:TwoDScrollingFragment.java

示例8: onCreateView

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_selectable_nodes, null, false);
    rootView.findViewById(R.id.status).setVisibility(View.GONE);
    ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);

    TreeNode root = TreeNode.root();

    TreeNode s1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Folder with very long name ")).setViewHolder(
        new ArrowExpandSelectableHeaderHolder(getActivity()));
    TreeNode s2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Another folder with very long name")).setViewHolder(
        new ArrowExpandSelectableHeaderHolder(getActivity()));

    fillFolder(s1);
    fillFolder(s2);

    root.addChildren(s1, s2);

    tView = new AndroidTreeView(getActivity(), root);
    tView.setDefaultAnimation(true);
    tView.setUse2dScroll(true);
    tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
    tView.setDefaultNodeClickListener(TwoDScrollingArrowExpandFragment.this);
    tView.setDefaultViewHolder(ArrowExpandSelectableHeaderHolder.class);
    containerView.addView(tView.getView());
    tView.setUseAutoToggle(false);

    tView.expandAll();

    if (savedInstanceState != null) {
        String state = savedInstanceState.getString("tState");
        if (!TextUtils.isEmpty(state)) {
            tView.restoreState(state);
        }
    }
    return rootView;
}
 
开发者ID:bmelnychuk,项目名称:AndroidTreeView,代码行数:38,代码来源:TwoDScrollingArrowExpandFragment.java

示例9: onCreateView

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.fragment_default, null, false);
    final ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);
    rootView.findViewById(R.id.status_bar).setVisibility(View.GONE);

    final TreeNode root = TreeNode.root();

    TreeNode myProfile = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "My Profile")).setViewHolder(new ProfileHolder(getActivity()));
    TreeNode bruce = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Bruce Wayne")).setViewHolder(new ProfileHolder(getActivity()));
    TreeNode clark = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Clark Kent")).setViewHolder(new ProfileHolder(getActivity()));
    TreeNode barry = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, "Barry Allen")).setViewHolder(new ProfileHolder(getActivity()));
    addProfileData(myProfile);
    addProfileData(clark);
    addProfileData(bruce);
    addProfileData(barry);
    root.addChildren(myProfile, bruce, barry, clark);

    tView = new AndroidTreeView(getActivity(), root);
    tView.setDefaultContainerStyle(R.style.TreeNodeStyleDivided, true);
    containerView.addView(tView.getView());

    if (savedInstanceState != null) {
        String state = savedInstanceState.getString("tState");
        if (!TextUtils.isEmpty(state)) {
            tView.restoreState(state);
        }
    }

    return rootView;
}
 
开发者ID:ErNaveen,项目名称:TreeView_in_Android,代码行数:32,代码来源:CustomViewHolderFragment.java

示例10: onCreateView

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_default, null, false);
    ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);

    statusBar = (TextView) rootView.findViewById(R.id.status_bar);

    TreeNode root = TreeNode.root();
    TreeNode computerRoot = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_laptop, "My Computer"));

    TreeNode myDocuments = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "My Documents"));
    TreeNode downloads = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Downloads"));
    TreeNode file1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "Folder 1"));
    TreeNode file2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "Folder 2"));
    TreeNode file3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "Folder 3"));
    TreeNode file4 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "Folder 4"));
    fillDownloadsFolder(downloads);
    downloads.addChildren(file1, file2, file3, file4);

    TreeNode myMedia = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo_library, "Photos"));
    TreeNode photo1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Folder 1"));
    TreeNode photo2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Folder 2"));
    TreeNode photo3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Folder 3"));
    myMedia.addChildren(photo1, photo2, photo3);

    myDocuments.addChild(downloads);
    computerRoot.addChildren(myDocuments, myMedia);

    root.addChildren(computerRoot);

    tView = new AndroidTreeView(getActivity(), root);
    tView.setDefaultAnimation(true);
    tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
    tView.setDefaultViewHolder(IconTreeItemHolder.class);
    tView.setDefaultNodeClickListener(nodeClickListener);
    tView.setDefaultNodeLongClickListener(nodeLongClickListener);

    containerView.addView(tView.getView());

    if (savedInstanceState != null) {
        String state = savedInstanceState.getString("tState");
        if (!TextUtils.isEmpty(state)) {
            tView.restoreState(state);
        }
    }

    return rootView;
}
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:50,代码来源:FolderStructureFragment.java

示例11: fillFolder

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void fillFolder(TreeNode folder) {
    TreeNode file1 = new TreeNode("File1").setViewHolder(new SelectableItemHolder(getActivity()));
    TreeNode file2 = new TreeNode("File2").setViewHolder(new SelectableItemHolder(getActivity()));
    TreeNode file3 = new TreeNode("File3").setViewHolder(new SelectableItemHolder(getActivity()));
    folder.addChildren(file1, file2, file3);
}
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:7,代码来源:SelectableTreeFragment.java

示例12: onCreate

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mindmapLayout = (RelativeLayout) findViewById(R.id.mindmapLayout);
        mindmapLayout.setX(mindmapLayout.getX() - (1920 - 1080));

        input = (EditText) findViewById(R.id.input);

        TreeNode root = TreeNode.root();
        TreeNode computerRoot = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_cloud, "Happiness"));
        first_root = computerRoot;
        current_root = first_root;

        TreeNode myDocuments = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Money"));
        TreeNode downloads = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "luxury"));
        TreeNode file1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "gold"));
        TreeNode file2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "sliver"));
        TreeNode file3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "gem"));
        TreeNode file4 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "ivory"));
        downloads.addChildren(file1, file2, file3, file4);

        TreeNode myMedia = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo_library, "life"));
        TreeNode photo1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "health"));
        TreeNode photo2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "love"));
        TreeNode photo3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "stability"));
        myMedia.addChildren(photo1, photo2, photo3);
        myDocuments.addChild(downloads);
        computerRoot.addChildren(myDocuments, myMedia);

        root.addChildren(computerRoot);

        /////////////////////////////////////////////////////////////////

        tView = new AndroidTreeView(this, root);
        tView.setDefaultAnimation(true);
        tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
        tView.setDefaultViewHolder(IconTreeItemHolder.class);
        tView.setDefaultNodeClickListener(nodeClickListener);
        tView.setDefaultNodeLongClickListener(nodeLongClickListener);

        RelativeLayout containerView = (RelativeLayout) findViewById(R.id.item);
        tView_result = tView.getView();
        containerView.addView(tView_result);
////////////////////////////////////////////////////////////////////////////////////////
        setMView(first_root);
    }
 
开发者ID:loput12ouj35,项目名称:Android-MindMap,代码行数:49,代码来源:MainActivity.java

示例13: onCreateView

import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_default, null, false);
    ViewGroup containerView = (ViewGroup) rootView.findViewById(R.id.container);

    statusBar = (TextView) rootView.findViewById(R.id.status_bar);

    TreeNode root = TreeNode.root();
    TreeNode computerRoot = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_laptop, "My Computer"));

    TreeNode myDocuments = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "My Documents"));
    TreeNode downloads = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_folder, "Downloads"));
    TreeNode file1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "File 1"));
    TreeNode file2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "File 2"));
    TreeNode file3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "File 3"));
    TreeNode file4 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_drive_file, "File 4"));
    fillDownloadsFolder(downloads);
    downloads.addChildren(file1, file2, file3, file4);

    TreeNode myMedia = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo_library, "Photos"));
    TreeNode photo1 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Photo 1"));
    TreeNode photo2 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Photo 2"));
    TreeNode photo3 = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_photo, "Photo 3"));
    myMedia.addChildren(photo1, photo2, photo3);

    myDocuments.addChild(downloads);
    computerRoot.addChildren(myDocuments, myMedia);

    root.addChildren(computerRoot);

    tView = new AndroidTreeView(getActivity(), root);
    tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
    tView.setDefaultViewHolder(IconTreeItemHolder.class);
    tView.setDefaultNodeClickListener(nodeClickListener);

    containerView.addView(tView.getView());

    if (savedInstanceState != null) {
        String state = savedInstanceState.getString("tState");
        if (!TextUtils.isEmpty(state)) {
            tView.restoreState(state);
        }
    }


    return rootView;
}
 
开发者ID:ErNaveen,项目名称:TreeView_in_Android,代码行数:49,代码来源:FolderStructureFragment.java


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