当前位置: 首页>>代码示例>>Java>>正文


Java AbstractXYItemRenderer类代码示例

本文整理汇总了Java中org.jfree.chart.renderer.xy.AbstractXYItemRenderer的典型用法代码示例。如果您正苦于以下问题:Java AbstractXYItemRenderer类的具体用法?Java AbstractXYItemRenderer怎么用?Java AbstractXYItemRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AbstractXYItemRenderer类属于org.jfree.chart.renderer.xy包,在下文中一共展示了AbstractXYItemRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getItemRenderer

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
@Override
public AbstractXYItemRenderer getItemRenderer(boolean nominal, int size, double minColor, double maxColor) {
	XYBlockRenderer renderer = new XYBlockRenderer();
	renderer.setPaintScale(new BlockPaintScale(minColor, maxColor));
	renderer.setBlockAnchor(RectangleAnchor.CENTER);

	// if Block dimension is increased (e.g 1.2x1.2), the grid effect gets bigger
	// so it could be that blocks are overlapping a little
	// but if Block dimension is decreased (e.g. 0.9x0.9), each rectangle seems to have
	// a less-transparent border (you have to zoom-in to notice), and that could be the cause of
	// the grid effect.
	// renderer.setBlockHeight(1.0);
	// renderer.setBlockWidth(1.0);

	return renderer;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:17,代码来源:BlockChartPlotter.java

示例2: resetUI

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Resets the display.
 */
@Override
void resetUI() {
    super.resetUI();
    XYPlot xyPlot = mChart.getXYPlot();

    AbstractXYItemRenderer br = new XYBarRenderer();
    mDatasetsSyncHist = new TimePeriodValues[NUM_AUTHS+1];

    @SuppressWarnings("unchecked")
    Map<SimpleTimePeriod, Integer> mTimePeriodMapTmp[] = new HashMap[NUM_AUTHS + 1];
    mTimePeriodMap = mTimePeriodMapTmp;

    TimePeriodValuesCollection tpvc = new TimePeriodValuesCollection();
    xyPlot.setDataset(tpvc);
    xyPlot.setRenderer(br);

    for (int i = 0; i < NUM_AUTHS + 1; i++) {
        br.setSeriesPaint(i, AUTH_COLORS[i]);
        mDatasetsSyncHist[i] = new TimePeriodValues(AUTH_NAMES[i]);
        tpvc.addSeries(mDatasetsSyncHist[i]);
        mTimePeriodMap[i] = new HashMap<SimpleTimePeriod, Integer>();

    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:28,代码来源:DisplaySyncHistogram.java

示例3: buildDataSet

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
private TimeSeriesCollection buildDataSet(SortedMap<DataSetBarDescr, SortedMap<Date,Double>> series, AbstractXYItemRenderer renderer) {
	
	TimeSeriesCollection dataset = new TimeSeriesCollection();
	int seriesIdx = 0;
	for (DataSetBarDescr serieDef : series.keySet()) {
		
		TimeSeries timeSerie = new TimeSeries(serieDef.getSerieName());
		
		SortedMap<Date, Double> serie = series.get(serieDef);
		for (Date date : serie.keySet()) {
			RegularTimePeriod period = new Day(date);
			Number value = serie.get(date);
			TimeSeriesDataItem item = new TimeSeriesDataItem(period, value);
			timeSerie.add(item, false);
		}
		
		dataset.addSeries(timeSerie);
		renderer.setSeriesPaint(seriesIdx, serieDef.getSerieColor());
		renderer.setSeriesFillPaint(seriesIdx, serieDef.getSerieColor());
		renderer.setSeriesStroke(seriesIdx, new BasicStroke(serieDef.getSerieStrokeSize()));
		
		seriesIdx++;
	}

	return dataset;
}
 
开发者ID:premiummarkets,项目名称:pm,代码行数:27,代码来源:ChartGenerator.java

示例4: testFindDomainBounds

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Some checks for the findDomainBounds() method.
 */
public void testFindDomainBounds() {
    AbstractXYItemRenderer renderer = new StandardXYItemRenderer();
    
    // check the bounds of a simple dataset
    XYDataset dataset = createDataset1();
    Range r = renderer.findDomainBounds(dataset);
    assertEquals(1.0, r.getLowerBound(), EPSILON);
    assertEquals(3.0, r.getUpperBound(), EPSILON);
    
    // check that a null dataset returns null bounds
    assertTrue(renderer.findDomainBounds(null) == null);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:AbstractXYItemRendererTests.java

示例5: drawZeroDomainBaseline

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Draws a base line across the chart at value zero on the domain axis.
 *
 * @param g2  the graphics device.
 * @param area  the data area.
 * 
 * @see #setDomainZeroBaselineVisible(boolean)
 * 
 * @since 1.0.5
 */
protected void drawZeroDomainBaseline(Graphics2D g2, Rectangle2D area) {
    if (isDomainZeroBaselineVisible()) {
        XYItemRenderer r = getRenderer();
        // FIXME: the renderer interface doesn't have the drawDomainLine()
        // method, so we have to rely on the renderer being a subclass of
        // AbstractXYItemRenderer (which is lame)
        if (r instanceof AbstractXYItemRenderer) {
            AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) r;
            renderer.drawDomainLine(g2, this, getDomainAxis(), area, 0.0, 
                    this.domainZeroBaselinePaint, 
                    this.domainZeroBaselineStroke);
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:XYPlot.java

示例6: drawDomainGridlines

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Draws the gridlines for the plot, if they are visible.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param ticks  the ticks.
 *
 * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea,
                                   List ticks) {

    // no renderer, no gridlines...
    if (getRenderer() == null) {
        return;
    }

    // draw the domain grid lines, if any...
    if (isDomainGridlinesVisible() || isDomainMinorGridlinesVisible()) {
        Stroke gridStroke = null;
        Paint gridPaint = null;
        Iterator iterator = ticks.iterator();
        boolean paintLine;
        while (iterator.hasNext()) {
            paintLine = false;
            ValueTick tick = (ValueTick) iterator.next();
            if ((tick.getTickType() == TickType.MINOR)
                    && isDomainMinorGridlinesVisible()) {
                gridStroke = getDomainMinorGridlineStroke();
                gridPaint = getDomainMinorGridlinePaint();
                paintLine = true;
            } else if ((tick.getTickType() == TickType.MAJOR)
                    && isDomainGridlinesVisible()) {
                gridStroke = getDomainGridlineStroke();
                gridPaint = getDomainGridlinePaint();
                paintLine = true;
            }
            XYItemRenderer r = getRenderer();
            if ((r instanceof AbstractXYItemRenderer) && paintLine) {
                ((AbstractXYItemRenderer) r).drawDomainLine(g2, this,
                        getDomainAxis(), dataArea, tick.getValue(),
                        gridPaint, gridStroke);
            }
        }
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:47,代码来源:XYPlot.java

示例7: drawZeroDomainBaseline

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Draws a base line across the chart at value zero on the domain axis.
 *
 * @param g2  the graphics device.
 * @param area  the data area.
 *
 * @see #setDomainZeroBaselineVisible(boolean)
 *
 * @since 1.0.5
 */
protected void drawZeroDomainBaseline(Graphics2D g2, Rectangle2D area) {
    if (isDomainZeroBaselineVisible()) {
        XYItemRenderer r = getRenderer();
        // FIXME: the renderer interface doesn't have the drawDomainLine()
        // method, so we have to rely on the renderer being a subclass of
        // AbstractXYItemRenderer (which is lame)
        if (r instanceof AbstractXYItemRenderer) {
            AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) r;
            renderer.drawDomainLine(g2, this, getDomainAxis(), area, 0.0,
                    this.domainZeroBaselinePaint,
                    this.domainZeroBaselineStroke);
        }
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:XYPlot.java

示例8: drawDomainGridlines

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Draws the gridlines for the plot, if they are visible.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param ticks  the ticks.
 *
 * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea,
                                   List ticks) {

    // no renderer, no gridlines...
    if (getRenderer() == null) {
        return;
    }

    // draw the domain grid lines, if any...
    if (isDomainGridlinesVisible() || isDomainMinorGridlinesVisible()) {
        Stroke gridStroke = null;
        Paint gridPaint = null;
        Iterator iterator = ticks.iterator();
        boolean paintLine = false;
        while (iterator.hasNext()) {
            paintLine = false;
            ValueTick tick = (ValueTick) iterator.next();
            if ((tick.getTickType() == TickType.MINOR) && isDomainMinorGridlinesVisible()){
                gridStroke = getDomainMinorGridlineStroke();
                gridPaint = getDomainMinorGridlinePaint();
                paintLine = true;
            }
            else if ((tick.getTickType() == TickType.MAJOR) && isDomainGridlinesVisible()){
                gridStroke = getDomainGridlineStroke();
                gridPaint = getDomainGridlinePaint();
                paintLine = true;
            }
            XYItemRenderer r = getRenderer();
            if ((r instanceof AbstractXYItemRenderer) && paintLine) {
                ((AbstractXYItemRenderer) r).drawDomainLine(g2, this,
                        getDomainAxis(), dataArea, tick.getValue(),
                        gridPaint, gridStroke);
            }
        }
    }
}
 
开发者ID:lulab,项目名称:PI,代码行数:46,代码来源:XYPlot.java

示例9: resetRenderer

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
protected void resetRenderer(final IScope scope, final String serieid) {
	final AbstractXYItemRenderer newr = (AbstractXYItemRenderer) this.getOrCreateRenderer(scope, serieid);
	// newr.setSeriesStroke(0, new BasicStroke(0));
	newr.setBaseCreateEntities(true);
	final ChartDataSeries myserie = this.getChartdataset().getDataSeries(scope, serieid);

	if (newr instanceof XYLineAndShapeRenderer) {
		((XYLineAndShapeRenderer) newr).setSeriesLinesVisible(0, myserie.getMysource().showLine);
		((XYLineAndShapeRenderer) newr).setSeriesShapesFilled(0, myserie.getMysource().fillMarker);
		((XYLineAndShapeRenderer) newr).setSeriesShapesVisible(0, myserie.getMysource().useMarker);

	}

	if (newr instanceof XYShapeRenderer) {
		if (!myserie.getMysource().fillMarker) {
			((XYShapeRenderer) newr).setUseFillPaint(false);
			// ((XYShapeRenderer) newr).setDrawOutlines(true);
		}
	}
	if (myserie.getMycolor() != null) {
		newr.setSeriesPaint(0, myserie.getMycolor());
	}
	newr.setSeriesStroke(0, new BasicStroke((float) myserie.getLineThickness()));

	if (newr instanceof myXYErrorRenderer) {
		((myXYErrorRenderer) newr).setDrawYError(false);
		((myXYErrorRenderer) newr).setDrawXError(false);
		if (myserie.isUseYErrValues())
			((myXYErrorRenderer) newr).setDrawYError(true);
		if (myserie.isUseXErrValues())
			((myXYErrorRenderer) newr).setDrawXError(true);
		if (myserie.getMysource().isUseSize())
			((myXYErrorRenderer) newr).setUseSize(scope, true);
	}

	if (myserie.getMysource().getUniqueMarkerName() != null)
		setSerieMarkerShape(scope, myserie.getName(), myserie.getMysource().getUniqueMarkerName());

}
 
开发者ID:gama-platform,项目名称:gama,代码行数:40,代码来源:ChartJFreeChartOutputScatter.java

示例10: setUseSize

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
@Override
public void setUseSize(final IScope scope, final String name, final boolean b) {
	// TODO Auto-generated method stub
	final AbstractXYItemRenderer newr = (AbstractXYItemRenderer) this.getOrCreateRenderer(scope, name);
	if (newr instanceof myXYErrorRenderer) {
		((myXYErrorRenderer) newr).setUseSize(scope, b);
	}

}
 
开发者ID:gama-platform,项目名称:gama,代码行数:10,代码来源:ChartJFreeChartOutputScatter.java

示例11: testFindDomainBounds

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Some checks for the findDomainBounds() method.
 */
public void testFindDomainBounds() {
    AbstractXYItemRenderer renderer = new StandardXYItemRenderer();

    // check the bounds of a simple dataset
    XYDataset dataset = createDataset1();
    Range r = renderer.findDomainBounds(dataset);
    assertEquals(1.0, r.getLowerBound(), EPSILON);
    assertEquals(3.0, r.getUpperBound(), EPSILON);

    // check that a null dataset returns null bounds
    assertTrue(renderer.findDomainBounds(null) == null);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:16,代码来源:AbstractXYItemRendererTests.java

示例12: drawDomainGridlines

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Draws the gridlines for the plot, if they are visible.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param ticks  the ticks.
 *
 * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea,
                                   List ticks) {

    // no renderer, no gridlines...
    if (getRenderer() == null) {
        return;
    }

    // draw the domain grid lines, if any...
    if (isDomainGridlinesVisible() || isDomainMinorGridlinesVisible()) {
        Stroke gridStroke = null;
        Paint gridPaint = null;
        Iterator iterator = ticks.iterator();
        boolean paintLine = false;
        while (iterator.hasNext()) {
            paintLine = false;
            ValueTick tick = (ValueTick) iterator.next();
            if ((tick.getTickType() == TickType.MINOR)
                    && isDomainMinorGridlinesVisible()) {
                gridStroke = getDomainMinorGridlineStroke();
                gridPaint = getDomainMinorGridlinePaint();
                paintLine = true;
            }
            else if ((tick.getTickType() == TickType.MAJOR)
                    && isDomainGridlinesVisible()) {
                gridStroke = getDomainGridlineStroke();
                gridPaint = getDomainGridlinePaint();
                paintLine = true;
            }
            XYItemRenderer r = getRenderer();
            if ((r instanceof AbstractXYItemRenderer) && paintLine) {
                ((AbstractXYItemRenderer) r).drawDomainLine(g2, this,
                        getDomainAxis(), dataArea, tick.getValue(),
                        gridPaint, gridStroke);
            }
        }
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:48,代码来源:XYPlot.java

示例13: drawDomainGridlines

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
/**
 * Draws the gridlines for the plot, if they are visible.
 *
 * @param g2  the graphics device.
 * @param dataArea  the data area.
 * @param ticks  the ticks.
 *
 * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)
 */
protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea,
                                   List ticks) {

    // no renderer, no gridlines...
    if (getRenderer() == null) {
        return;
    }

    // draw the domain grid lines, if any...
    if (isDomainGridlinesVisible() || isDomainMinorGridlinesVisible()) {
        Stroke gridStroke = null;
        Paint gridPaint = null;
        Iterator iterator = ticks.iterator();
        boolean paintLine;
        while (iterator.hasNext()) {
            paintLine = false;
            ValueTick tick = (ValueTick) iterator.next();
            if ((tick.getTickType() == TickType.MINOR)
                    && isDomainMinorGridlinesVisible()) {
                gridStroke = getDomainMinorGridlineStroke();
                gridPaint = getDomainMinorGridlinePaint();
                paintLine = true;
            }
            else if ((tick.getTickType() == TickType.MAJOR)
                    && isDomainGridlinesVisible()) {
                gridStroke = getDomainGridlineStroke();
                gridPaint = getDomainGridlinePaint();
                paintLine = true;
            }
            XYItemRenderer r = getRenderer();
            if ((r instanceof AbstractXYItemRenderer) && paintLine) {
                ((AbstractXYItemRenderer) r).drawDomainLine(g2, this,
                        getDomainAxis(), dataArea, tick.getValue(),
                        gridPaint, gridStroke);
            }
        }
    }
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:48,代码来源:XYPlot.java

示例14: drawZeroDomainBaseline

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
@Override
protected void drawZeroDomainBaseline(Graphics2D g2, Rectangle2D area) {
	if (isDomainZeroBaselineVisible()) {
		XYItemRenderer r = getRenderer();
		if (r instanceof AbstractXYItemRenderer) {
			AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) r;
			renderer.drawDomainLine(g2, this, getDomainAxis(), area, 0.0, getDomainZeroBaselinePaint(), getDomainZeroBaselineStroke());
		}
	}
}
 
开发者ID:purbon,项目名称:pdfwriter,代码行数:11,代码来源:XYPQPlot.java

示例15: getItemRenderer

import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; //导入依赖的package包/类
@Override
public AbstractXYItemRenderer getItemRenderer(boolean nominal, int size, double minColor, double maxColor) {
       XYBlockRenderer renderer = new XYBlockRenderer();
       renderer.setPaintScale(new BlockPaintScale(minColor, maxColor)); 
       renderer.setBlockAnchor(RectangleAnchor.CENTER); 
       
       // if Block dimension is increased (e.g 1.2x1.2), the grid effect gets bigger
       // so it could be that blocks are overlapping a little
       // but if Block dimension is decreased (e.g. 0.9x0.9), each rectangle seems to have
       // a less-transparent border (you have to zoom-in to notice), and that could be the cause of the grid effect.
       //renderer.setBlockHeight(1.0);
       //renderer.setBlockWidth(1.0); 
       
       return renderer;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:16,代码来源:BlockChartPlotter.java


注:本文中的org.jfree.chart.renderer.xy.AbstractXYItemRenderer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。