本文整理汇总了Java中org.jfree.chart.renderer.RendererUtilities类的典型用法代码示例。如果您正苦于以下问题:Java RendererUtilities类的具体用法?Java RendererUtilities怎么用?Java RendererUtilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RendererUtilities类属于org.jfree.chart.renderer包,在下文中一共展示了RendererUtilities类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFindLiveItemsLowerBound_Unordered
import org.jfree.chart.renderer.RendererUtilities; //导入依赖的package包/类
/**
* Some checks for the findLiveItemsLowerBound() method when the dataset is
* unordered.
*/
public void testFindLiveItemsLowerBound_Unordered() {
DefaultXYDataset d = new DefaultXYDataset();
// check a series with no items
d.addSeries("S1", new double[][] {{}, {}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 0, 10.0,
11.0));
// check a series with one item
d.addSeries("S2", new double[][] {{0.0}, {9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 1, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 1, 2.0,
3.3));
// check a series with two items
d.addSeries("S3", new double[][] {{0.0, 1.0}, {9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 2, 0.0,
1.1));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 2, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 2, 2.0,
3.3));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 2, 3.0,
4.4));
// check a series with three items
d.addSeries("S4", new double[][] {{1.0, 2.0, 1.5}, {9.9, 9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 3, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 3, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 3, 2.0,
3.3));
assertEquals(2, RendererUtilities.findLiveItemsLowerBound(d, 3, 3.0,
4.4));
// check a series with four items
d.addSeries("S5", new double[][] {{1.0, 2.0, 1.5, 1.8}, {9.9, 9.9,
9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 4, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 4, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 4, 2.0,
3.3));
assertEquals(3, RendererUtilities.findLiveItemsLowerBound(d, 4, 3.0,
4.4));
assertEquals(3, RendererUtilities.findLiveItemsLowerBound(d, 4, 4.0,
5.5));
}
示例2: testFindLiveItemsLowerBound_Ascending
import org.jfree.chart.renderer.RendererUtilities; //导入依赖的package包/类
/**
* Some checks for the findLiveItemsLowerBound() method when the dataset is
* ASCENDING.
*/
public void testFindLiveItemsLowerBound_Ascending() {
DefaultXYDataset d = new DefaultXYDataset() {
public DomainOrder getDomainOrder() {
// we're doing this for testing only, and make sure that we
// only add data in ascending order by x-value
return DomainOrder.ASCENDING;
}
};
// check a series with no items
d.addSeries("S1", new double[][] {{}, {}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 0, 10.0,
11.1));
// check a series with one item
d.addSeries("S2", new double[][] {{1.0}, {9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 1, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 1, 2.0,
2.2));
// check a series with two items
d.addSeries("S3", new double[][] {{1.0, 2.0}, {9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 2, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 2, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 2, 2.0,
3.3));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 2, 3.0,
4.4));
// check a series with three items
d.addSeries("S4", new double[][] {{1.0, 2.0, 3.0}, {9.9, 9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 3, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 3, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 3, 2.0,
3.3));
assertEquals(2, RendererUtilities.findLiveItemsLowerBound(d, 3, 3.0,
4.4));
// check a series with four items
d.addSeries("S5", new double[][] {{1.0, 2.0, 3.0, 4.0}, {9.9, 9.9,
9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 4, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 4, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 4, 2.0,
3.3));
assertEquals(2, RendererUtilities.findLiveItemsLowerBound(d, 4, 3.0,
4.4));
assertEquals(3, RendererUtilities.findLiveItemsLowerBound(d, 4, 4.0,
5.5));
// check a series with repeating items
d.addSeries("S5", new double[][] {{1.0, 2.0, 2.0, 2.0, 3.0}, {9.9, 9.9,
9.9, 9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 4, 0.0,
4.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 4, 1.0,
4.0));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 4, 2.0,
4.0));
assertEquals(4, RendererUtilities.findLiveItemsLowerBound(d, 4, 3.0,
4.0));
}
示例3: testFindLiveItemsLowerBound_Descending
import org.jfree.chart.renderer.RendererUtilities; //导入依赖的package包/类
/**
* Some checks for the findLiveItemsLowerBound() method when the dataset is
* DESCENDING.
*/
public void testFindLiveItemsLowerBound_Descending() {
DefaultXYDataset d = new DefaultXYDataset() {
public DomainOrder getDomainOrder() {
// we're doing this for testing only, and make sure that we
// only add data in descending order by x-value
return DomainOrder.DESCENDING;
}
};
// check a series with no items
d.addSeries("S1", new double[][] {{}, {}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 0, 10.0,
11.0));
// check a series with one item
d.addSeries("S2", new double[][] {{1.0}, {9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 1, 0.0,
1.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 1, 1.1,
2.0));
// check a series with two items
d.addSeries("S3", new double[][] {{2.0, 1.0}, {9.9, 9.9}});
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 2, 0.1,
0.5));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 2, 0.1,
1.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 2, 1.1,
2.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 2, 2.2,
3.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 2, 3.3,
4.0));
// check a series with three items
d.addSeries("S4", new double[][] {{3.0, 2.0, 1.0}, {9.9, 9.9, 9.9}});
assertEquals(2, RendererUtilities.findLiveItemsLowerBound(d, 3, 0.0,
1.0));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 3, 1.0,
2.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 3, 2.0,
3.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 3, 3.0,
4.0));
// check a series with four items
d.addSeries("S5", new double[][] {{4.0, 3.0, 2.0, 1.0}, {9.9, 9.9,
9.9, 9.9}});
assertEquals(3, RendererUtilities.findLiveItemsLowerBound(d, 4, 0.1,
0.5));
assertEquals(3, RendererUtilities.findLiveItemsLowerBound(d, 4, 0.1,
1.0));
assertEquals(2, RendererUtilities.findLiveItemsLowerBound(d, 4, 1.1,
2.0));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 4, 2.2,
3.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 4, 3.3,
4.0));
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 4, 4.4,
5.0));
// check a series with repeating items
d.addSeries("S6", new double[][] {{3.0, 2.0, 2.0, 2.0, 1.0}, {9.9, 9.9,
9.9, 9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsLowerBound(d, 5, 0.0,
3.0));
assertEquals(1, RendererUtilities.findLiveItemsLowerBound(d, 5, 0.0,
2.0));
assertEquals(4, RendererUtilities.findLiveItemsLowerBound(d, 5, 0.0,
1.0));
assertEquals(4, RendererUtilities.findLiveItemsLowerBound(d, 5, 0.0,
0.5));
}
示例4: testFindLiveItemsUpperBound_Unordered
import org.jfree.chart.renderer.RendererUtilities; //导入依赖的package包/类
/**
* Some checks for the findLiveItemsUpperBound() method when the dataset is
* unordered.
*/
public void testFindLiveItemsUpperBound_Unordered() {
DefaultXYDataset d = new DefaultXYDataset();
// check a series with no items
d.addSeries("S1", new double[][] {{}, {}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 0, 10.0,
11.0));
// check a series with one item
d.addSeries("S2", new double[][] {{1.0}, {9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 1, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 1, 2.0,
3.3));
// check a series with two items
d.addSeries("S3", new double[][] {{1.0, 2.0}, {9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 2, 0.0,
1.1));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 2, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 2, 2.0,
3.3));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 2, 3.0,
4.4));
// check a series with three items
d.addSeries("S4", new double[][] {{1.0, 2.0, 1.5}, {9.9, 9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 3, 0.0,
1.1));
assertEquals(2, RendererUtilities.findLiveItemsUpperBound(d, 3, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 3, 2.0,
3.3));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 3, 3.0,
4.4));
// check a series with four items
d.addSeries("S5", new double[][] {{1.0, 2.0, 1.5, 1.8}, {9.9, 9.9,
9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 4, 0.0,
1.1));
assertEquals(3, RendererUtilities.findLiveItemsUpperBound(d, 4, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 4, 2.0,
3.3));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 4, 3.0,
4.4));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 4, 4.0,
5.5));
}
示例5: testFindLiveItemsUpperBound_Ascending
import org.jfree.chart.renderer.RendererUtilities; //导入依赖的package包/类
/**
* Some checks for the findLiveItemsUpperBound() method when the dataset is
* ASCENDING.
*/
public void testFindLiveItemsUpperBound_Ascending() {
DefaultXYDataset d = new DefaultXYDataset() {
public DomainOrder getDomainOrder() {
// we're doing this for testing only, and make sure that we
// only add data in ascending order by x-value
return DomainOrder.ASCENDING;
}
};
// check a series with no items
d.addSeries("S1", new double[][] {{}, {}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 0, 10.0,
11.1));
// check a series with one item
d.addSeries("S2", new double[][] {{1.0}, {9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 1, 0.0,
1.1));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 1, 2.0,
2.2));
// check a series with two items
d.addSeries("S3", new double[][] {{1.0, 2.0}, {9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 2, 0.0,
1.0));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 2, 1.0,
2.2));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 2, 2.0,
3.3));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 2, 3.0,
4.4));
// check a series with three items
d.addSeries("S4", new double[][] {{1.0, 2.0, 3.0}, {9.9, 9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 3, 0.0,
1.1));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 3, 1.0,
2.2));
assertEquals(2, RendererUtilities.findLiveItemsUpperBound(d, 3, 2.0,
3.3));
assertEquals(2, RendererUtilities.findLiveItemsUpperBound(d, 3, 3.0,
4.4));
// check a series with four items
d.addSeries("S5", new double[][] {{1.0, 2.0, 3.0, 4.0}, {9.9, 9.9,
9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 4, 0.0,
1.1));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 4, 1.0,
2.2));
assertEquals(2, RendererUtilities.findLiveItemsUpperBound(d, 4, 2.0,
3.3));
assertEquals(3, RendererUtilities.findLiveItemsUpperBound(d, 4, 3.0,
4.4));
assertEquals(3, RendererUtilities.findLiveItemsUpperBound(d, 4, 4.0,
5.5));
// check a series with repeating items
d.addSeries("S5", new double[][] {{1.0, 2.0, 2.0, 2.0, 3.0}, {9.9, 9.9,
9.9, 9.9, 9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 4, 0.0,
1.0));
assertEquals(3, RendererUtilities.findLiveItemsUpperBound(d, 4, 0.0,
2.0));
assertEquals(4, RendererUtilities.findLiveItemsUpperBound(d, 4, 0.0,
3.0));
assertEquals(4, RendererUtilities.findLiveItemsUpperBound(d, 4, 0.0,
4.0));
}
示例6: testFindLiveItemsUpperBound_Descending
import org.jfree.chart.renderer.RendererUtilities; //导入依赖的package包/类
/**
* Some checks for the findLiveItemsUpperBound() method when the dataset is
* DESCENDING.
*/
public void testFindLiveItemsUpperBound_Descending() {
DefaultXYDataset d = new DefaultXYDataset() {
public DomainOrder getDomainOrder() {
// we're doing this for testing only, and make sure that we
// only add data in descending order by x-value
return DomainOrder.DESCENDING;
}
};
// check a series with no items
d.addSeries("S1", new double[][] {{}, {}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 0, 10.0,
11.0));
// check a series with one item
d.addSeries("S2", new double[][] {{1.0}, {9.9}});
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 1, 0.0,
1.0));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 1, 1.1,
2.0));
// check a series with two items
d.addSeries("S3", new double[][] {{2.0, 1.0}, {9.9, 9.9}});
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 2, 0.1,
0.5));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 2, 0.1,
1.0));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 2, 1.1,
2.0));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 2, 2.2,
3.0));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 2, 3.3,
4.0));
// check a series with three items
d.addSeries("S4", new double[][] {{3.0, 2.0, 1.0}, {9.9, 9.9, 9.9}});
assertEquals(2, RendererUtilities.findLiveItemsUpperBound(d, 3, 0.0,
1.0));
assertEquals(2, RendererUtilities.findLiveItemsUpperBound(d, 3, 1.0,
2.0));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 3, 2.0,
3.0));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 3, 3.0,
4.0));
// check a series with four items
d.addSeries("S5", new double[][] {{4.0, 3.0, 2.0, 1.0}, {9.9, 9.9,
9.9, 9.9}});
assertEquals(3, RendererUtilities.findLiveItemsUpperBound(d, 4, 0.1,
0.5));
assertEquals(3, RendererUtilities.findLiveItemsUpperBound(d, 4, 0.1,
1.0));
assertEquals(2, RendererUtilities.findLiveItemsUpperBound(d, 4, 1.1,
2.0));
assertEquals(1, RendererUtilities.findLiveItemsUpperBound(d, 4, 2.2,
3.0));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 4, 3.3,
4.0));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 4, 4.4,
5.0));
// check a series with repeating items
d.addSeries("S6", new double[][] {{3.0, 2.0, 2.0, 2.0, 1.0}, {9.9, 9.9,
9.9, 9.9, 9.9}});
assertEquals(4, RendererUtilities.findLiveItemsUpperBound(d, 5, 0.0,
5.0));
assertEquals(4, RendererUtilities.findLiveItemsUpperBound(d, 5, 1.0,
5.0));
assertEquals(3, RendererUtilities.findLiveItemsUpperBound(d, 5, 2.0,
5.0));
assertEquals(0, RendererUtilities.findLiveItemsUpperBound(d, 5, 3.0,
5.0));
}