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


Java CompositeTitle类代码示例

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


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

示例1: testEquals

import org.jfree.chart.title.CompositeTitle; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    CompositeTitle t1 = new CompositeTitle(new BlockContainer());
    CompositeTitle t2 = new CompositeTitle(new BlockContainer());
    assertEquals(t1, t2);
    assertEquals(t2, t1);
    
    // margin
    t1.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));
    
    // border
    t1.setBorder(new BlockBorder(Color.red));
    assertFalse(t1.equals(t2));
    t2.setBorder(new BlockBorder(Color.red));
    assertTrue(t1.equals(t2));
   
    // padding
    t1.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));
    
    // contained titles
    t1.getContainer().add(new TextTitle("T1"));
    assertFalse(t1.equals(t2));
    t2.getContainer().add(new TextTitle("T1"));
    assertTrue(t1.equals(t2));
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:35,代码来源:CompositeTitleTests.java

示例2: testHashcode

import org.jfree.chart.title.CompositeTitle; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    CompositeTitle t1 = new CompositeTitle(new BlockContainer());
    t1.getContainer().add(new TextTitle("T1"));
    CompositeTitle t2 = new CompositeTitle(new BlockContainer());
    t2.getContainer().add(new TextTitle("T1"));
    assertTrue(t1.equals(t2));
    int h1 = t1.hashCode();
    int h2 = t2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:14,代码来源:CompositeTitleTests.java

示例3: applyToTitle

import org.jfree.chart.title.CompositeTitle; //导入依赖的package包/类
/**
 * Applies the attributes of this theme to the specified title.
 *
 * @param title  the title.
 */
protected void applyToTitle(Title title) {
    if (title instanceof TextTitle) {
        TextTitle tt = (TextTitle) title;
        tt.setFont(this.largeFont);
        tt.setPaint(this.subtitlePaint);
    }
    else if (title instanceof LegendTitle) {
        LegendTitle lt = (LegendTitle) title;
        if (lt.getBackgroundPaint() != null) {
            lt.setBackgroundPaint(this.legendBackgroundPaint);
        }
        lt.setItemFont(this.regularFont);
        lt.setItemPaint(this.legendItemPaint);
        if (lt.getWrapper() != null) {
            applyToBlockContainer(lt.getWrapper());
        }
    }
    else if (title instanceof PaintScaleLegend) {
        PaintScaleLegend psl = (PaintScaleLegend) title;
        psl.setBackgroundPaint(this.legendBackgroundPaint);
        ValueAxis axis = psl.getAxis();
        if (axis != null) {
            applyToValueAxis(axis);
        }
    }
    else if (title instanceof CompositeTitle) {
        CompositeTitle ct = (CompositeTitle) title;
        BlockContainer bc = ct.getContainer();
        List blocks = bc.getBlocks();
        Iterator iterator = blocks.iterator();
        while (iterator.hasNext()) {
            Block b = (Block) iterator.next();
            if (b instanceof Title) {
                applyToTitle((Title) b);
            }
        }
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:44,代码来源:StandardChartTheme.java

示例4: testEquals

import org.jfree.chart.title.CompositeTitle; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    CompositeTitle t1 = new CompositeTitle(new BlockContainer());
    CompositeTitle t2 = new CompositeTitle(new BlockContainer());
    assertEquals(t1, t2);
    assertEquals(t2, t1);

    // margin
    t1.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));

    // frame
    t1.setFrame(new BlockBorder(Color.red));
    assertFalse(t1.equals(t2));
    t2.setFrame(new BlockBorder(Color.red));
    assertTrue(t1.equals(t2));

    // padding
    t1.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));

    // contained titles
    t1.getContainer().add(new TextTitle("T1"));
    assertFalse(t1.equals(t2));
    t2.getContainer().add(new TextTitle("T1"));
    assertTrue(t1.equals(t2));

    t1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.yellow));
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.yellow));
    assertTrue(t1.equals(t2));

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

示例5: testHashcode

import org.jfree.chart.title.CompositeTitle; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashcode() {
    CompositeTitle t1 = new CompositeTitle(new BlockContainer());
    t1.getContainer().add(new TextTitle("T1"));
    CompositeTitle t2 = new CompositeTitle(new BlockContainer());
    t2.getContainer().add(new TextTitle("T1"));
    assertTrue(t1.equals(t2));
    int h1 = t1.hashCode();
    int h2 = t2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:14,代码来源:CompositeTitleTests.java

示例6: testConstructor

import org.jfree.chart.title.CompositeTitle; //导入依赖的package包/类
/**
 * Some checks for the constructor.
 */
public void testConstructor() {
    CompositeTitle t = new CompositeTitle();
    assertNull(t.getBackgroundPaint());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:CompositeTitleTests.java


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