dispatcher = new HeatMapDispatcher(model,statusPanel);
dispatcher = new HeatMapDispatcher(model,statusPanel,gradPanel); dispatcher.setCurrentMode(modeBar.getCurrentMode()); dispatcher.setCurrentScale(scaleBar.getCurrentScaleType());
    public void modelChanged(HeatMapModel model)    {        if(model == null)        {            return;        }        this.model = model;        setTitle("HeatMap: " + model.getInfoSource().getDataset().getName());        treePanel.setModel(model.getModel());        treePanel.removeListener(dispatcher);        modeBar.removeListener(dispatcher);        dispatcher = new HeatMapDispatcher(model,statusPanel);        treePanel.addListener(dispatcher);        modeBar.addListener(dispatcher);        gradPanel.setEnabled(false);        revalidate();        repaint();    }