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


Java TextTitle.setText方法代码示例

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


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

示例1: testEquals

import org.jfree.chart.title.TextTitle; //导入方法依赖的package包/类
/**
 * Problem that the equals(...) method distinguishes all fields.
 */
public void testEquals() {
    TextTitle t1 = new TextTitle();
    TextTitle t2 = new TextTitle();
    assertEquals(t1, t2);
    
    t1.setText("Test 1");
    assertFalse(t1.equals(t2));
    t2.setText("Test 1");
    assertTrue(t1.equals(t2));
    
    Font f = new Font("SansSerif", Font.PLAIN, 15);
    t1.setFont(f);
    assertFalse(t1.equals(t2));
    t2.setFont(f);
    assertTrue(t1.equals(t2));
    
    t1.setPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setPaint(Color.blue);
    assertTrue(t1.equals(t2));
    
    t1.setBackgroundPaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(Color.blue);
    assertTrue(t1.equals(t2));
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:31,代码来源:TextTitleTests.java

示例2: testEquals

import org.jfree.chart.title.TextTitle; //导入方法依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    TextTitle t1 = new TextTitle();
    TextTitle t2 = new TextTitle();
    assertEquals(t1, t2);
    
    t1.setText("Test 1");
    assertFalse(t1.equals(t2));
    t2.setText("Test 1");
    assertTrue(t1.equals(t2));
    
    Font f = new Font("SansSerif", Font.PLAIN, 15);
    t1.setFont(f);
    assertFalse(t1.equals(t2));
    t2.setFont(f);
    assertTrue(t1.equals(t2));
    
    t1.setTextAlignment(HorizontalAlignment.RIGHT);
    assertFalse(t1.equals(t2));
    t2.setTextAlignment(HorizontalAlignment.RIGHT);
    assertTrue(t1.equals(t2));
    
    // paint
    t1.setPaint(new GradientPaint(1.0f, 2.0f, Color.red, 
            3.0f, 4.0f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setPaint(new GradientPaint(1.0f, 2.0f, Color.red, 
            3.0f, 4.0f, Color.blue));
    assertTrue(t1.equals(t2));
    
    // backgroundPaint
    t1.setBackgroundPaint(new GradientPaint(4.0f, 3.0f, Color.red, 
            2.0f, 1.0f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(new GradientPaint(4.0f, 3.0f, Color.red, 
            2.0f, 1.0f, Color.blue));
    assertTrue(t1.equals(t2));
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:42,代码来源:TextTitleTests.java

示例3: getSubTitle

import org.jfree.chart.title.TextTitle; //导入方法依赖的package包/类
private TextTitle getSubTitle( BaseChart chart )
{
    TextTitle textTitle = new TextTitle();

    String title = chart.hasTitle() ? chart.getTitle() : chart.generateTitle();

    textTitle.setFont( SUB_TITLE_FONT );
    textTitle.setText( title );

    return textTitle;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:12,代码来源:DefaultChartService.java

示例4: getSubTitle

import org.jfree.chart.title.TextTitle; //导入方法依赖的package包/类
private TextTitle getSubTitle( BaseChart chart )
{
    TextTitle textTitle = new TextTitle();

    String title = chart.hasTitle() ? chart.getTitle() : chart.generateTitle();
    
    textTitle.setFont( SUB_TITLE_FONT );
    textTitle.setText( title );
    
    return textTitle;
}
 
开发者ID:ehatle,项目名称:AgileAlligators,代码行数:12,代码来源:DefaultChartService.java

示例5: testEquals

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

    t1.setText("Test 1");
    assertFalse(t1.equals(t2));
    t2.setText("Test 1");
    assertTrue(t1.equals(t2));

    Font f = new Font("SansSerif", Font.PLAIN, 15);
    t1.setFont(f);
    assertFalse(t1.equals(t2));
    t2.setFont(f);
    assertTrue(t1.equals(t2));

    t1.setTextAlignment(HorizontalAlignment.RIGHT);
    assertFalse(t1.equals(t2));
    t2.setTextAlignment(HorizontalAlignment.RIGHT);
    assertTrue(t1.equals(t2));

    // paint
    t1.setPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.blue));
    assertTrue(t1.equals(t2));

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

    // maximumLinesToDisplay
    t1.setMaximumLinesToDisplay(3);
    assertFalse(t1.equals(t2));
    t2.setMaximumLinesToDisplay(3);
    assertTrue(t1.equals(t2));

    // toolTipText
    t1.setToolTipText("TTT");
    assertFalse(t1.equals(t2));
    t2.setToolTipText("TTT");
    assertTrue(t1.equals(t2));

    // urlText
    t1.setURLText(("URL"));
    assertFalse(t1.equals(t2));
    t2.setURLText(("URL"));
    assertTrue(t1.equals(t2));

    // expandToFitSpace
    t1.setExpandToFitSpace(!t1.getExpandToFitSpace());
    assertFalse(t1.equals(t2));
    t2.setExpandToFitSpace(!t2.getExpandToFitSpace());
    assertTrue(t1.equals(t2));

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


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