Skip to content
Snippets Groups Projects
Commit 47babac7 authored by Sylvain Mainguy's avatar Sylvain Mainguy
Browse files

keep title when updating the plot

parent 5392ac80
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ public class ImageViewer extends CometeComposite<Control> implements IImageViewe
private int matrixWidth = 0;
private int matrixHeight = 0;
private final int horizontalAlignment = IComponent.CENTER;
private String title = null;
private IPlot plot;
private Frame frame;
......@@ -91,6 +92,7 @@ public class ImageViewer extends CometeComposite<Control> implements IImageViewe
frame.remove((JPanel) oldPlot);
}
this.plot = plot;
title = getText();
final Composite composite = this;
Display display = Display.getCurrent();
if (display == null) {
......@@ -281,7 +283,7 @@ public class ImageViewer extends CometeComposite<Control> implements IImageViewe
}
IPlot newPlot = null;
if (dataset instanceof XYZDataset) {
newPlot = PlotFactory.createHist2DPanel(((XYZDataset) dataset), "title");
newPlot = PlotFactory.createHist2DPanel(((XYZDataset) dataset), title);
}
setPlot(newPlot);
}
......@@ -373,6 +375,7 @@ public class ImageViewer extends CometeComposite<Control> implements IImageViewe
JFreeChart chart = plot.getChart();
if (chart != null) {
chart.setTitle(value);
title = value;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment