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


Java DefaultCategoryItemRenderer类代码示例

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


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

示例1: testEquals

import org.jfree.chart.renderer.category.DefaultCategoryItemRenderer; //导入依赖的package包/类
/**
 * Problem that the equals(...) method distinguishes all fields.
 */
public void testEquals() {
    DefaultCategoryItemRenderer r1 = new DefaultCategoryItemRenderer();
    DefaultCategoryItemRenderer r2 = new DefaultCategoryItemRenderer();
    assertEquals(r1, r2);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:DefaultCategoryItemRendererTests.java

示例2: testHashcode

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

示例3: testGetRangeAxisForDataset

import org.jfree.chart.renderer.category.DefaultCategoryItemRenderer; //导入依赖的package包/类
/**
 * Some tests for the getRangeAxisForDataset() method.
 */
@Test
public void testGetRangeAxisForDataset() {
    CategoryDataset dataset = new DefaultCategoryDataset();
    CategoryAxis xAxis = new CategoryAxis("X");
    NumberAxis yAxis = new NumberAxis("Y");
    CategoryItemRenderer renderer = new DefaultCategoryItemRenderer();
    CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);
    assertEquals(yAxis, plot.getRangeAxisForDataset(0));

    // should get IllegalArgumentException for negative index
    boolean pass = false;
    try {
        plot.getRangeAxisForDataset(-1);
    }
    catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);

    // if multiple axes are mapped, the first in the list should be
    // returned...
    NumberAxis yAxis2 = new NumberAxis("Y2");
    plot.setRangeAxis(1, yAxis2);
    assertEquals(yAxis, plot.getRangeAxisForDataset(0));

    plot.mapDatasetToRangeAxis(0, 1);
    assertEquals(yAxis2, plot.getRangeAxisForDataset(0));

    List axisIndices = Arrays.asList(new Integer[] {new Integer(0),
            new Integer(1)});
    plot.mapDatasetToRangeAxes(0, axisIndices);
    assertEquals(yAxis, plot.getRangeAxisForDataset(0));

    axisIndices = Arrays.asList(new Integer[] {new Integer(1),
            new Integer(2)});
    plot.mapDatasetToRangeAxes(0, axisIndices);
    assertEquals(yAxis2, plot.getRangeAxisForDataset(0));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:42,代码来源:CategoryPlotTest.java

示例4: testHashcode

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

示例5: testGetRangeAxisForDataset

import org.jfree.chart.renderer.category.DefaultCategoryItemRenderer; //导入依赖的package包/类
/**
 * Some tests for the getRangeAxisForDataset() method.
 */
public void testGetRangeAxisForDataset() {
    CategoryDataset dataset = new DefaultCategoryDataset();
    CategoryAxis xAxis = new CategoryAxis("X");
    NumberAxis yAxis = new NumberAxis("Y");
    CategoryItemRenderer renderer = new DefaultCategoryItemRenderer();
    CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);
    assertEquals(yAxis, plot.getRangeAxisForDataset(0));

    // should get IllegalArgumentException for negative index
    boolean pass = false;
    try {
        plot.getRangeAxisForDataset(-1);
    }
    catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);

    // if multiple axes are mapped, the first in the list should be
    // returned...
    NumberAxis yAxis2 = new NumberAxis("Y2");
    plot.setRangeAxis(1, yAxis2);
    assertEquals(yAxis, plot.getRangeAxisForDataset(0));

    plot.mapDatasetToRangeAxis(0, 1);
    assertEquals(yAxis2, plot.getRangeAxisForDataset(0));

    List axisIndices = Arrays.asList(new Integer[] {new Integer(0),
            new Integer(1)});
    plot.mapDatasetToRangeAxes(0, axisIndices);
    assertEquals(yAxis, plot.getRangeAxisForDataset(0));

    axisIndices = Arrays.asList(new Integer[] {new Integer(1),
            new Integer(2)});
    plot.mapDatasetToRangeAxes(0, axisIndices);
    assertEquals(yAxis2, plot.getRangeAxisForDataset(0));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:41,代码来源:CategoryPlotTests.java

示例6: createRenderer

import org.jfree.chart.renderer.category.DefaultCategoryItemRenderer; //导入依赖的package包/类
private CategoryItemRenderer createRenderer(List<ProfileRow> rows){
	// create renderer
       DefaultCategoryItemRenderer renderer = new DefaultCategoryItemRenderer();        
       renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator());
       renderer.setShapesVisible(false);
       
       // generate colors
       Collections.sort(rows);
	float position = 0.0f;
	float step = 1.0f / ((float)rows.size());
		
	for (ProfileRow row : rows) {
		if(selectedIndexes.contains(row.series)){
			renderer.setSeriesPaint(row.series, Color.black);
		} else {
			row.color = getColor(position);
			renderer.setSeriesPaint(row.series, getColor(position));
		}
		position += step;
	}
	
	//List isn't initialised, if visualising clustered profiles
	if(list != null){
		list.setSelectedRows(selectedIndexes, this, false, data);
	}
	
	return renderer;
}
 
开发者ID:chipster,项目名称:chipster,代码行数:29,代码来源:ExpressionProfile.java

示例7: testEquals

import org.jfree.chart.renderer.category.DefaultCategoryItemRenderer; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    DefaultCategoryItemRenderer r1 = new DefaultCategoryItemRenderer();
    DefaultCategoryItemRenderer r2 = new DefaultCategoryItemRenderer();
    assertEquals(r1, r2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:DefaultCategoryItemRendererTests.java

示例8: testPublicCloneable

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


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