FeatureInfo feature = (FeatureInfo) nodeInfo;
    public void init(DefaultMutableTreeNode top) {        layerFeatures = new Hashtable();        //Create a tree that allows one selection at a time.        final JTree tree = new JTree(top);        tree.getSelectionModel()                .setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);        tree.setVisibleRowCount(10);        //Listen for when the selection changes.        tree.addTreeSelectionListener(new TreeSelectionListener() {            public void valueChanged(TreeSelectionEvent e) {                DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();                if (node == null)                    return;                Object nodeInfo = node.getUserObject();                if (node.isLeaf() && nodeInfo instanceof FeatureInfo) {                    FeatureInfo feature = (FeatureInfo) nodeInfo;                    currentFeature = node;                    // enable addToLayer button here.                    addFeatureButton.setEnabled(true);                } else {                    // disable addToLayer button here.                    addFeatureButton.setEnabled(false);                }            }        });        if (playWithLineStyle) {            tree.putClientProperty("JTree.lineStyle", lineStyle);        }        //Create the scroll pane and add the tree to it.        GridBagLayout outergridbag = new GridBagLayout();        GridBagConstraints outerc = new GridBagConstraints();        JScrollPane treeView = new JScrollPane(tree);        setLayout(outergridbag);        outerc.fill = GridBagConstraints.BOTH;        outerc.anchor = GridBagConstraints.WEST;        outerc.insets = new Insets(10, 10, 10, 10);        outerc.gridx = GridBagConstraints.REMAINDER;        outerc.weighty = .75;        outerc.weightx = 1.0;        outergridbag.setConstraints(treeView, outerc);        add(treeView);        // Create the configuration pane        JPanel configPanel = new JPanel();        GridBagLayout gridbag = new GridBagLayout();        GridBagConstraints c = new GridBagConstraints();        configPanel.setLayout(gridbag);        c.gridheight = GridBagConstraints.REMAINDER;        Component da = drawingAttributes.getGUI();        gridbag.setConstraints(da, c);        configPanel.add(da);        c.gridx = 1;        c.gridheight = 1;        c.gridy = 0;        c.fill = GridBagConstraints.HORIZONTAL;        c.insets = new Insets(0, 5, 0, 5);        addFeatureButton = new JButton("Add Feature");        addFeatureButton.addActionListener(this);        addFeatureButton.setActionCommand(AddFeatureCmd);        gridbag.setConstraints(addFeatureButton, c);        configPanel.add(addFeatureButton);        addFeatureButton.setEnabled(false);        clearFeaturesButton = new JButton("Clear Features");        clearFeaturesButton.addActionListener(this);        clearFeaturesButton.setActionCommand(ClearFeaturesCmd);        c.gridy = GridBagConstraints.RELATIVE;        gridbag.setConstraints(clearFeaturesButton, c);        configPanel.add(clearFeaturesButton);        clearFeaturesButton.setEnabled(false);        if (layer != null) {            createLayerButton = new JButton("Set Features on Layer");        } else if (layerHandler != null) {            createLayerButton = new JButton("Create Layer");        } else {            createLayerButton = new JButton("Print Properties");        }        createLayerButton.addActionListener(this);        createLayerButton.setActionCommand(CreateLayerCmd);        gridbag.setConstraints(createLayerButton, c);        configPanel.add(createLayerButton);        createLayerButton.setEnabled(false);        JPanel currentFeatureListPanel = PaletteHelper.createVerticalPanel(" Current Features: ");        currentFeatureList = new JTextArea(EMPTY_FEATURE_LIST);        currentFeatureList.setEditable(false);        JScrollPane featureListScrollPane = new JScrollPane(currentFeatureList);        featureListScrollPane.setPreferredSize(new Dimension(150, 10));        currentFeatureListPanel.add(featureListScrollPane);        c.gridx = 2;        c.gridy = 0;        c.weightx = 1.0;        c.anchor = GridBagConstraints.NORTHWEST;        c.gridheight = GridBagConstraints.REMAINDER;        c.fill = GridBagConstraints.BOTH;        gridbag.setConstraints(currentFeatureListPanel, c);        configPanel.add(currentFeatureListPanel);        GridBagLayout gridbag2 = new GridBagLayout();        GridBagConstraints c2 = new GridBagConstraints();        JPanel namePanel = new JPanel();        namePanel.setLayout(gridbag2);        c2.weightx = 0;        c2.weighty = 0;        c2.anchor = GridBagConstraints.WEST;        JLabel nameLabel = new JLabel("Layer Name: ");        gridbag2.setConstraints(nameLabel, c2);        namePanel.add(nameLabel);        c2.fill = GridBagConstraints.HORIZONTAL;        c2.weightx = 1.0;        c2.weighty = 1.0;        nameField = new JTextField(layerName);        gridbag2.setConstraints(nameField, c2);        namePanel.add(nameField);        outerc.anchor = GridBagConstraints.WEST;        outerc.weighty = 0;        outergridbag.setConstraints(namePanel, outerc);        add(namePanel);        outerc.fill = GridBagConstraints.HORIZONTAL;        outerc.weighty = .25;        outerc.anchor = GridBagConstraints.CENTER;        outergridbag.setConstraints(configPanel, outerc);        add(configPanel);    }