/** * Check that the legendItemLabelGenerator is cloned. */ @Test public void testCloning_LegendItemLabelGenerator() throws CloneNotSupportedException { StandardXYSeriesLabelGenerator generator = new StandardXYSeriesLabelGenerator("Series {0}"); XYBarRenderer r1 = new XYBarRenderer(); r1.setLegendItemLabelGenerator(generator); XYBarRenderer r2 = (XYBarRenderer) r1.clone(); assertTrue(r1 != r2); assertTrue(r1.getClass() == r2.getClass()); assertTrue(r1.equals(r2)); // check that the generator has been cloned assertTrue(r1.getLegendItemLabelGenerator() != r2.getLegendItemLabelGenerator()); }
/** * Check that the legendItemToolTipGenerator is cloned. */ @Test public void testCloning_LegendItemToolTipGenerator() throws CloneNotSupportedException { StandardXYSeriesLabelGenerator generator = new StandardXYSeriesLabelGenerator("Series {0}"); XYBarRenderer r1 = new XYBarRenderer(); r1.setLegendItemToolTipGenerator(generator); XYBarRenderer r2 = (XYBarRenderer) r1.clone(); assertTrue(r1 != r2); assertTrue(r1.getClass() == r2.getClass()); assertTrue(r1.equals(r2)); // check that the generator has been cloned assertTrue(r1.getLegendItemToolTipGenerator() != r2.getLegendItemToolTipGenerator()); }
/** * Check that the legendItemURLGenerator is cloned. */ @Test public void testCloning_LegendItemURLGenerator() throws CloneNotSupportedException { StandardXYSeriesLabelGenerator generator = new StandardXYSeriesLabelGenerator("Series {0}"); XYBarRenderer r1 = new XYBarRenderer(); r1.setLegendItemURLGenerator(generator); XYBarRenderer r2 = (XYBarRenderer) r1.clone(); assertTrue(r1 != r2); assertTrue(r1.getClass() == r2.getClass()); assertTrue(r1.equals(r2)); // check that the generator has been cloned assertTrue(r1.getLegendItemURLGenerator() != r2.getLegendItemURLGenerator()); }
/** * Some checks for the generalLabel() method. */ public void testGenerateLabel() { StandardXYSeriesLabelGenerator g = new StandardXYSeriesLabelGenerator("Series {0}"); XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(new XYSeries("1")); dataset.addSeries(new XYSeries("2")); assertEquals("Series 1", g.generateLabel(dataset, 0)); assertEquals("Series 2", g.generateLabel(dataset, 1)); }
/** * Creates a renderer where the tooltip generator and the URL generator are * both <code>null</code>. */ protected AbstractXYItemRenderer() { this.itemLabelGenerator = null; this.itemLabelGeneratorList = new ObjectList(); this.toolTipGenerator = null; this.toolTipGeneratorList = new ObjectList(); this.urlGenerator = null; this.backgroundAnnotations = new java.util.ArrayList(); this.foregroundAnnotations = new java.util.ArrayList(); this.defaultEntityRadius = 3; this.legendItemLabelGenerator = new StandardXYSeriesLabelGenerator( "{0}"); }
/** * Creates a renderer where the tooltip generator and the URL generator are * both <code>null</code>. */ protected AbstractXYItemRenderer() { super(); this.itemLabelGenerator = null; this.itemLabelGeneratorMap = new HashMap<Integer, XYItemLabelGenerator>(); this.toolTipGenerator = null; this.toolTipGeneratorMap = new HashMap<Integer, XYToolTipGenerator>(); this.urlGenerator = null; this.backgroundAnnotations = new java.util.ArrayList(); this.foregroundAnnotations = new java.util.ArrayList(); this.legendItemLabelGenerator = new StandardXYSeriesLabelGenerator( "{0}"); }
/** * Creates a renderer where the tooltip generator and the URL generator are * both {@code null}. */ protected AbstractXYItemRenderer() { super(); this.itemLabelGeneratorMap = new HashMap<Integer, XYItemLabelGenerator>(); this.toolTipGeneratorMap = new HashMap<Integer, XYToolTipGenerator>(); this.urlGenerator = null; this.backgroundAnnotations = new java.util.ArrayList(); this.foregroundAnnotations = new java.util.ArrayList(); this.legendItemLabelGenerator = new StandardXYSeriesLabelGenerator( "{0}"); }
/** * Creates a renderer where the tooltip generator and the URL generator are * both <code>null</code>. */ protected AbstractXYItemRenderer() { super(); this.itemLabelGenerator = null; this.itemLabelGeneratorList = new ObjectList(); this.toolTipGenerator = null; this.toolTipGeneratorList = new ObjectList(); this.urlGenerator = null; this.backgroundAnnotations = new java.util.ArrayList(); this.foregroundAnnotations = new java.util.ArrayList(); this.defaultEntityRadius = 3; this.legendItemLabelGenerator = new StandardXYSeriesLabelGenerator( "{0}"); }
/** * Creates a renderer where the tooltip generator and the URL generator are * both <code>null</code>. */ protected AbstractXYItemRenderer() { super(); this.itemLabelGenerator = null; this.itemLabelGeneratorList = new ObjectList(); this.toolTipGenerator = null; this.toolTipGeneratorList = new ObjectList(); this.urlGenerator = null; this.backgroundAnnotations = new java.util.ArrayList(); this.foregroundAnnotations = new java.util.ArrayList(); this.legendItemLabelGenerator = new StandardXYSeriesLabelGenerator( "{0}"); }
/** * Simple check that hashCode is implemented. */ public void testHashCode() { StandardXYSeriesLabelGenerator g1 = new StandardXYSeriesLabelGenerator(); StandardXYSeriesLabelGenerator g2 = new StandardXYSeriesLabelGenerator(); assertTrue(g1.equals(g2)); assertTrue(g1.hashCode() == g2.hashCode()); }
/** * Creates a renderer where the tooltip generator and the URL generator are * both <code>null</code>. */ protected AbstractXYItemRenderer() { super(); this.itemLabelGeneratorList = new ObjectList(); this.toolTipGeneratorList = new ObjectList(); this.urlGeneratorList = new ObjectList(); this.baseURLGenerator = null; this.backgroundAnnotations = new java.util.ArrayList(); this.foregroundAnnotations = new java.util.ArrayList(); this.legendItemLabelGenerator = new StandardXYSeriesLabelGenerator( "{0}"); }
/** * Creates a renderer where the tooltip generator and the URL generator are * both <code>null</code>. */ protected AbstractXYItemRenderer() { this.itemLabelGenerator = null; this.itemLabelGeneratorList = new ObjectList(); this.toolTipGenerator = null; this.toolTipGeneratorList = new ObjectList(); this.urlGenerator = null; this.backgroundAnnotations = new java.util.ArrayList(); this.foregroundAnnotations = new java.util.ArrayList(); this.defaultEntityRadius = 3; this.legendItemLabelGenerator = new StandardXYSeriesLabelGenerator("{0}"); }