Search in sources :

Example 6 with PolarItemRenderer

use of org.jfree.chart.renderer.PolarItemRenderer in project SIMVA-SoS by SESoS.

the class PolarPlot method getLegendItems.

/**
 * Returns the legend items for the plot.  Each legend item is generated by
 * the plot's m_Renderer, since the m_Renderer is responsible for the visual
 * representation of the data.
 *
 * @return The legend items.
 */
@Override
public LegendItemCollection getLegendItems() {
    if (this.fixedLegendItems != null) {
        return this.fixedLegendItems;
    }
    LegendItemCollection result = new LegendItemCollection();
    int count = this.datasets.size();
    for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) {
        XYDataset dataset = getDataset(datasetIndex);
        PolarItemRenderer renderer = getRenderer(datasetIndex);
        if (dataset != null && renderer != null) {
            int seriesCount = dataset.getSeriesCount();
            for (int i = 0; i < seriesCount; i++) {
                LegendItem item = renderer.getLegendItem(i);
                result.add(item);
            }
        }
    }
    return result;
}
Also used : LegendItem(org.jfree.chart.LegendItem) LegendItemCollection(org.jfree.chart.LegendItemCollection) XYDataset(org.jfree.data.xy.XYDataset) PolarItemRenderer(org.jfree.chart.renderer.PolarItemRenderer) Point(java.awt.Point) Paint(java.awt.Paint)

Aggregations

PolarItemRenderer (org.jfree.chart.renderer.PolarItemRenderer)6 Paint (java.awt.Paint)5 Point (java.awt.Point)4 XYDataset (org.jfree.data.xy.XYDataset)4 ArrayList (java.util.ArrayList)2 ValueAxis (org.jfree.chart.axis.ValueAxis)2 BasicStroke (java.awt.BasicStroke)1 Stroke (java.awt.Stroke)1 List (java.util.List)1 LegendItem (org.jfree.chart.LegendItem)1 LegendItemCollection (org.jfree.chart.LegendItemCollection)1 Axis (org.jfree.chart.axis.Axis)1 Dataset (org.jfree.data.general.Dataset)1 ObjectList (org.jfree.util.ObjectList)1 PublicCloneable (org.jfree.util.PublicCloneable)1