本文整理汇总了Java中org.jfree.chart.renderer.PolarItemRenderer类的典型用法代码示例。如果您正苦于以下问题:Java PolarItemRenderer类的具体用法?Java PolarItemRenderer怎么用?Java PolarItemRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PolarItemRenderer类属于org.jfree.chart.renderer包,在下文中一共展示了PolarItemRenderer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setRenderer
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Sets a renderer and, if requested, sends a {@link PlotChangeEvent} to
* all registered listeners.
*
* @param index the index.
* @param renderer the renderer.
* @param notify notify listeners?
*
* @see #getRenderer(int)
*
* @since 1.0.14
*/
public void setRenderer(int index, PolarItemRenderer renderer,
boolean notify) {
PolarItemRenderer existing = getRenderer(index);
if (existing != null) {
existing.removeChangeListener(this);
}
this.renderers.set(index, renderer);
if (renderer != null) {
renderer.setPlot(this);
renderer.addChangeListener(this);
}
if (notify) {
fireChangeEvent();
}
}
示例2: getLegendItems
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Returns the legend items for the plot. Each legend item is generated by
* the plot's m_Renderer, since the m_Renderer is responsible for the visual
* representation of the data.
*
* @return The legend items.
*/
@Override
public LegendItemCollection getLegendItems() {
if (this.fixedLegendItems != null) {
return this.fixedLegendItems;
}
LegendItemCollection result = new LegendItemCollection();
int count = this.datasets.size();
for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) {
XYDataset dataset = getDataset(datasetIndex);
PolarItemRenderer renderer = getRenderer(datasetIndex);
if (dataset != null && renderer != null) {
int seriesCount = dataset.getSeriesCount();
for (int i = 0; i < seriesCount; i++) {
LegendItem item = renderer.getLegendItem(i);
result.add(item);
}
}
}
return result;
}
示例3: getLegendItems
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Returns the legend items for the plot. Each legend item is generated by
* the plot's m_Renderer, since the m_Renderer is responsible for the visual
* representation of the data.
*
* @return The legend items.
*/
public LegendItemCollection getLegendItems() {
if (this.fixedLegendItems != null) {
return this.fixedLegendItems;
}
LegendItemCollection result = new LegendItemCollection();
int count = this.datasets.size();
for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) {
XYDataset dataset = getDataset(datasetIndex);
PolarItemRenderer renderer = getRenderer(datasetIndex);
if (dataset != null && renderer != null) {
int seriesCount = dataset.getSeriesCount();
for (int i = 0; i < seriesCount; i++) {
LegendItem item = renderer.getLegendItem(i);
result.add(item);
}
}
}
return result;
}
示例4: setRenderer
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Sets the item renderer, and notifies all listeners of a change to the plot.
* <P>
* If the renderer is set to <code>null</code>, no chart will be drawn.
*
* @param renderer the new renderer (<code>null</code> permitted).
*/
public void setRenderer(PolarItemRenderer renderer) {
if (this.renderer != null) {
this.renderer.removeChangeListener(this);
}
this.renderer = renderer;
if (this.renderer != null) {
this.renderer.setPlot(this);
}
notifyListeners(new PlotChangeEvent(this));
}
示例5: setRenderer
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Sets the item renderer, and notifies all listeners of a change to the
* plot.
* <P>
* If the renderer is set to <code>null</code>, no chart will be drawn.
*
* @param renderer the new renderer (<code>null</code> permitted).
*
* @see #getRenderer()
*/
public void setRenderer(PolarItemRenderer renderer) {
if (this.renderer != null) {
this.renderer.removeChangeListener(this);
}
this.renderer = renderer;
if (this.renderer != null) {
this.renderer.setPlot(this);
}
notifyListeners(new PlotChangeEvent(this));
}
示例6: render
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Draws a representation of the data within the dataArea region, using the
* current m_Renderer.
*
* @param g2 the graphics device.
* @param dataArea the region in which the data is to be drawn.
* @param info an optional object for collection dimension
* information (<code>null</code> permitted).
*/
protected void render(Graphics2D g2, Rectangle2D dataArea,
PlotRenderingInfo info) {
// now get the data and plot it (the visual representation will depend
// on the m_Renderer that has been set)...
boolean hasData = false;
int datasetCount = this.datasets.size();
for (int i = datasetCount - 1; i >= 0; i--) {
XYDataset dataset = getDataset(i);
if (dataset == null) {
continue;
}
PolarItemRenderer renderer = getRenderer(i);
if (renderer == null) {
continue;
}
if (!DatasetUtilities.isEmptyOrNull(dataset)) {
hasData = true;
int seriesCount = dataset.getSeriesCount();
for (int series = 0; series < seriesCount; series++) {
renderer.drawSeries(g2, dataArea, info, this, dataset,
series);
}
}
}
if (!hasData) {
drawNoDataMessage(g2, dataArea);
}
}
示例7: readObject
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Provides serialization support.
*
* @param stream the input stream.
*
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.angleGridlineStroke = SerialUtilities.readStroke(stream);
this.angleGridlinePaint = SerialUtilities.readPaint(stream);
this.radiusGridlineStroke = SerialUtilities.readStroke(stream);
this.radiusGridlinePaint = SerialUtilities.readPaint(stream);
this.angleLabelPaint = SerialUtilities.readPaint(stream);
int rangeAxisCount = this.axes.size();
for (int i = 0; i < rangeAxisCount; i++) {
Axis axis = (Axis) this.axes.get(i);
if (axis != null) {
axis.setPlot(this);
axis.addChangeListener(this);
}
}
int datasetCount = this.datasets.size();
for (int i = 0; i < datasetCount; i++) {
Dataset dataset = (Dataset) this.datasets.get(i);
if (dataset != null) {
dataset.addChangeListener(this);
}
}
int rendererCount = this.renderers.size();
for (int i = 0; i < rendererCount; i++) {
PolarItemRenderer renderer = (PolarItemRenderer) this.renderers.get(i);
if (renderer != null) {
renderer.addChangeListener(this);
}
}
}
示例8: render
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Draws a representation of the data within the dataArea region, using the
* current m_Renderer.
*
* @param g2 the graphics device.
* @param dataArea the region in which the data is to be drawn.
* @param info an optional object for collection dimension
* information ({@code null} permitted).
*/
protected void render(Graphics2D g2, Rectangle2D dataArea,
PlotRenderingInfo info) {
// now get the data and plot it (the visual representation will depend
// on the m_Renderer that has been set)...
boolean hasData = false;
int datasetCount = this.datasets.size();
for (int i = datasetCount - 1; i >= 0; i--) {
XYDataset dataset = getDataset(i);
if (dataset == null) {
continue;
}
PolarItemRenderer renderer = getRenderer(i);
if (renderer == null) {
continue;
}
if (!DatasetUtils.isEmptyOrNull(dataset)) {
hasData = true;
int seriesCount = dataset.getSeriesCount();
for (int series = 0; series < seriesCount; series++) {
renderer.drawSeries(g2, dataArea, info, this, dataset,
series);
}
}
}
if (!hasData) {
drawNoDataMessage(g2, dataArea);
}
}
示例9: readObject
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Provides serialization support.
*
* @param stream the input stream.
*
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.angleGridlineStroke = SerialUtils.readStroke(stream);
this.angleGridlinePaint = SerialUtils.readPaint(stream);
this.radiusGridlineStroke = SerialUtils.readStroke(stream);
this.radiusGridlinePaint = SerialUtils.readPaint(stream);
this.angleLabelPaint = SerialUtils.readPaint(stream);
int rangeAxisCount = this.axes.size();
for (int i = 0; i < rangeAxisCount; i++) {
Axis axis = (Axis) this.axes.get(i);
if (axis != null) {
axis.setPlot(this);
axis.addChangeListener(this);
}
}
int datasetCount = this.datasets.size();
for (int i = 0; i < datasetCount; i++) {
Dataset dataset = (Dataset) this.datasets.get(i);
if (dataset != null) {
dataset.addChangeListener(this);
}
}
int rendererCount = this.renderers.size();
for (int i = 0; i < rendererCount; i++) {
PolarItemRenderer renderer = (PolarItemRenderer) this.renderers.get(i);
if (renderer != null) {
renderer.addChangeListener(this);
}
}
}
示例10: PolarPlot
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Creates a new plot.
*
* @param dataset the dataset (<code>null</code> permitted).
* @param radiusAxis the radius axis (<code>null</code> permitted).
* @param renderer the renderer (<code>null</code> permitted).
*/
public PolarPlot(XYDataset dataset,
ValueAxis radiusAxis,
PolarItemRenderer renderer) {
super();
this.dataset = dataset;
if (this.dataset != null) {
this.dataset.addChangeListener(this);
}
this.angleTickUnit = new NumberTickUnit(DEFAULT_ANGLE_TICK_UNIT_SIZE);
this.axis = radiusAxis;
if (this.axis != null) {
this.axis.setPlot(this);
this.axis.addChangeListener(this);
}
this.renderer = renderer;
if (this.renderer != null) {
this.renderer.setPlot(this);
this.renderer.addChangeListener(this);
}
this.angleGridlinesVisible = true;
this.angleGridlineStroke = DEFAULT_GRIDLINE_STROKE;
this.angleGridlinePaint = DEFAULT_GRIDLINE_PAINT;
this.radiusGridlinesVisible = true;
this.radiusGridlineStroke = DEFAULT_GRIDLINE_STROKE;
this.radiusGridlinePaint = DEFAULT_GRIDLINE_PAINT;
}
示例11: setRenderer
import org.jfree.chart.renderer.PolarItemRenderer; //导入依赖的package包/类
/**
* Sets the item renderer, and notifies all listeners of a change to the
* plot.
* <P>
* If the renderer is set to <code>null</code>, no chart will be drawn.
*
* @param renderer the new renderer (<code>null</code> permitted).
*
* @see #getRenderer()
*/
public void setRenderer(PolarItemRenderer renderer) {
if (this.renderer != null) {
this.renderer.removeChangeListener(this);
}
this.renderer = renderer;
if (this.renderer != null) {
this.renderer.setPlot(this);
}
fireChangeEvent();
}