"This renderer is programmatically invoked, don't register it in the descriptor catalog.");
}
@Override
public JComponent render(CrosstabResult result) {
final CrosstabPanel crosstabPanel = super.renderInternal(result, false);
final DCTable table = crosstabPanel.getTable();
if (isInitiallyCharted(table) || isTooLimitedToChart(table)) {
return crosstabPanel;
}
final DCPanel headerPanel = new DCPanel();
headerPanel.setLayout(new FlowLayout(Alignment.RIGHT.getFlowLayoutAlignment(), 1, 1));
final JButton chartButton = new JButton("Show distribution chart", ImageManager.getInstance().getImageIcon(
"images/chart-types/bar.png"));
chartButton.setMargin(new Insets(1, 1, 1, 1));
chartButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
headerPanel.setVisible(false);
displayChart(table, crosstabPanel.getDisplayChartCallback());
}
});
headerPanel.add(chartButton);