• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java XYBlockRenderer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getItemRenderer

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的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: testEquals

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    
    // default instances
    XYBlockRenderer r1 = new XYBlockRenderer();
    XYBlockRenderer r2 = new XYBlockRenderer();
    assertTrue(r1.equals(r2));
    assertTrue(r2.equals(r1));
    
    // blockHeight
    r1.setBlockHeight(2.0);
    assertFalse(r1.equals(r2));
    r2.setBlockHeight(2.0);
    assertTrue(r1.equals(r2));

    // blockWidth
    r1.setBlockWidth(2.0);
    assertFalse(r1.equals(r2));
    r2.setBlockWidth(2.0);
    assertTrue(r1.equals(r2));
    
    // paintScale
    r1.setPaintScale(new GrayPaintScale(0.0, 1.0));
    assertFalse(r1.equals(r2));
    r2.setPaintScale(new GrayPaintScale(0.0, 1.0));
    assertTrue(r1.equals(r2));
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:31,代码来源:XYBlockRendererTests.java


示例3: testHashcode

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    XYBlockRenderer r1 = new XYBlockRenderer();
    XYBlockRenderer r2 = new XYBlockRenderer();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:XYBlockRendererTests.java


示例4: initRenderer

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
@Override
protected void initRenderer(final IScope scope) {
	// TODO Auto-generated method stub
	final XYPlot plot = (XYPlot) this.chart.getPlot();
	defaultrenderer = new XYBlockRenderer();
	plot.setRenderer((XYBlockRenderer) defaultrenderer);

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


示例5: testEquals

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {

    // default instances
    XYBlockRenderer r1 = new XYBlockRenderer();
    XYBlockRenderer r2 = new XYBlockRenderer();
    assertTrue(r1.equals(r2));
    assertTrue(r2.equals(r1));

    // blockHeight
    r1.setBlockHeight(2.0);
    assertFalse(r1.equals(r2));
    r2.setBlockHeight(2.0);
    assertTrue(r1.equals(r2));

    // blockWidth
    r1.setBlockWidth(2.0);
    assertFalse(r1.equals(r2));
    r2.setBlockWidth(2.0);
    assertTrue(r1.equals(r2));

    // paintScale
    r1.setPaintScale(new GrayPaintScale(0.0, 1.0));
    assertFalse(r1.equals(r2));
    r2.setPaintScale(new GrayPaintScale(0.0, 1.0));
    assertTrue(r1.equals(r2));

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:31,代码来源:XYBlockRendererTests.java


示例6: testHashcode

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashcode() {
    XYBlockRenderer r1 = new XYBlockRenderer();
    XYBlockRenderer r2 = new XYBlockRenderer();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:XYBlockRendererTests.java


示例7: testBug1766646A

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
/**
 * A simple test for bug 1766646.
 */
public void testBug1766646A() {
    XYBlockRenderer r = new XYBlockRenderer();
    Range range = r.findDomainBounds(null);
    assertTrue(range == null);
    DefaultXYZDataset emptyDataset = new DefaultXYZDataset();
    range = r.findDomainBounds(emptyDataset);
    assertTrue(range == null);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:XYBlockRendererTests.java


示例8: testBug1766646B

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
/**
 * A simple test for bug 1766646.
 */
public void testBug1766646B() {
    XYBlockRenderer r = new XYBlockRenderer();
    Range range = r.findRangeBounds(null);
    assertTrue(range == null);
    DefaultXYZDataset emptyDataset = new DefaultXYZDataset();
    range = r.findRangeBounds(emptyDataset);
    assertTrue(range == null);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:XYBlockRendererTests.java


示例9: getItemRenderer

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的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


示例10: init

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
protected void init()
    {
        dataset = new XYSeriesCollection();
        renderer = new XYBlockRenderer();
        //set all possible series to the default shape


//        init(chart.getXYPlot());
    }
 
开发者ID:dhmay,项目名称:msInspect,代码行数:10,代码来源:PanelWithHeatMap.java


示例11: resetRenderer

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
protected void resetRenderer(final IScope scope, final String serieid) {
	final XYBlockRenderer newr = (XYBlockRenderer) this.getOrCreateRenderer(scope, serieid);

	// newr.setSeriesStroke(0, new BasicStroke(0));
	final ChartDataSeries myserie = this.getChartdataset().getDataSeries(scope, serieid);

	if (myserie.getMycolor() != null) {
		newr.setSeriesPaint(0, myserie.getMycolor());
	}
	if (myserie.getSValues(scope).size() > 0) {
		final double maxval = Collections.max(myserie.getSValues(scope));
		final double minval = Collections.min(myserie.getSValues(scope));
		Color cdeb = new Color(0, 0, 0, 0);
		if (myserie.getMyMincolor() != null)
			cdeb = myserie.getMyMincolor();
		Color cend = new Color(0.9f, 0.9f, 0.9f, 1.0f);
		if (myserie.getMycolor() != null)
			cend = myserie.getMycolor();

		LookupPaintScale paintscale = createLUT(100, (float) minval, (float) maxval, cdeb, cend);
		if (myserie.getMyMedcolor() != null)
			paintscale = createLUT(100, (float) minval, (float) maxval, cdeb, myserie.getMyMedcolor(), cend);

		newr.setPaintScale(paintscale);

		final NumberAxis scaleAxis = new NumberAxis(myserie.getName());
		scaleAxis.setAxisLinePaint(this.axesColor);
		scaleAxis.setTickMarkPaint(this.axesColor);
		scaleAxis.setTickLabelFont(this.getTickFont());
		scaleAxis.setRange(minval, maxval);
		scaleAxis.setAxisLinePaint(axesColor);
		scaleAxis.setLabelFont(getLabelFont());
		if (textColor != null) {
			scaleAxis.setLabelPaint(textColor);
			scaleAxis.setTickLabelPaint(textColor);
		}
		if (!this.getXTickValueVisible(scope))
		{
			scaleAxis.setTickMarksVisible(false);
			scaleAxis.setTickLabelsVisible(false);
			
		}

		final PaintScaleLegend legend = new PaintScaleLegend(paintscale, scaleAxis);
		legend.setAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
		legend.setAxisOffset(5.0);
		// legend.setMargin(new RectangleInsets(5, 5, 5, 5));
		// legend.setFrame(new BlockBorder(Color.red));
		// legend.setPadding(new RectangleInsets(10, 10, 10, 10));
		// legend.setStripWidth(10);
		legend.setPosition(RectangleEdge.RIGHT);
		legend.setBackgroundPaint(this.backgroundColor);
		// ArrayList<PaintScaleLegend> caxe=new
		// ArrayList<PaintScaleLegend>();
		// caxe.add(legend);
		// chart.setSubtitles(caxe);
		if (!this.series_label_position.equals("none"))
			chart.addSubtitle(legend);

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


示例12: testPublicCloneable

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
/**
 * Verify that this class implements {@link PublicCloneable}.
 */
public void testPublicCloneable() {
    XYBlockRenderer r1 = new XYBlockRenderer();
    assertTrue(r1 instanceof PublicCloneable);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:XYBlockRendererTests.java


示例13: test

import org.jfree.chart.renderer.xy.XYBlockRenderer; //导入依赖的package包/类
@Override
public void test() {
	super.test();

	numberOfPagesTest(1);

	JFreeChart chart = getChart("summary.chart1", 0);
	XYItemRenderer renderer = chart.getXYPlot().getRenderer();
	Assert.assertEquals("renderer", XYBlockRenderer.class, renderer.getClass());
	Assert.assertEquals("block width", 1.1, ((XYBlockRenderer) renderer).getBlockWidth());
	Assert.assertEquals("block height", 0.9, ((XYBlockRenderer) renderer).getBlockHeight());
	Assert.assertEquals("block anchor", org.jfree.ui.RectangleAnchor.BOTTOM_LEFT, ((XYBlockRenderer) renderer).getBlockAnchor());

	Assert.assertEquals("paintScale", LookupPaintScale.class, ((XYBlockRenderer) renderer).getPaintScale().getClass());
	LookupPaintScale paintScale = (LookupPaintScale) ((XYBlockRenderer) renderer).getPaintScale();
	Assert.assertEquals("paintScale default lower bound", 0.1, paintScale.getLowerBound());
	Assert.assertEquals("paintScale default upper bound", 5d, paintScale.getUpperBound());
	Assert.assertEquals("paintScale default paint", Color.WHITE, paintScale.getDefaultPaint());
	Assert.assertEquals("paintScale paint 1", Color.RED, paintScale.getPaint(1));
	Assert.assertEquals("paintScale paint 2", Color.GREEN, paintScale.getPaint(2));
	Assert.assertEquals("paintScale paint 3", Color.BLUE, paintScale.getPaint(3));

	LegendItemCollection legendItems = chart.getXYPlot().getLegendItems();
	Assert.assertEquals("legend item 1 label", "1", legendItems.get(0).getLabel());
	Assert.assertEquals("legend item 1 paint", Color.RED, legendItems.get(0).getFillPaint());
	Assert.assertEquals("legend item 2 label", "2", legendItems.get(1).getLabel());
	Assert.assertEquals("legend item 2 paint", Color.GREEN, legendItems.get(1).getFillPaint());
	Assert.assertEquals("legend item 3 label", "3", legendItems.get(2).getLabel());
	Assert.assertEquals("legend item 3 paint", Color.BLUE, legendItems.get(2).getFillPaint());

	xyzChartDataTest(chart, 0, "serie0", new Number[][] {{1d, 2d, 0d}, {2d, 3d, 1d}, {3d, 4d, 2d}, {4d, 5d, 3d}});

	chart = getChart("summary.chart2", 0);
	Axis axis = chart.getXYPlot().getDomainAxis();
	Assert.assertEquals("category label", "category", axis.getLabel());
	Assert.assertEquals("category label color", Color.BLUE, axis.getLabelPaint());
	Assert.assertEquals("category label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
	Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
	Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
	Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());

	chart = getChart("summary.chart3", 0);
	axis = chart.getXYPlot().getRangeAxis();
	Assert.assertEquals("value label", "value", axis.getLabel());
	Assert.assertEquals("value label color", Color.BLUE, axis.getLabelPaint());
	Assert.assertEquals("value label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
	Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
	Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
	Assert.assertEquals("tick label mask", "10.00", ((NumberAxis) axis).getNumberFormatOverride().format(10));
	Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:52,代码来源:XyBlockChartTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultOHLCDataset类代码示例发布时间:2022-05-21
下一篇:
Java Results类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap