*
*/
private void loadResults(List<CorrelationResult> segments) {
if (segments != null) {
Iterator<CorrelationResult> it = segments.iterator();
CorrelationResult currentSegment;
Segment segment;
XYChart chart;
int currentPos;
String name;
ChartPanel pnl;
if ((x == 0) || (y == 0)) {
x = this.jPnlResultCenter.getWidth() / 4;
y = this.jPnlResultCenter.getHeight() - 15;
}
Dimension dim = new Dimension(x, y);
DecimalFormat format = new DecimalFormat("####.00");
while (it.hasNext()) {
currentSegment = it.next();
//currentPos = this.controller.getAnalysis().getAllSegments().getSegments().indexOf(currentSegment);
segment = this.controller.getAnalysis().getAllSegments().getSegments().elementAt(currentSegment.getSegmentNumber());
name = "Segmento: " + currentSegment.getSegmentNumber();
chart = new XYChart(name);
chart.addSeries(name, segment.toDoubleArray(), 1);
chart.setShowLegend(false);
chart.setShowTitle(false);
pnl = chart.plot();
pnl.setMouseZoomable(false);
pnl.setPopupMenu(null);
BigDecimal correlation = currentSegment.getCorrelation().multiply(new BigDecimal(100));
String hint = "Grado de correlación: " + format.format(correlation);
JPnlItemAutoSelection img = new JPnlItemAutoSelection(currentSegment.getSegmentNumber(), pnl, this, hint);
img.setPreferredSize(dim);
img.revalidate();
this.jPnlResultCenter.add(img);
this.items.add(img);
}