本文整理汇总了Java中org.jfree.chart.renderer.GrayPaintScale类的典型用法代码示例。如果您正苦于以下问题:Java GrayPaintScale类的具体用法?Java GrayPaintScale怎么用?Java GrayPaintScale使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GrayPaintScale类属于org.jfree.chart.renderer包,在下文中一共展示了GrayPaintScale类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testHashcode
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashcode() {
PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
PaintScaleLegend l2 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
assertTrue(l1.equals(l2));
int h1 = l1.hashCode();
int h2 = l2.hashCode();
assertEquals(h1, h2);
}
示例2: testEquals
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的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));
}
示例3: testHashcode
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
@Test
public void testHashcode() {
PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
PaintScaleLegend l2 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
assertTrue(l1.equals(l2));
int h1 = l1.hashCode();
int h2 = l2.hashCode();
assertEquals(h1, h2);
}
示例4: testCloning
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() throws CloneNotSupportedException {
PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
PaintScaleLegend l2 = (PaintScaleLegend) l1.clone();
assertTrue(l1 != l2);
assertTrue(l1.getClass() == l2.getClass());
assertTrue(l1.equals(l2));
}
示例5: testSerialization
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
PaintScaleLegend l2 = (PaintScaleLegend) TestUtilities.serialised(l1);
assertEquals(l1, l2);
}
示例6: testEquals
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
@Test
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));
}
示例7: testSerialization
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
PaintScaleLegend l2 = (PaintScaleLegend) TestUtils.serialised(l1);
assertEquals(l1, l2);
}
示例8: testHashcode
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashcode() {
PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
PaintScaleLegend l2 = new PaintScaleLegend(new GrayPaintScale(),
new NumberAxis("X"));
assertTrue(l1.equals(l2));
int h1 = l1.hashCode();
int h2 = l2.hashCode();
assertEquals(h1, h2);
}
示例9: testConstructor
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Simple check for the default constructor.
*/
public void testConstructor() {
GrayPaintScale gps = new GrayPaintScale();
assertEquals(0.0, gps.getLowerBound(), EPSILON);
assertEquals(1.0, gps.getUpperBound(), EPSILON);
assertEquals(255, gps.getAlpha());
}
示例10: testGetPaint
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的package包/类
/**
* Some checks for the getPaint() method.
*/
public void testGetPaint() {
GrayPaintScale gps = new GrayPaintScale();
Color c = (Color) gps.getPaint(0.0);
assertTrue(c.equals(Color.black));
c = (Color) gps.getPaint(1.0);
assertTrue(c.equals(Color.white));
// check lookup values that are outside the bounds - see bug report
// 1767315
c = (Color) gps.getPaint(-0.5);
assertTrue(c.equals(Color.black));
c = (Color) gps.getPaint(1.5);
assertTrue(c.equals(Color.white));
}
示例11: testEquals
import org.jfree.chart.renderer.GrayPaintScale; //导入依赖的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));
}