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


Java PaintScaleLegend.setStripWidth方法代码示例

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


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

示例1: testEquals

import org.jfree.chart.title.PaintScaleLegend; //导入方法依赖的package包/类
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    
    // default instances
    PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(), 
            new NumberAxis("X"));
    PaintScaleLegend l2 = new PaintScaleLegend(new GrayPaintScale(), 
            new NumberAxis("X"));
    assertTrue(l1.equals(l2));
    assertTrue(l2.equals(l1));
    
    // paintScale
    l1.setScale(new LookupPaintScale());
    assertFalse(l1.equals(l2));
    l2.setScale(new LookupPaintScale());
    assertTrue(l1.equals(l2));
    
    // axis
    l1.setAxis(new NumberAxis("Axis 2"));
    assertFalse(l1.equals(l2));
    l2.setAxis(new NumberAxis("Axis 2"));
    assertTrue(l1.equals(l2));
    
    // axisLocation
    l1.setAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
    assertFalse(l1.equals(l2));
    l2.setAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
    assertTrue(l1.equals(l2));
    
    // axisOffset
    l1.setAxisOffset(99.0);
    assertFalse(l1.equals(l2));
    l2.setAxisOffset(99.0);
    assertTrue(l1.equals(l2));
    
    // stripWidth
    l1.setStripWidth(99.0);
    assertFalse(l1.equals(l2));
    l2.setStripWidth(99.0);
    assertTrue(l1.equals(l2));
    
    // stripOutlineVisible
    l1.setStripOutlineVisible(!l1.isStripOutlineVisible());
    assertFalse(l1.equals(l2));
    l2.setStripOutlineVisible(l1.isStripOutlineVisible());
    assertTrue(l1.equals(l2));
    
    // stripOutlinePaint
    l1.setStripOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertFalse(l1.equals(l2));
    l2.setStripOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertTrue(l1.equals(l2));
    
    // stripOutlineStroke
    l1.setStripOutlineStroke(new BasicStroke(1.1f));
    assertFalse(l1.equals(l2));
    l2.setStripOutlineStroke(new BasicStroke(1.1f));
    assertTrue(l1.equals(l2));
    
    // backgroundPaint
    l1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertFalse(l1.equals(l2));
    l2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertTrue(l1.equals(l2));
        
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:73,代码来源:PaintScaleLegendTests.java

示例2: testEquals

import org.jfree.chart.title.PaintScaleLegend; //导入方法依赖的package包/类
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {

    // default instances
    PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(),
            new NumberAxis("X"));
    PaintScaleLegend l2 = new PaintScaleLegend(new GrayPaintScale(),
            new NumberAxis("X"));
    assertTrue(l1.equals(l2));
    assertTrue(l2.equals(l1));

    // paintScale
    l1.setScale(new LookupPaintScale());
    assertFalse(l1.equals(l2));
    l2.setScale(new LookupPaintScale());
    assertTrue(l1.equals(l2));

    // axis
    l1.setAxis(new NumberAxis("Axis 2"));
    assertFalse(l1.equals(l2));
    l2.setAxis(new NumberAxis("Axis 2"));
    assertTrue(l1.equals(l2));

    // axisLocation
    l1.setAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
    assertFalse(l1.equals(l2));
    l2.setAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
    assertTrue(l1.equals(l2));

    // axisOffset
    l1.setAxisOffset(99.0);
    assertFalse(l1.equals(l2));
    l2.setAxisOffset(99.0);
    assertTrue(l1.equals(l2));

    // stripWidth
    l1.setStripWidth(99.0);
    assertFalse(l1.equals(l2));
    l2.setStripWidth(99.0);
    assertTrue(l1.equals(l2));

    // stripOutlineVisible
    l1.setStripOutlineVisible(!l1.isStripOutlineVisible());
    assertFalse(l1.equals(l2));
    l2.setStripOutlineVisible(l1.isStripOutlineVisible());
    assertTrue(l1.equals(l2));

    // stripOutlinePaint
    l1.setStripOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertFalse(l1.equals(l2));
    l2.setStripOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertTrue(l1.equals(l2));

    // stripOutlineStroke
    l1.setStripOutlineStroke(new BasicStroke(1.1f));
    assertFalse(l1.equals(l2));
    l2.setStripOutlineStroke(new BasicStroke(1.1f));
    assertTrue(l1.equals(l2));

    // backgroundPaint
    l1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertFalse(l1.equals(l2));
    l2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertTrue(l1.equals(l2));

    l1.setSubdivisionCount(99);
    assertFalse(l1.equals(l2));
    l2.setSubdivisionCount(99);
    assertTrue(l1.equals(l2));

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:78,代码来源:PaintScaleLegendTests.java


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