Examples of StandardEntityCollection


Examples of com.positive.charts.entity.StandardEntityCollection

    EntityBlockParams ebp = null;
    final BlockResult r = new BlockResult();
    if (params instanceof EntityBlockParams) {
      ebp = (EntityBlockParams) params;
      if (ebp.getGenerateEntities()) {
        final EntityCollection ec = new StandardEntityCollection();
        final LegendItemEntity entity = new LegendItemEntity(
            new Rectangle(area.x, area.y, area.width, area.height));
        entity.setSeriesIndex(this.series);
        entity.setSeriesKey(this.seriesKey);
        entity.setDataset(this.dataset);
        entity.setToolTipText(this.getToolTipText());
        entity.setURLText(this.getURLText());
        ec.add(entity);
        r.setEntityCollection(ec);
      }
    }
    return r;
  }
View Full Code Here

Examples of com.positive.charts.entity.StandardEntityCollection

   * @return An instance of {@link EntityBlockResult}, or <code>null</code>.
   */
  public Object draw(final GC g2, final Rectangle area, final Object params) {
    // check if we need to collect chart entities from the container
    EntityBlockParams ebp = null;
    StandardEntityCollection sec = null;
    if (params instanceof EntityBlockParams) {
      ebp = (EntityBlockParams) params;
      if (ebp.getGenerateEntities()) {
        sec = new StandardEntityCollection();
      }
    }
    Rectangle contentArea = new Rectangle(area.x, area.y, area.width,
        area.height);
    contentArea = this.trimMargin(contentArea);
    this.drawBorder(g2, contentArea);
    contentArea = this.trimBorder(contentArea);
    contentArea = this.trimPadding(contentArea);
    final Iterator iterator = this.blocks.iterator();
    while (iterator.hasNext()) {
      final Block block = (Block) iterator.next();
      final Rectangle bounds = block.getBounds();
      final Rectangle drawArea = RectUtils.doubleRect(bounds.x + area.x,
          bounds.y + area.y, bounds.width, bounds.height);
      final Object r = block.draw(g2, drawArea, params);
      if (sec != null) {
        if (r instanceof EntityBlockResult) {
          final EntityBlockResult ebr = (EntityBlockResult) r;
          final EntityCollection ec = ebr.getEntityCollection();
          sec.addAll(ec);
        }
      }
    }
    BlockResult result = null;
    if (sec != null) {
View Full Code Here

Examples of com.positive.charts.entity.StandardEntityCollection

  /**
   * Constructs a new ChartRenderingInfo structure that can be used to collect
   * information about the dimensions of a rendered chart.
   */
  public ChartRenderingInfo() {
    this(new StandardEntityCollection());
  }
View Full Code Here

Examples of com.positive.charts.entity.StandardEntityCollection

        || (position == RectangleEdge.RIGHT)) {
      this.drawVertical(g2, area);
    }
    final BlockResult result = new BlockResult();
    if (entity != null) {
      final StandardEntityCollection sec = new StandardEntityCollection();
      sec.add(entity);
      result.setEntityCollection(sec);
    }
    return result;
  }
View Full Code Here

Examples of com.positive.charts.entity.StandardEntityCollection

    area = this.trimBorder(area);
    area = this.trimPadding(area);

    // check if we need to collect chart entities from the container
    EntityBlockParams ebp = null;
    StandardEntityCollection sec = null;
    Rectangle entityArea = null;
    if (params instanceof EntityBlockParams) {
      ebp = (EntityBlockParams) params;
      if (ebp.getGenerateEntities()) {
        sec = new StandardEntityCollection();
        entityArea = new Rectangle(area.x, area.y, area.width,
            area.height);
      }
    }
    g2.setForeground(this.paint);
    g2.setFont(this.font);
    this.label.draw(g2, (float) area.x + 1, (float) area.y + 1,
        TextBlockAnchor.TOP_LEFT);
    BlockResult result = null;
    if ((ebp != null) && (sec != null)) {
      if ((this.toolTipText != null) || (this.urlText != null)) {
        final ChartEntity entity = new ChartEntity(entityArea,
            this.toolTipText, this.urlText);
        sec.add(entity);
        result = new BlockResult();
        result.setEntityCollection(sec);
      }
    }
    return result;
View Full Code Here

