treePanel.addListener(new HeatMapTreeListener() { public void nodeSelected(SemanticTypeTree.TreeNode node) { if(!(node instanceof SemanticTypeTree.ElementNode)) { gradPanel.setEnabled(false); } else gradPanel.setEnabled(true); } });
    private void buildUI()    {        Container contentPane = getContentPane();        contentPane.setLayout(new BorderLayout());                JPanel mainPanel = new JPanel();        mainPanel.setLayout(new BorderLayout());                JScrollPane scrollPane = new JScrollPane(treePanel);        scrollPane.setPreferredSize(new Dimension(250,200));        scrollPane.setSize(new Dimension(250,200));        mainPanel.add(scrollPane,BorderLayout.CENTER);                JPanel controlPanel = new JPanel();                gradPanel.setPreferredSize(new Dimension(250,90));        gradPanel.setSize(new Dimension(250,90));        gradPanel.setEnabled(false);                controlPanel.setLayout(new BorderLayout());        controlPanel.add(gradPanel,BorderLayout.CENTER);                JPanel barPanel = new JPanel();        barPanel.add(modeBar,BorderLayout.CENTER);                JPanel scalePanel = new JPanel();        scalePanel.add(scaleBar,BorderLayout.CENTER);                controlPanel.add(barPanel,BorderLayout.NORTH);        controlPanel.add(scalePanel,BorderLayout.SOUTH);                mainPanel.add(controlPanel,BorderLayout.SOUTH);                contentPane.add(mainPanel,BorderLayout.CENTER);        contentPane.add(statusPanel,BorderLayout.SOUTH);                if(model != null)        {            setTitle("HeatMap: " + model.getInfoSource().getDataset().getName());        }        else        {            setTitle("HeatMap: [no data]");        }        statusPanel.showMessage("Dataset attributes loaded.");        pack();    }