package editor;

import utility.Observer;
import xml.Element;

import javax.swing.*;

/**
 * Created by davidjackson on 2014-10-06.
 */
public class ElementTreeView extends JPanel implements Observer {
    private JTree tree;
    private Element root;

    public ElementTreeView(Element root) {
        root.registerObserver(this);
        this.root = root;

        tree = new JTree();
        add(tree);

        setVisible(false);
    }

    public void notifyObserver() {
        if (root != null) {
            // TODO: Change the tree
            System.out.println("[DEBUG] root has changed");
            setVisible(true);
        }
    }
}

@@ -90,45 +90,123 @@
 %0A * 
-Created by davidjackson on 2014-10-06
+The ElementTreeView controls the section of the GUI that displays the tree%0A * representation of an XML element tree
 .%0A *
@@ -320,24 +320,208 @@
 ment root;%0A%0A
+    /**%0A     * Create the tree view and associate it with a particular model (root of%0A     * the XML element tree)%0A     * @param root The root element of the XML element tree.%0A     */%0A
     public E
@@ -697,16 +697,106 @@
 %0A    %7D%0A%0A
+    /**%0A     * When the associated element tree root has changed, change the view%0A     */%0A
     publ

Add explanatory JavaDoc