}
}
private void setupGridChartSelection(Plot plot, GridChartView chartView) {
if (chartView.getPoint() != null) {
GridPointInfo point = chartView.getPoint();
final ChartSelection selection = chartView.getChart().getChartSelection();
final LineStyle lineStyle = selection.getLineStyle();
Paint outlinePaint = lineStyle.getColor() != null
? lineStyle.getColor()
: Color.BLUE;
final Stroke outlineStroke = lineStyle.getStroke() != null
? lineStyle.getStroke()
: new BasicStroke(5.0F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);
final Paint selectionPaint = selection.getFillPaint();
Object itemRenderer = null;
if (plot instanceof XYPlot) {
itemRenderer = ((XYPlot) plot).getRenderer();
} else if (plot instanceof CategoryPlot) {
itemRenderer = ((CategoryPlot) plot).getRenderer();
}
if (itemRenderer != null && itemRenderer instanceof CustomizedRenderer) {
if (itemRenderer instanceof BarRenderer) {
((BarRenderer) itemRenderer).setDrawBarOutline(true);
} else if (itemRenderer instanceof XYBarRenderer) {
((XYBarRenderer) itemRenderer).setDrawBarOutline(true);
} else if (itemRenderer instanceof XYRendererAdapter) {
((XYRendererAdapter) itemRenderer).setDrawOutlines(true);
} else if (itemRenderer instanceof XYLineAndShapeRenderer) {
((XYLineAndShapeRenderer) itemRenderer).setDrawOutlines(true);
}
final SeriesInfo series = point.getSeries();
((CustomizedRenderer) itemRenderer).setItemOutlinePaint(series.getIndex(), point.getIndex(), outlinePaint);
((CustomizedRenderer) itemRenderer).setItemOutlineStroke(series.getIndex(), point.getIndex(), outlineStroke);
((CustomizedRenderer) itemRenderer).setItemPaint(series.getIndex(), point.getIndex(), selectionPaint);
}
}
}