@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == decomposeButton) {
			// Splits the relation into two using the selected dependency
			children.clear();
			FunctionalDependency dep = (FunctionalDependency) dependencySelect.getSelectedItem();
			HashSet<Attribute> leftRelationAttributes = new HashSet<Attribute>();
			for (Attribute a : dep.left) {
				leftRelationAttributes.add(a);
			}

			for (Attribute a : dep.right) {
				leftRelationAttributes.add(a);
			}

			HashSet<FunctionalDependency> leftRelationDeps = new HashSet<FunctionalDependency>();
			for (FunctionalDependency d : model.deps) {
				if (d.isValidOnAttributes(leftRelationAttributes)) {
					leftRelationDeps.add(d);
				}
			}

			AttributeModel leftModel = new AttributeModel(leftRelationAttributes, leftRelationDeps);
			children.add(new DecompositionTreeNode(leftModel));

			HashSet<Attribute> rightRelationAttributes = new HashSet<Attribute>(model.attributes);
			rightRelationAttributes.removeAll(dep.right);
			HashSet<FunctionalDependency> rightRelationDeps = new HashSet<FunctionalDependency>();
			for (FunctionalDependency d : model.deps) {
				if (d.isValidOnAttributes(rightRelationAttributes)) {
					rightRelationDeps.add(d);
				}
			}

			AttributeModel rightModel = new AttributeModel(rightRelationAttributes, rightRelationDeps);
			children.add(new DecompositionTreeNode(rightModel));
			refreshChildrenPane();
		}
	}