本文整理汇总了Java中edu.uci.ics.jung.graph.DelegateTree.removeChild方法的典型用法代码示例。如果您正苦于以下问题:Java DelegateTree.removeChild方法的具体用法?Java DelegateTree.removeChild怎么用?Java DelegateTree.removeChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.uci.ics.jung.graph.DelegateTree
的用法示例。
在下文中一共展示了DelegateTree.removeChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeCluster
import edu.uci.ics.jung.graph.DelegateTree; //导入方法依赖的package包/类
public void removeCluster(Integer tenantId, String name) {
//remove itemassoc (tree); if not leaf, remove whole subtree
DelegateTree<ClusterVO, ItemAssocVO<Integer,Integer>> tree =
clusters.get(tenantId);
ClusterVO cluster = loadCluster(tenantId, idMappingDAO.lookup(name),
itemTypeDAO.getIdOfType(tenantId, ClusterService.ITEMTYPE_CLUSTER));
// disconnect subtree
ItemAssocVO<Integer,Integer> parentEdge = tree.getParentEdge(cluster);
itemAssocService.removeItemAssoc(parentEdge.getId());
//now remove rest of subtree including all itemassocs (item->cluster)
removeClustersFromDB(tree, cluster);
tree.removeChild(cluster);
}
示例2: moveCluster
import edu.uci.ics.jung.graph.DelegateTree; //导入方法依赖的package包/类
public void moveCluster(Integer tenantId, String clusterName, String newParent) {
DelegateTree<ClusterVO, ItemAssocVO<Integer,Integer>> tree =
clusters.get(tenantId);
ClusterVO cluster = loadCluster(tenantId, idMappingDAO.lookup(clusterName),
itemTypeDAO.getIdOfType(tenantId, ClusterService.ITEMTYPE_CLUSTER));
// disconnect subtree
ItemAssocVO<Integer,Integer> parentEdge = tree.getParentEdge(cluster);
itemAssocService.removeItemAssoc(parentEdge.getId());
tree.removeChild(cluster);
// add cluster as child to new parent
ClusterVO parent = loadCluster(tenantId, idMappingDAO.lookup(newParent),
itemTypeDAO.getIdOfType(tenantId, ClusterService.ITEMTYPE_CLUSTER));
ItemAssocVO<Integer,Integer> edge =
new ItemAssocVO<Integer,Integer>(
parent.getItem().getTenant(), // tenantId
parent.getItem(), //itemFrom
assocTypeDAO.getIdOfType(parent.getItem().getTenant(), ClusterService.ASSOCTYPE_CLUSTER),
//assocType
1.0, //assocValue
cluster.getItem(), //itemTo
sourceTypeDAO.getIdOfType(parent.getItem().getTenant(),
SourceTypeDAO.SOURCETYPE_MANUALLY_CREATED), //sourceType
"", //comment
viewTypeDAO.getIdOfType(parent.getItem().getTenant(), ViewTypeDAO.VIEWTYPE_ADMIN),
true); //timeStamp
itemAssocService.insertOrUpdateItemAssoc(edge);
tree.addChild(edge, parent, cluster);
buildTree(tree, cluster);
}