if(this.boundingBox == null) return seriesCol.getDomainBounds(true);
else return new Range(boundingBox.minX, boundingBox.maxX);
}
private XYPlot createPlot(final XYSeriesCollection problem, XYSeriesCollection shipments, XYSeriesCollection solution) {
XYPlot plot = new XYPlot();
plot.setBackgroundPaint(Color.LIGHT_GRAY);
plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
XYLineAndShapeRenderer problemRenderer = getProblemRenderer(problem);
plot.setDataset(0, problem);
plot.setRenderer(0, problemRenderer);
XYItemRenderer shipmentsRenderer = getShipmentRenderer(shipments);
plot.setDataset(1, shipments);
plot.setRenderer(1, shipmentsRenderer);
if(solution != null){
XYItemRenderer solutionRenderer = getRouteRenderer(solution);
plot.setDataset(2, solution);
plot.setRenderer(2, solutionRenderer);
}
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
if(boundingBox == null){
xAxis.setRangeWithMargins(getDomainRange(problem));
yAxis.setRangeWithMargins(getRange(problem));
}
else{
xAxis.setRangeWithMargins(new Range(boundingBox.minX, boundingBox.maxX));
yAxis.setRangeWithMargins(new Range(boundingBox.minY, boundingBox.maxY));
}
plot.setDomainAxis(xAxis);
plot.setRangeAxis(yAxis);
return plot;
}