Examples of org.jfree.chart.entity.StandardEntityCollection

    }

    public static String renderChart(JFreeChart chart, String fileName) {
        String imageFile = "";
        try {
            final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
            TempDir tempDir = TempDirUtils.createTempDir();
            File file1 = tempDir.createFile(fileName);
            imageFile = "<IMG SRC=\"file:" + file1.getAbsolutePath() + "\" " + "WIDTH=\"600\" HEIGHT=\"400\" BORDER=\"0\" USEMAP=\"#chart\"></IMG>";
            ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info);
        } catch (IOException e) {
View Full Code Here

Examples of org.jfree.chart.entity.StandardEntityCollection

     * @return An instance of {@link EntityBlockResult}, or <code>null</code>.
     */
    public Object draw(Graphics2D g2, Rectangle2D area, Object params) {
        // check if we need to collect chart entities from the container
        EntityBlockParams ebp = null;
        StandardEntityCollection sec = null;
        if (params instanceof EntityBlockParams) {
            ebp = (EntityBlockParams) params;
            if (ebp.getGenerateEntities()) {
                sec = new StandardEntityCollection();
            }
        }
        Rectangle2D contentArea = (Rectangle2D) area.clone();
        contentArea = trimMargin(contentArea);
        drawBorder(g2, contentArea);
        contentArea = trimBorder(contentArea);
        contentArea = trimPadding(contentArea);
        Iterator iterator = this.blocks.iterator();
        while (iterator.hasNext()) {
            Block block = (Block) iterator.next();
            Rectangle2D bounds = block.getBounds();
            Rectangle2D drawArea = new Rectangle2D.Double(bounds.getX()
                    + area.getX(), bounds.getY() + area.getY(),
                    bounds.getWidth(), bounds.getHeight());
            Object r = block.draw(g2, drawArea, params);
            if (sec != null) {
                if (r instanceof EntityBlockResult) {
                    EntityBlockResult ebr = (EntityBlockResult) r;
                    EntityCollection ec = ebr.getEntityCollection();
                    sec.addAll(ec);
                }
            }
        }
        BlockResult result = null;
        if (sec != null) {
View Full Code Here

Examples of org.jfree.chart.entity.StandardEntityCollection

        area = trimBorder(area);
        area = trimPadding(area);

        // check if we need to collect chart entities from the container
        EntityBlockParams ebp = null;
        StandardEntityCollection sec = null;
        Shape entityArea = null;
        if (params instanceof EntityBlockParams) {
            ebp = (EntityBlockParams) params;
            if (ebp.getGenerateEntities()) {
                sec = new StandardEntityCollection();
                entityArea = (Shape) area.clone();
            }
        }
        g2.setPaint(this.paint);
        g2.setFont(this.font);
        Point2D pt = RectangleAnchor.coordinates(area, this.textAnchor);
        this.label.draw(g2, (float) pt.getX(), (float) pt.getY(),
                this.contentAlignmentPoint);
        BlockResult result = null;
        if (ebp != null && sec != null) {
            if (this.toolTipText != null || this.urlText != null) {
                ChartEntity entity = new ChartEntity(entityArea,
                        this.toolTipText, this.urlText);
                sec.add(entity);
                result = new BlockResult();
                result.setEntityCollection(sec);
            }
        }
        return result;
View Full Code Here

Examples of org.jfree.chart.entity.StandardEntityCollection

    /**
     * Constructs a new ChartRenderingInfo structure that can be used to
     * collect information about the dimensions of a rendered chart.
     */
    public ChartRenderingInfo() {
        this(new StandardEntityCollection());
    }
View Full Code Here

Examples of org.jfree.chart.entity.StandardEntityCollection

            // the entire chart at the beginning of the list.  This will
            // make it appear last in the image map (which is important,
            // because browsers process the image map areas in the order that
            // they appear; having the entire chart area listed first would
            // obscure all of the other image map areas).
            EntityCollection entities = new StandardEntityCollection();
            entities.add(new ChartEntity(info.getChartArea(), tooltip, href));
            if (info.getEntityCollection() != null)
                entities.addAll(info.getEntityCollection());
           
            // Next: most of our chart entities will not have URLs. URL values
            // don't inherit in the imagemap, so if we want the entire image
            // to have a single URL, we need to assign that URL to every
            // area in the chart.
            for (Iterator i = entities.iterator(); i.hasNext();) {
                ChartEntity ce = (ChartEntity) i.next();
                // check for no-op chart entity - these won't appear in the
                // image map anyway, so they don't need to be adjusted
                if (ce.getToolTipText() == null && ce.getURLText() == null)
                    continue;
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.