本文整理汇总了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));
}
示例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));
}
示例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;
}
示例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;
}
示例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));
}