private void refreshMediaPane() {
		DefaultTreeModel treeModel = (DefaultTreeModel) mediaTree.getModel();
		DefaultMutableTreeNode mediumNode = null, setNode = null;
		int setsCount = 0; // Used to count currently present RDC sets
		
		mediaTreeRoot.removeAllChildren();
		if(media.size() == 0) { 
			mediumNode = new DefaultMutableTreeNode("(no media)", true);
			mediaTreeRoot.add(mediumNode);
		}
		else {
			mediaTreeRoot.setUserObject("");
			
			for(AlignmentMedium medium: media) {
				mediumNode = new DefaultMutableTreeNode(medium.name, true);
				mediaTreeRoot.add(mediumNode);
				
				if(medium.getCount() == 0) {
					setNode = new DefaultMutableTreeNode("(no data)");
					mediumNode.add(setNode);
				} else {
					for(RDCSet set: medium.getRDCSets()) {
						setNode = new DefaultMutableTreeNode(set.getTypeString());
						mediumNode.add(setNode);
						
						setsCount++;
					}
				}
			}		
		} 
		
		// Make sure that the icon correctly reflects whether any RDC sets are present
		if(setsCount > 0)
			picLabel3.setIcon(iconOK);
		else
			picLabel3.setIcon(iconStop);

		// Force tree refresh
		treeModel.reload(mediaTreeRoot);
		
		// Expand all nodes
		for(int i=0; i < mediaTree.getRowCount(); i++)
			mediaTree.expandRow(i);
		
    	// Discard the current setupDialog so that it would be recreated with new media setup
    	setupDialog = null;
	}