Search in sources :

Example 1 with CategoryURLGenerator

use of org.jfree.chart.urls.CategoryURLGenerator in project SIMVA-SoS by SESoS.

the class AreaChartTest method testSetSeriesURLGenerator.

/**
 * Check that setting a URL generator for a series does override the
 * default generator.
 */
@Test
public void testSetSeriesURLGenerator() {
    CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator();
    renderer.setSeriesItemURLGenerator(0, url1);
    CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0);
    assertSame(url2, url1);
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) CategoryURLGenerator(org.jfree.chart.urls.CategoryURLGenerator) StandardCategoryURLGenerator(org.jfree.chart.urls.StandardCategoryURLGenerator) StandardCategoryURLGenerator(org.jfree.chart.urls.StandardCategoryURLGenerator) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Test(org.junit.Test)

Example 2 with CategoryURLGenerator

use of org.jfree.chart.urls.CategoryURLGenerator in project SIMVA-SoS by SESoS.

the class GanttChartTest method testSetSeriesURLGenerator.

/**
 * Check that setting a URL generator for a series does override the
 * default generator.
 */
@Test
public void testSetSeriesURLGenerator() {
    CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator();
    renderer.setSeriesItemURLGenerator(0, url1);
    CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0);
    assertSame(url2, url1);
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) CategoryURLGenerator(org.jfree.chart.urls.CategoryURLGenerator) StandardCategoryURLGenerator(org.jfree.chart.urls.StandardCategoryURLGenerator) StandardCategoryURLGenerator(org.jfree.chart.urls.StandardCategoryURLGenerator) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Test(org.junit.Test)

Example 3 with CategoryURLGenerator

use of org.jfree.chart.urls.CategoryURLGenerator in project SIMVA-SoS by SESoS.

the class BarChart3DTest method testSetSeriesURLGenerator.

/**
 * Check that setting a URL generator for a series does override the
 * default generator.
 */
@Test
public void testSetSeriesURLGenerator() {
    CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator();
    renderer.setSeriesItemURLGenerator(0, url1);
    CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0);
    assertSame(url2, url1);
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) CategoryURLGenerator(org.jfree.chart.urls.CategoryURLGenerator) StandardCategoryURLGenerator(org.jfree.chart.urls.StandardCategoryURLGenerator) StandardCategoryURLGenerator(org.jfree.chart.urls.StandardCategoryURLGenerator) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Test(org.junit.Test)

Example 4 with CategoryURLGenerator

use of org.jfree.chart.urls.CategoryURLGenerator in project SIMVA-SoS by SESoS.

the class AbstractCategoryItemRenderer method addItemEntity.

/**
 * Adds an entity with the specified hotspot.
 *
 * @param entities  the entity collection.
 * @param dataset  the dataset.
 * @param row  the row index.
 * @param column  the column index.
 * @param hotspot  the hotspot (<code>null</code> not permitted).
 */
protected void addItemEntity(EntityCollection entities, CategoryDataset dataset, int row, int column, Shape hotspot) {
    ParamChecks.nullNotPermitted(hotspot, "hotspot");
    if (!getItemCreateEntity(row, column)) {
        return;
    }
    String tip = null;
    CategoryToolTipGenerator tipster = getToolTipGenerator(row, column);
    if (tipster != null) {
        tip = tipster.generateToolTip(dataset, row, column);
    }
    String url = null;
    CategoryURLGenerator urlster = getItemURLGenerator(row, column);
    if (urlster != null) {
        url = urlster.generateURL(dataset, row, column);
    }
    CategoryItemEntity entity = new CategoryItemEntity(hotspot, tip, url, dataset, dataset.getRowKey(row), dataset.getColumnKey(column));
    entities.add(entity);
}
Also used : CategoryToolTipGenerator(org.jfree.chart.labels.CategoryToolTipGenerator) CategoryURLGenerator(org.jfree.chart.urls.CategoryURLGenerator) CategoryItemEntity(org.jfree.chart.entity.CategoryItemEntity)

Example 5 with CategoryURLGenerator

use of org.jfree.chart.urls.CategoryURLGenerator in project SIMVA-SoS by SESoS.

the class WaterfallChartTest method testSetSeriesURLGenerator.

/**
 * Check that setting a URL generator for a series does override the
 * default generator.
 */
@Test
public void testSetSeriesURLGenerator() {
    CategoryPlot plot = (CategoryPlot) this.chart.getPlot();
    CategoryItemRenderer renderer = plot.getRenderer();
    StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator();
    renderer.setSeriesItemURLGenerator(0, url1);
    CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0);
    assertTrue(url2 == url1);
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) CategoryURLGenerator(org.jfree.chart.urls.CategoryURLGenerator) StandardCategoryURLGenerator(org.jfree.chart.urls.StandardCategoryURLGenerator) StandardCategoryURLGenerator(org.jfree.chart.urls.StandardCategoryURLGenerator) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Test(org.junit.Test)

Aggregations

CategoryURLGenerator (org.jfree.chart.urls.CategoryURLGenerator)12 CategoryPlot (org.jfree.chart.plot.CategoryPlot)10 CategoryItemRenderer (org.jfree.chart.renderer.category.CategoryItemRenderer)10 StandardCategoryURLGenerator (org.jfree.chart.urls.StandardCategoryURLGenerator)10 Test (org.junit.Test)10 CategoryItemEntity (org.jfree.chart.entity.CategoryItemEntity)2 CategoryToolTipGenerator (org.jfree.chart.labels.CategoryToolTipGenerator)2 Shape (java.awt.Shape)1 Ellipse2D (java.awt.geom.Ellipse2D)1