本文整理汇总了Java中org.jfree.chart.renderer.category.LineAndShapeRenderer.clone方法的典型用法代码示例。如果您正苦于以下问题:Java LineAndShapeRenderer.clone方法的具体用法?Java LineAndShapeRenderer.clone怎么用?Java LineAndShapeRenderer.clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.LineAndShapeRenderer
的用法示例。
在下文中一共展示了LineAndShapeRenderer.clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCloning2
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
/**
* A check for cloning.
*/
@Test
public void testCloning2() throws CloneNotSupportedException {
LineAndShapeRenderer r1 = new LineAndShapeRenderer();
r1.setBasePaint(Color.blue);
r1.setBaseLegendTextPaint(new GradientPaint(1.0f, 2.0f, Color.red,
3.0f, 4.0f, Color.blue));
LineAndShapeRenderer r2 = (LineAndShapeRenderer) r1.clone();
assertTrue(r1 != r2);
assertTrue(r1.getClass() == r2.getClass());
assertTrue(r1.equals(r2));
MyRendererChangeListener listener = new MyRendererChangeListener();
r2.addChangeListener(listener);
r2.setBasePaint(Color.red);
assertTrue(listener.lastEvent.getRenderer() == r2);
assertFalse(r1.hasListener(listener));
}
示例2: testCloning2
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
/**
* A check for cloning.
*/
@Test
public void testCloning2() throws CloneNotSupportedException {
LineAndShapeRenderer r1 = new LineAndShapeRenderer();
r1.setDefaultPaint(Color.BLUE);
r1.setDefaultLegendTextPaint(new GradientPaint(1.0f, 2.0f, Color.RED,
3.0f, 4.0f, Color.BLUE));
LineAndShapeRenderer r2 = (LineAndShapeRenderer) r1.clone();
assertTrue(r1 != r2);
assertTrue(r1.getClass() == r2.getClass());
assertTrue(r1.equals(r2));
MyRendererChangeListener listener = new MyRendererChangeListener();
r2.addChangeListener(listener);
r2.setDefaultPaint(Color.RED);
assertTrue(listener.lastEvent.getRenderer() == r2);
assertFalse(r1.hasListener(listener));
}