if (cDNodes != null) { Iterator i = cDNodes.keySet().iterator(); Iterator j; DefaultMutableTreeNode dNode; List dNodes, images; Integer datasetID;  updateImagesInDataset(is);  while (i.hasNext()) { datasetID = (Integer) i.next(); images = (List) imagesInDataset.get(datasetID); dNodes = (List) cDNodes.get(datasetID); j = dNodes.iterator(); while (j.hasNext()) { dNode = (DefaultMutableTreeNode) j.next(); dNode.removeAllChildren(); addImagesToDataset(images, dNode); treeModel.reload(dNode); }
if (cDNodes.size() == 0) return; Iterator i = cDNodes.keySet().iterator(); Iterator j; DefaultMutableTreeNode dNode; List dNodes, images; Integer datasetID;  updateImagesInDataset(is);  while (i.hasNext()) { datasetID = (Integer) i.next(); images = (List) imagesInDataset.get(datasetID); dNodes = (List) cDNodes.get(datasetID); j = dNodes.iterator(); while (j.hasNext()) { dNode = (DefaultMutableTreeNode) j.next(); dNode.removeAllChildren(); addImagesToDataset(images, dNode); treeModel.reload(dNode);
    void updateImageInTree(ImageSummary is)    {        DefaultTreeModel treeModel = (DefaultTreeModel) view.tree.getModel();        if (cDNodes != null) {            Iterator i = cDNodes.keySet().iterator();            Iterator j;            DefaultMutableTreeNode dNode;            List dNodes, images;            Integer datasetID;            //First update the images in list of expanded datasets.            updateImagesInDataset(is);            //Then update the tree.            while (i.hasNext()) {                datasetID = (Integer) i.next();                images = (List) imagesInDataset.get(datasetID);                dNodes = (List) cDNodes.get(datasetID);                j = dNodes.iterator();                while (j.hasNext()) {                    dNode = (DefaultMutableTreeNode) j.next();                    dNode.removeAllChildren();                    addImagesToDataset(images, dNode);                     treeModel.reload(dNode);                }            }        }    }