package com.williballenthin.RejistryView;

import com.williballenthin.rejistry.RegistryHive;

import javax.swing.*;
import java.awt.*;

public class RejView extends JPanel implements RejTreeNodeSelectionListener {

    private final RegistryHive _hive;
    private final RejTreeView _tree_view;
    private final JSplitPane _splitPane;

    public RejView(RegistryHive hive) {
        super(new BorderLayout());
        this._hive = hive;
        this._tree_view = new RejTreeView(this._hive);

        this._splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                this._tree_view, new JPanel());
        this._splitPane.setResizeWeight(0);
        this._splitPane.setOneTouchExpandable(true);
        this._splitPane.setContinuousLayout(true);

        this.add(this._splitPane, BorderLayout.CENTER);
        this.setPreferredSize(new Dimension(800, 600));

        this._tree_view.addRejTreeNodeSelectionListener(this);
    }

    @Override
    public void nodeSelected(RejTreeNodeSelectionEvent e) {
        RejTreeNodeView v = e.getNode().getView();
        int curDividerLocation = this._splitPane.getDividerLocation();
        this._splitPane.setRightComponent(v);
        this._splitPane.setDividerLocation(curDividerLocation);
    }
}

@@ -85,16 +85,72 @@
 tryHive;
+%0Aimport com.williballenthin.rejistry.RegistryHiveBuffer;
 %0A%0Aimport
@@ -183,16 +183,44 @@
 a.awt.*;
+%0Aimport java.nio.ByteBuffer;
 %0A%0Apublic
@@ -511,24 +511,73 @@
 hive = hive;
+%0A%0A        // have to do these cause they're final
 %0A        thi
@@ -616,25 +616,24 @@
 his._hive);%0A
-%0A
         this
@@ -733,24 +733,461 @@
 w JPanel());
+%0A%0A        this.setupUI();%0A    %7D%0A%0A    public RejView(ByteBuffer buf) %7B%0A        super(new BorderLayout());%0A        this._hive = new RegistryHiveBuffer(buf);%0A%0A        // have to do these cause they're final%0A        this._tree_view = new RejTreeView(this._hive);%0A        this._splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,%0A                this._tree_view, new JPanel());%0A%0A        this.setupUI();%0A    %7D%0A%0A    private void setupUI() %7B
 %0A        thi

add constructor for ByteBuffers