Examples of PieSectionEntity


Examples of com.positive.charts.entity.PieSectionEntity

            String url = null;
            if (this.urlGenerator != null) {
              url = this.urlGenerator.generateURL(this.dataset,
                  key, this.pieIndex);
            }
            final PieSectionEntity entity = new PieSectionEntity(
                null, this.dataset, this.pieIndex, section,
                key, tip, url);
            entities.add(entity);
          }
        }
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

  public JRPrintHyperlink getEntityHyperlink(ChartEntity entity)
  {
    JRPrintHyperlink printHyperlink = null;
    if (hasHyperlinks() && entity instanceof PieSectionEntity)
    {
      PieSectionEntity pieEntity = (PieSectionEntity) entity;
      printHyperlink = (JRPrintHyperlink) sectionHyperlinks.get(pieEntity.getSectionKey());
    }
    return printHyperlink;
  }
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

      @Override
      public void chartMouseMoved(ChartMouseEvent event) {
        ChartEntity entity = event.getEntity();
        if (entity instanceof PieSectionEntity) {
          PieSectionEntity pieSectionEntity = (PieSectionEntity) entity;
          String sectionKey = (String) pieSectionEntity.getSectionKey();
          if (_groups.containsKey(sectionKey)) {
            chartPanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
          } else {
            chartPanel.setCursor(Cursor.getDefaultCursor());
          }
        } else {
          chartPanel.setCursor(Cursor.getDefaultCursor());
        }
      }

      @Override
      public void chartMouseClicked(ChartMouseEvent event) {
        ChartEntity entity = event.getEntity();
        if (entity instanceof PieSectionEntity) {
          PieSectionEntity pieSectionEntity = (PieSectionEntity) entity;
          String sectionKey = (String) pieSectionEntity.getSectionKey();
          if (_groups.containsKey(sectionKey)) {
            drillToGroup(sectionKey, true);
          }
        }
      }
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

                        PieURLGenerator urlGenerator = getURLGenerator();
                        if (urlGenerator != null) {
                            url = urlGenerator.generateURL(dataset, key,
                                    getPieIndex());
                        }
                        PieSectionEntity entity = new PieSectionEntity(path,
                                dataset, getPieIndex(), section, key, tip,
                                url);
                        entities.add(entity);
                    }
                }
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

        // Note; there is a simple ChartEntity also passed since Jfreechart 1.0rc1, that is ignored
        // System.out.println("ChartMapTag.generateLink: Link entity skipped, not XYItemEntity.class:" + ce);
      }
      } else if (linkGenerator instanceof PieSectionLinkGenerator) {
      if (ce instanceof PieSectionEntity) {
        PieSectionEntity pieEnt = (PieSectionEntity) ce;
        link = ((PieSectionLinkGenerator) linkGenerator)
            .generateLink(dataset, pieEnt.getSectionKey());
      }
    }
    return link;
  }
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

        tooltip = ((XYToolTipGenerator) toolTipGenerator)
            .generateToolTip((XYDataset) dataset, xyEnt.getSeriesIndex(), xyEnt.getItem());
        }
    } else if (toolTipGenerator instanceof PieToolTipGenerator) {
        if (ce instanceof PieSectionEntity) {
        PieSectionEntity pieEnt = (PieSectionEntity) ce;
        PieDataset ds = (PieDataset) dataset;
        final int index = pieEnt.getSectionIndex();
        tooltip = ((PieToolTipGenerator) toolTipGenerator)
            .generateToolTip(ds, ds.getKey(index), index);
        }
    } else {
      // throw because category is unknown
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

    public void testEquals() {
        StandardEntityCollection c1 = new StandardEntityCollection();
        StandardEntityCollection c2 = new StandardEntityCollection();
        assertTrue(c1.equals(c2));

        PieSectionEntity e1 = new PieSectionEntity(new Rectangle2D.Double(1.0,
                2.0, 3.0, 4.0), new DefaultPieDataset(), 0, 1, "Key",
                "ToolTip", "URL");
        c1.add(e1);
        assertFalse(c1.equals(c2));
        PieSectionEntity e2 = new PieSectionEntity(new Rectangle2D.Double(1.0,
                2.0, 3.0, 4.0), new DefaultPieDataset(), 0, 1, "Key",
                "ToolTip", "URL");
        c2.add(e2);
        assertTrue(c1.equals(c2));
    }
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        PieSectionEntity e1 = new PieSectionEntity(new Rectangle2D.Double(1.0,
                2.0, 3.0, 4.0), new DefaultPieDataset(), 0, 1, "Key",
                "ToolTip", "URL");
        StandardEntityCollection c1 = new StandardEntityCollection();
        c1.add(e1);
        StandardEntityCollection c2 = null;
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        PieSectionEntity e1 = new PieSectionEntity(new Rectangle2D.Double(1.0,
                2.0, 3.0, 4.0), new DefaultPieDataset(), 0, 1, "Key",
                "ToolTip", "URL");
        StandardEntityCollection c1 = new StandardEntityCollection();
        c1.add(e1);
        StandardEntityCollection c2 = null;
View Full Code Here

Examples of org.jfree.chart.entity.PieSectionEntity

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        PieSectionEntity e1 = new PieSectionEntity(new Rectangle2D.Double(
                1.0, 2.0, 3.0, 4.0), new DefaultPieDataset(), 1, 2, "Key",
                "ToolTip", "URL");
        PieSectionEntity e2 = new PieSectionEntity(new Rectangle2D.Double(1.0,
                2.0, 3.0, 4.0), new DefaultPieDataset(), 1, 2, "Key",
                "ToolTip", "URL");
        assertTrue(e1.equals(e2));

        e1.setArea(new Rectangle2D.Double(4.0, 3.0, 2.0, 1.0));
        assertFalse(e1.equals(e2));
        e2.setArea(new Rectangle2D.Double(4.0, 3.0, 2.0, 1.0));
        assertTrue(e1.equals(e2));

        e1.setToolTipText("New ToolTip");
        assertFalse(e1.equals(e2));
        e2.setToolTipText("New ToolTip");
        assertTrue(e1.equals(e2));

        e1.setURLText("New URL");
        assertFalse(e1.equals(e2));
        e2.setURLText("New URL");
        assertTrue(e1.equals(e2));

        e1.setDataset(null);
        assertFalse(e1.equals(e2));
        e2.setDataset(null);
        assertTrue(e1.equals(e2));

        e1.setPieIndex(99);
        assertFalse(e1.equals(e2));
        e2.setPieIndex(99);
        assertTrue(e1.equals(e2));

        e1.setSectionIndex(66);
        assertFalse(e1.equals(e2));
        e2.setSectionIndex(66);
        assertTrue(e1.equals(e2));

        e1.setSectionKey("ABC");
        assertFalse(e1.equals(e2));
        e2.setSectionKey("ABC");
        assertTrue(e1.equals(e2));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.