{ DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel(); DefaultMutableTreeNode pNode; List pSummaries = agentCtrl.getUserProjects(); if (pSummaries != null) { Iterator j = pSummaries.iterator(); ProjectSummary ps; Integer projectID; while (j.hasNext()) { ps = (ProjectSummary) j.next(); projectID = new Integer(ps.getID()); pNode = (DefaultMutableTreeNode) pNodes.get(projectID); pNode.removeAllChildren(); if (projects.indexOf(ps) != -1) addDatasets(ps.getDatasets(), pNode, true); else addDatasets(ps.getDatasets(), pNode, false); treeModel.reload(pNode); } } }
{ DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel(); DefaultMutableTreeNode pNode; List pSummaries = agentCtrl.getUserProjects(); if (pSummaries == null || pSummaries.size() == 0) return; Iterator j = pSummaries.iterator(); ProjectSummary ps; Integer projectID; while (j.hasNext()) { ps = (ProjectSummary) j.next(); projectID = new Integer(ps.getID()); pNode = (DefaultMutableTreeNode) pNodes.get(projectID); pNode.removeAllChildren(); if (projects.indexOf(ps) != -1) addDatasets(ps.getDatasets(), pNode, true); else addDatasets(ps.getDatasets(), pNode, false); treeModel.reload(pNode); } }
	void addNewDatasetToTree(List projects) 	{		DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel();		DefaultMutableTreeNode pNode;															List pSummaries = agentCtrl.getUserProjects();		if (pSummaries != null) {			Iterator j = pSummaries.iterator();			ProjectSummary ps;            Integer projectID;			while (j.hasNext()) {				ps = (ProjectSummary) j.next();				projectID = new Integer(ps.getID());				pNode = (DefaultMutableTreeNode) pNodes.get(projectID);				pNode.removeAllChildren();				if (projects.indexOf(ps) != -1)					addDatasets(ps.getDatasets(), pNode, true);				else addDatasets(ps.getDatasets(), pNode, false);				treeModel.reload(pNode);			}		}	}