Package com.positive.charts.renderer.category

Examples of com.positive.charts.renderer.category.CategoryItemRenderer


            final int columnCount = data.getColumnCount();
            for (int c = 0; c < columnCount; c++) {
              final double xx = axis.getCategoryJava2DCoordinate(
                  anchor, c, columnCount, dataArea,
                  domainAxisEdge);
              final CategoryItemRenderer renderer1 = this
                  .getRenderer();
              if (renderer1 != null) {
                renderer1.drawDomainGridline(g2, this,
                    dataArea, xx);
              }
            }
          }
        }
View Full Code Here


   *            the layer (foreground or background).
   */
  protected void drawDomainMarkers(final GC g2, final Rectangle dataArea,
      final int index, final Layer layer) {

    final CategoryItemRenderer r = this.getRenderer(index);
    if (r == null) {
      return;
    }

    final Collection markers = this.getDomainMarkers(index, layer);
    final CategoryAxis axis = this.getDomainAxisForDataset(index);
    if ((markers != null) && (axis != null)) {
      final Iterator iterator = markers.iterator();
      while (iterator.hasNext()) {
        final CategoryMarker marker = (CategoryMarker) iterator.next();
        r.drawDomainMarker(g2, this, axis, marker, dataArea);
      }
    }

  }
View Full Code Here

        final ValueAxis axis = this.getRangeAxis();
        if (axis != null) {
          final Iterator iterator = ticks.iterator();
          while (iterator.hasNext()) {
            final ValueTick tick = (ValueTick) iterator.next();
            final CategoryItemRenderer renderer1 = this
                .getRenderer();
            if (renderer1 != null) {
              renderer1.drawRangeGridline(g2, this, this
                  .getRangeAxis(), dataArea, tick.getValue());
            }
          }
        }
      }
View Full Code Here

   *            the layer (foreground or background).
   */
  protected void drawRangeMarkers(final GC g2, final Rectangle dataArea,
      final int index, final Layer layer) {

    final CategoryItemRenderer r = this.getRenderer(index);
    if (r == null) {
      return;
    }

    final Collection markers = this.getRangeMarkers(index, layer);
    final ValueAxis axis = this.getRangeAxisForDataset(index);
    if ((markers != null) && (axis != null)) {
      final Iterator iterator = markers.iterator();
      while (iterator.hasNext()) {
        final Marker marker = (Marker) iterator.next();
        r.drawRangeMarker(g2, this, axis, marker, dataArea);
      }
    }

  }
View Full Code Here

    // iterate through the datasets that map to the axis and get the union
    // of the ranges.
    final Iterator iterator = mappedDatasets.iterator();
    while (iterator.hasNext()) {
      final CategoryDataset d = (CategoryDataset) iterator.next();
      final CategoryItemRenderer r = this.getRendererForDataset(d);
      if (r != null) {
        result = Range.combine(result, r.findRangeBounds(d));
      }
    }
    return result;

  }
View Full Code Here

      // get the legend items for the datasets...
      final int count = this.datasets.size();
      for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) {
        final CategoryDataset dataset = this.getDataset(datasetIndex);
        if (dataset != null) {
          final CategoryItemRenderer renderer = this
              .getRenderer(datasetIndex);
          if (renderer != null) {
            final int seriesCount = dataset.getRowCount();
            for (int i = 0; i < seriesCount; i++) {
              final LegendItem item = renderer.getLegendItem(
                  datasetIndex, i);
              if (item != null) {
                result.add(item);
              }
            }
View Full Code Here

   *            the renderer index.
   *
   * @return The renderer (possibly <code>null</code>).
   */
  public CategoryItemRenderer getRenderer(final int index) {
    CategoryItemRenderer result = null;
    if (this.renderers.size() > index) {
      result = (CategoryItemRenderer) this.renderers.get(index);
    }
    return result;
  }
View Full Code Here

   *
   * @return The renderer (possibly <code>null</code>).
   */
  public CategoryItemRenderer getRendererForDataset(
      final CategoryDataset dataset) {
    CategoryItemRenderer result = null;
    for (int i = 0; i < this.datasets.size(); i++) {
      if (this.datasets.get(i) == dataset) {
        result = (CategoryItemRenderer) this.renderers.get(i);
        break;
      }
View Full Code Here

  public boolean render(final GC g2, final Rectangle dataArea,
      final int index, final PlotRenderingInfo info) {

    boolean foundData = false;
    final CategoryDataset currentDataset = this.getDataset(index);
    final CategoryItemRenderer renderer = this.getRenderer(index);
    final CategoryAxis domainAxis = this.getDomainAxisForDataset(index);
    final ValueAxis rangeAxis = this.getRangeAxisForDataset(index);
    final boolean hasData = !DatasetUtilities.isEmptyOrNull(currentDataset);
    if (hasData && (renderer != null)) {

      foundData = true;
      final CategoryItemRendererState state = renderer.initialise(g2,
          dataArea, this, index, info);
      final int columnCount = currentDataset.getColumnCount();
      final int rowCount = currentDataset.getRowCount();
      final int passCount = renderer.getPassCount();
      for (int pass = 0; pass < passCount; pass++) {
        if (this.columnRenderingOrder == SortOrder.ASCENDING) {
          for (int column = 0; column < columnCount; column++) {
            if (this.rowRenderingOrder == SortOrder.ASCENDING) {
              for (int row = 0; row < rowCount; row++) {
                renderer.drawItem(g2, state, dataArea, this,
                    domainAxis, rangeAxis, currentDataset,
                    row, column, pass);
              }
            } else {
              for (int row = rowCount - 1; row >= 0; row--) {
                renderer.drawItem(g2, state, dataArea, this,
                    domainAxis, rangeAxis, currentDataset,
                    row, column, pass);
              }
            }
          }
        } else {
          for (int column = columnCount - 1; column >= 0; column--) {
            if (this.rowRenderingOrder == SortOrder.ASCENDING) {
              for (int row = 0; row < rowCount; row++) {
                renderer.drawItem(g2, state, dataArea, this,
                    domainAxis, rangeAxis, currentDataset,
                    row, column, pass);
              }
            } else {
              for (int row = rowCount - 1; row >= 0; row--) {
                renderer.drawItem(g2, state, dataArea, this,
                    domainAxis, rangeAxis, currentDataset,
                    row, column, pass);
              }
            }
          }
View Full Code Here

   */
  public void setRenderer(final int index,
      final CategoryItemRenderer renderer, final boolean notify) {

    // stop listening to the existing renderer...
    final CategoryItemRenderer existing = (CategoryItemRenderer) this.renderers
        .get(index);
    if (existing != null) {
      existing.removeChangeListener(this);
    }

    // register the new renderer...
    this.renderers.set(index, renderer);
    if (renderer != null) {
View Full Code Here

TOP

Related Classes of com.positive.charts.renderer.category.CategoryItemRenderer

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.