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;
}
}