本文整理汇总了Java中com.unnamed.b.atv.model.TreeNode.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.getChildren方法的具体用法?Java TreeNode.getChildren怎么用?Java TreeNode.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.unnamed.b.atv.model.TreeNode
的用法示例。
在下文中一共展示了TreeNode.getChildren方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addGpxFile
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void addGpxFile(File file, MapsManager manager) {
try {
TreeNode gpxRoot = GpxUtils.gpxFile2TreeNode(file);
gpxRoot.setViewHolder(new GpxHolder(mContext, manager));
treeView.addNode(root, gpxRoot);
for (TreeNode node : gpxRoot.getChildren()) {
node.setViewHolder(new GpxHolder(mContext, manager));
for (TreeNode n : node.getChildren()) {
n.setViewHolder(new GpxHolder(mContext, manager));
}
}
} catch (Exception e) {
Log.d(TAG, "Fail to load GPX file " + file.getName());
}
}
示例2: collapseNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void collapseNode(TreeNode node, final boolean includeSubnodes) {
node.setExpanded(false);
TreeNode.BaseNodeViewHolder nodeViewHolder = getViewHolderForNode(node);
if (mUseDefaultAnimation) {
collapse(nodeViewHolder.getNodeItemsView());
} else {
nodeViewHolder.getNodeItemsView().setVisibility(View.GONE);
}
nodeViewHolder.toggle(false);
if (includeSubnodes) {
for (TreeNode n : node.getChildren()) {
collapseNode(n, includeSubnodes);
}
}
}
示例3: expandNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
public void expandNode(final TreeNode node, boolean includeSubnodes) {
node.setExpanded(true);
final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
parentViewHolder.getNodeItemsView().removeAllViews();
parentViewHolder.toggle(true);
for (final TreeNode n : node.getChildren()) {
addNode(parentViewHolder.getNodeItemsView(), n);
if (n.isExpanded() || includeSubnodes) {
expandNode(n, includeSubnodes);
}
}
if (mUseDefaultAnimation) {
expand(parentViewHolder.getNodeItemsView());
} else {
parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
}
}
示例4: expandNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandNode(final TreeNode node, boolean includeSubnodes) {
node.setExpanded(true);
final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
parentViewHolder.getNodeItemsView().removeAllViews();
parentViewHolder.toggle(true);
for (final TreeNode n : node.getChildren()) {
addNode(parentViewHolder.getNodeItemsView(), n);
if (n.isExpanded() || includeSubnodes) {
expandNode(n, includeSubnodes);
}
}
if (mUseDefaultAnimation) {
expand(parentViewHolder.getNodeItemsView());
} else {
parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
}
}
示例5: selectActiveSelection
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
@Override
public void selectActiveSelection(ActiveSelection activeSelection) {
if (drawerRoot != null) {
if (possiblySelect(drawerRoot, activeSelection)) {
return;
}
for (TreeNode account : drawerRoot.getChildren()) {
if (possiblySelect(account, activeSelection)) {
return;
}
for (TreeNode cluster : account.getChildren()) {
if (possiblySelect(cluster, activeSelection)) {
return;
}
}
}
}
}
示例6: expandLevel
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandLevel(TreeNode node, int level) {
if (node.getLevel() <= level) {
expandNode(node, false);
}
for (TreeNode n : node.getChildren()) {
expandLevel(n, level);
}
}
示例7: restoreNodeState
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void restoreNodeState(TreeNode node, Set<String> openNodes) {
for (TreeNode n : node.getChildren()) {
if (openNodes.contains(n.getPath())) {
expandNode(n);
restoreNodeState(n, openNodes);
}
}
}
示例8: getSaveState
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void getSaveState(TreeNode root, StringBuilder sBuilder) {
for (TreeNode node : root.getChildren()) {
if (node.isExpanded()) {
sBuilder.append(node.getPath());
sBuilder.append(NODES_PATH_SEPARATOR);
getSaveState(node, sBuilder);
}
}
}
示例9: toggleSelectionMode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void toggleSelectionMode(TreeNode parent, boolean mSelectionModeEnabled) {
toogleSelectionForNode(parent, mSelectionModeEnabled);
if (parent.isExpanded()) {
for (TreeNode node : parent.getChildren()) {
toggleSelectionMode(node, mSelectionModeEnabled);
}
}
}
示例10: getSelected
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private List<TreeNode> getSelected(TreeNode parent) {
List<TreeNode> result = new ArrayList<>();
for (TreeNode n : parent.getChildren()) {
if (n.isSelected()) {
result.add(n);
}
result.addAll(getSelected(n));
}
return result;
}
示例11: selectNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void selectNode(TreeNode parent, boolean selected, boolean skipCollapsed) {
parent.setSelected(selected);
toogleSelectionForNode(parent, true);
boolean toContinue = skipCollapsed ? parent.isExpanded() : true;
if (toContinue) {
for (TreeNode node : parent.getChildren()) {
selectNode(node, selected, skipCollapsed);
}
}
}
示例12: expandSrcDir
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandSrcDir(TreeNode root) {
if (mTreeView == null || mProjectFile == null) return;
TreeNode treeNode = root.getChildren().get(0);
mTreeView.expandNode(treeNode, false);
List<TreeNode> children = treeNode.getChildren();
for (TreeNode child : children) {
FolderHolder.TreeItem value = (FolderHolder.TreeItem) child.getValue();
File file = value.getFile();
if (file.getName().equals("src")) {
mTreeView.expandNode(child, true);
return;
}
}
}
示例13: findNodeById
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private TreeNode findNodeById(int id, TreeNode root) {
if (root.getValue() != null && ((ForumItemTree) root.getValue()).getId() == id) return root;
if (root.getChildren() == null && root.getChildren().isEmpty()) return null;
for (TreeNode item : root.getChildren()) {
TreeNode node = findNodeById(id, item);
if (node != null) return node;
}
return null;
}
示例14: collapseNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void collapseNode(TreeNode node, final boolean includeSubnodes) {
node.setExpanded(false);
TreeNode.BaseNodeViewHolder nodeViewHolder = getViewHolderForNode(node);
nodeViewHolder.getNodeItemsView().setVisibility(View.GONE);
nodeViewHolder.toggle(false);
if (includeSubnodes) {
for (TreeNode n : node.getChildren()) {
collapseNode(n, includeSubnodes);
}
}
}
示例15: expandNode
import com.unnamed.b.atv.model.TreeNode; //导入方法依赖的package包/类
private void expandNode(final TreeNode node, boolean includeSubnodes) {
if (node.size() == 0) {
return;
}
node.setExpanded(true);
final TreeNode.BaseNodeViewHolder parentViewHolder = getViewHolderForNode(node);
parentViewHolder.getNodeItemsView().setVisibility(View.VISIBLE);
parentViewHolder.toggle(true);
for (final TreeNode n : node.getChildren()) {
if (!parentViewHolder.childrenInitialized()) {
final TreeNode.BaseNodeViewHolder viewHolder = getViewHolderForNode(n);
final View nodeView = viewHolder.getView();
parentViewHolder.getNodeItemsView().addView(nodeView);
if (mSelectionModeEnabled) {
viewHolder.toggleSelectionMode(mSelectionModeEnabled);
}
nodeView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleNode(n);
if (n.getClickListener() != null) {
n.getClickListener().onClick(n, n.getValue());
} else if (nodeClickListener != null) {
nodeClickListener.onClick(n, n.getValue());
}
}
});
}
if (n.isExpanded() || includeSubnodes) {
expandNode(n, includeSubnodes);
}
}
}