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


Java BarRenderer.setMinimumBarLength方法代码示例

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


在下文中一共展示了BarRenderer.setMinimumBarLength方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testEquals

import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    BarRenderer r1 = new BarRenderer();
    BarRenderer r2 = new BarRenderer();
    assertTrue(r1.equals(r2));
    assertTrue(r2.equals(r1));
    
    // itemMargin
    r1.setItemMargin(0.22);
    assertFalse(r1.equals(r2));
    r2.setItemMargin(0.22);
    assertTrue(r1.equals(r2));
    
    // drawBarOutline
    r1.setDrawBarOutline(!r1.isDrawBarOutline());
    assertFalse(r1.equals(r2));
    r2.setDrawBarOutline(!r2.isDrawBarOutline());
    assertTrue(r1.equals(r2));
    
    // maxBarWidth
    r1.setMaxBarWidth(0.11);
    assertFalse(r1.equals(r2));
    r2.setMaxBarWidth(0.11);
    assertTrue(r1.equals(r2));
    
    // minimumBarLength
    r1.setMinimumBarLength(0.04);
    assertFalse(r1.equals(r2));
    r2.setMinimumBarLength(0.04);
    assertTrue(r1.equals(r2));
    
    // gradientPaintTransformer
    r1.setGradientPaintTransformer(
        new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_VERTICAL)
    );
    assertFalse(r1.equals(r2));
    r2.setGradientPaintTransformer(
        new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_VERTICAL)
    );
    assertTrue(r1.equals(r2));
    
    // positiveItemLabelPositionFallback
    r1.setPositiveItemLabelPositionFallback(
        new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
    );
    assertFalse(r1.equals(r2));
    r2.setPositiveItemLabelPositionFallback(
        new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
    );
    assertTrue(r1.equals(r2));

    // negativeItemLabelPositionFallback
    r1.setNegativeItemLabelPositionFallback(
        new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
    );
    assertFalse(r1.equals(r2));
    r2.setNegativeItemLabelPositionFallback(
        new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
    );
    assertTrue(r1.equals(r2));

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

示例2: testEquals

import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    BarRenderer r1 = new BarRenderer();
    BarRenderer r2 = new BarRenderer();
    assertTrue(r1.equals(r2));
    assertTrue(r2.equals(r1));
    
    // base value
    r1.setBase(0.123);
    assertFalse(r1.equals(r2));
    r2.setBase(0.123);
    assertTrue(r1.equals(r2));
    
    // itemMargin
    r1.setItemMargin(0.22);
    assertFalse(r1.equals(r2));
    r2.setItemMargin(0.22);
    assertTrue(r1.equals(r2));
    
    // drawBarOutline
    r1.setDrawBarOutline(!r1.isDrawBarOutline());
    assertFalse(r1.equals(r2));
    r2.setDrawBarOutline(!r2.isDrawBarOutline());
    assertTrue(r1.equals(r2));
    
    // maximumBarWidth
    r1.setMaximumBarWidth(0.11);
    assertFalse(r1.equals(r2));
    r2.setMaximumBarWidth(0.11);
    assertTrue(r1.equals(r2));
    
    // minimumBarLength
    r1.setMinimumBarLength(0.04);
    assertFalse(r1.equals(r2));
    r2.setMinimumBarLength(0.04);
    assertTrue(r1.equals(r2));
    
    // gradientPaintTransformer
    r1.setGradientPaintTransformer(
        new StandardGradientPaintTransformer(
            GradientPaintTransformType.CENTER_VERTICAL
        )
    );
    assertFalse(r1.equals(r2));
    r2.setGradientPaintTransformer(
        new StandardGradientPaintTransformer(
            GradientPaintTransformType.CENTER_VERTICAL
        )
    );
    assertTrue(r1.equals(r2));
    
    // positiveItemLabelPositionFallback
    r1.setPositiveItemLabelPositionFallback(
        new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
    );
    assertFalse(r1.equals(r2));
    r2.setPositiveItemLabelPositionFallback(
        new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
    );
    assertTrue(r1.equals(r2));

    // negativeItemLabelPositionFallback
    r1.setNegativeItemLabelPositionFallback(
        new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
    );
    assertFalse(r1.equals(r2));
    r2.setNegativeItemLabelPositionFallback(
        new ItemLabelPosition(ItemLabelAnchor.INSIDE1, TextAnchor.CENTER)
    );
    assertTrue(r1.equals(r2));

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


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