Package org.jfree.chart.labels

Examples of org.jfree.chart.labels.StandardPieToolTipGenerator


        plot2.setLabelLinkStroke(new BasicStroke(1.0f));
        assertEquals(plot1, plot2);

        // toolTipGenerator
        plot1.setToolTipGenerator(
            new StandardPieToolTipGenerator("{2}{1}{0}")
        );
        assertFalse(plot1.equals(plot2));
        plot2.setToolTipGenerator(
            new StandardPieToolTipGenerator("{2}{1}{0}")
        );
        assertEquals(plot1, plot2);

        // urlGenerator
        plot1.setURLGenerator(new StandardPieURLGenerator("xx"));
View Full Code Here


        PiePlot plot = new PiePlot(dataset);
        plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
        if (tooltips) {
            plot.setToolTipGenerator(
                new StandardPieToolTipGenerator(
                    StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT
                )
            );
        }
        if (urls) {
View Full Code Here

        plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));

        if (tooltips) {
            plot.setToolTipGenerator(
                new StandardPieToolTipGenerator(
                    StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT
                )
            );
        }
        if (urls) {
View Full Code Here

        RingPlot plot = new RingPlot(dataset);
        plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
        if (tooltips) {
            plot.setToolTipGenerator(
                new StandardPieToolTipGenerator(
                    StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT
                )
            );
        }
        if (urls) {
View Full Code Here

        plot.setBackgroundPaint(null);
        plot.setOutlineStroke(null);

        if (tooltips) {
            PieToolTipGenerator tooltipGenerator
                = new StandardPieToolTipGenerator();
            PiePlot pp = (PiePlot) plot.getPieChart().getPlot();
            pp.setToolTipGenerator(tooltipGenerator);
        }

        if (urls) {
View Full Code Here

                                              boolean urls) {

        PiePlot3D plot = new PiePlot3D(dataset);
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
        if (tooltips) {
            plot.setToolTipGenerator(new StandardPieToolTipGenerator());
        }
        if (urls) {
            plot.setURLGenerator(new StandardPieURLGenerator());
        }
        return new JFreeChart(
View Full Code Here

        pieChart.setBackgroundPaint(null);
        plot.setPieChart(pieChart);

        if (tooltips) {
            PieToolTipGenerator tooltipGenerator
                = new StandardPieToolTipGenerator();
            PiePlot pp = (PiePlot) plot.getPieChart().getPlot();
            pp.setToolTipGenerator(tooltipGenerator);
        }

        if (urls) {
View Full Code Here

        plot2.setLabelLinkStroke(new BasicStroke(1.0f));
        assertTrue(plot1.equals(plot2));
      
        // toolTipGenerator
        plot1.setToolTipGenerator(
            new StandardPieToolTipGenerator("{2}{1}{0}")
        );
        assertFalse(plot1.equals(plot2));
        plot2.setToolTipGenerator(
            new StandardPieToolTipGenerator("{2}{1}{0}")
        );
        assertTrue(plot1.equals(plot2));
       
        // urlGenerator
        plot1.setURLGenerator(new StandardPieURLGenerator("xx"));
View Full Code Here

    /**
     * Test that the equals() method distinguishes all fields.
     */
    public void testEquals() {
        StandardPieToolTipGenerator g1 = new StandardPieToolTipGenerator();
        StandardPieToolTipGenerator g2 = new StandardPieToolTipGenerator();
        assertTrue(g1.equals(g2));
        assertTrue(g2.equals(g1));
       
        g1 = new StandardPieToolTipGenerator(
            "{0}", new DecimalFormat("#,##0.00"),
            NumberFormat.getPercentInstance()
        );
        assertFalse(g1.equals(g2));
        g2 = new StandardPieToolTipGenerator(
            "{0}", new DecimalFormat("#,##0.00"),
            NumberFormat.getPercentInstance()
        );
        assertTrue(g1.equals(g2));

        g1 = new StandardPieToolTipGenerator(
            "{0} {1}", new DecimalFormat("#,##0.00"),
            NumberFormat.getPercentInstance()
        );
        assertFalse(g1.equals(g2));
        g2 = new StandardPieToolTipGenerator(
            "{0} {1}", new DecimalFormat("#,##0.00"),
            NumberFormat.getPercentInstance()
        );
        assertTrue(g1.equals(g2));
   
        g1 = new StandardPieToolTipGenerator(
            "{0} {1}", new DecimalFormat("#,##0"),
            NumberFormat.getPercentInstance()
        );
        assertFalse(g1.equals(g2));
        g2 = new StandardPieToolTipGenerator(
            "{0} {1}", new DecimalFormat("#,##0"),
            NumberFormat.getPercentInstance()
        );
        assertTrue(g1.equals(g2));

        g1 = new StandardPieToolTipGenerator(
            "{0} {1}", new DecimalFormat("#,##0"), new DecimalFormat("0.000%")
        );
        assertFalse(g1.equals(g2));
        g2 = new StandardPieToolTipGenerator(
            "{0} {1}", new DecimalFormat("#,##0"), new DecimalFormat("0.000%")
        );
        assertTrue(g1.equals(g2));
    }
View Full Code Here

   
    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        StandardPieToolTipGenerator g1 = new StandardPieToolTipGenerator();
        StandardPieToolTipGenerator g2 = null;
        try {
            g2 = (StandardPieToolTipGenerator) g1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(g1 != g2);
        assertTrue(g1.getClass() == g2.getClass());
        assertTrue(g1.equals(g2));
    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.labels.StandardPieToolTipGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.