*/
private void showGraphic(String name, StatsReporter reporter) {
QChart chart = reporter.findChartByName(name);
if (chart == null) {
logger.error("Can not find chart " + name);
return;
}
if (chart.isBufferedImage()) {
// Get a Singleton to manage the image to display
GraphicImagePanel panelImage = tabPageController.getGraphicImage();
BufferedImage imageToDisplay = chart.getBufferedImage();
// Set the image with the file image get
panelImage.setImage(imageToDisplay);
// Scale the image
if (tabPageController.getTypeAnalysis() == AnalysisType.CLUSTERING ) {
int width = imageToDisplay.getWidth();
int height = imageToDisplay.getHeight();
panelImage.setPreferredSize(new Dimension(width, height));
panelImage.resizeImage(width, height);
} else {
panelImage.resizeImage(rightScrollPane.getWidth(), rightScrollPane.getHeight());
}
rightScrollPane.setViewportView(panelImage);
} else {
JFreeChart jFreeChart = chart.getJFreeChart();
ChartPanel panelImage = new ChartPanel( jFreeChart );
if (chart.canExportRawData()) {
JMenuItem exportDataItem = createExportRawDataMenuItem(chart, this);
panelImage.getPopupMenu().addSeparator();
panelImage.getPopupMenu().add( exportDataItem );
}
panelImage.setSize(rightScrollPane.getSize());