Package com.positive.charts.renderer

Source Code of com.positive.charts.renderer.RendererState

package com.positive.charts.renderer;

import com.positive.charting.ChartRenderingInfo;
import com.positive.charts.entity.EntityCollection;
import com.positive.charts.plot.PlotRenderingInfo;

/**
* Represents the current state of a renderer.
*/
public class RendererState {

  /** The plot rendering info. */
  private final PlotRenderingInfo info;

  /**
   * Creates a new state object.
   *
   * @param info
   *            the plot rendering info.
   */
  public RendererState(final PlotRenderingInfo info) {
    this.info = info;
  }

  /**
   * A convenience method that returns a reference to the entity collection
   * (may be <code>null</code>) being used to record chart entities.
   *
   * @return The entity collection (possibly <code>null</code>).
   */
  public EntityCollection getEntityCollection() {
    EntityCollection result = null;
    if (this.info != null) {
      final ChartRenderingInfo owner = this.info.getOwner();
      if (owner != null) {
        result = owner.getEntityCollection();
      }
    }
    return result;
  }

  /**
   * Returns the plot rendering info.
   *
   * @return The info.
   */
  public PlotRenderingInfo getInfo() {
    return this.info;
  }

}
TOP

Related Classes of com.positive.charts.renderer.RendererState

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.