本文整理汇总了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);
}
示例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);
}
示例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));
}
示例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);
}
示例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));
}
示例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;
}
示例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);
}
示例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);
}