本文整理汇总了Java中org.jfree.text.TextLine类的典型用法代码示例。如果您正苦于以下问题:Java TextLine类的具体用法?Java TextLine怎么用?Java TextLine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextLine类属于org.jfree.text包,在下文中一共展示了TextLine类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testHashCode
import org.jfree.text.TextLine; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashCode() {
Comparable c1 = "C1";
TextBlock tb1 = new TextBlock();
tb1.addLine(new TextLine("Block 1"));
tb1.addLine(new TextLine("Block 2"));
TextBlockAnchor tba1 = TextBlockAnchor.CENTER;
TextAnchor ta1 = TextAnchor.CENTER;
CategoryTick t1 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f);
CategoryTick t2 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f);
assertTrue(t1.equals(t2));
int h1 = t1.hashCode();
int h2 = t2.hashCode();
assertEquals(h1, h2);
}
示例2: testHashCode
import org.jfree.text.TextLine; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
@Test
public void testHashCode() {
Comparable c1 = "C1";
TextBlock tb1 = new TextBlock();
tb1.addLine(new TextLine("Block 1"));
tb1.addLine(new TextLine("Block 2"));
TextBlockAnchor tba1 = TextBlockAnchor.CENTER;
TextAnchor ta1 = TextAnchor.CENTER;
CategoryTick t1 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f);
CategoryTick t2 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f);
assertTrue(t1.equals(t2));
int h1 = t1.hashCode();
int h2 = t2.hashCode();
assertEquals(h1, h2);
}
示例3: testEquals
import org.jfree.text.TextLine; //导入依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
public void testEquals() {
final TextBlock b1 = new TextBlock();
b1.addLine(new TextLine("Test"));
final TextBlock b2 = new TextBlock();
b2.addLine(new TextLine("Test"));
assertTrue(b1.equals(b2));
assertTrue(b2.equals(b1));
}
示例4: testEquals
import org.jfree.text.TextLine; //导入依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
public void testEquals() {
final TextLine line1 = new TextLine("Test");
final TextLine line2 = new TextLine("Test");
assertTrue(line1.equals(line2));
assertTrue(line2.equals(line1));
}
示例5: makeLabelBlock
import org.jfree.text.TextLine; //导入依赖的package包/类
private TextBlock makeLabelBlock(String[] rows, CategoryLabelConfig config) {
Font f = config.getFont();
Paint p = config.getFontPaint();
TextBlock block = new TextBlock();
for(String s : rows) {
if(StringUtils.isNotBlank(s)) {
TextLine line = new TextLine(s, f, p);
block.addLine(line);
}
}
return block;
}
示例6: testEquals
import org.jfree.text.TextLine; //导入依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
@Test
public void testEquals() {
Comparable c1 = "C1";
Comparable c2 = "C2";
TextBlock tb1 = new TextBlock();
tb1.addLine(new TextLine("Block 1"));
TextBlock tb2 = new TextBlock();
tb1.addLine(new TextLine("Block 2"));
TextBlockAnchor tba1 = TextBlockAnchor.CENTER;
TextBlockAnchor tba2 = TextBlockAnchor.BOTTOM_CENTER;
TextAnchor ta1 = TextAnchor.CENTER;
TextAnchor ta2 = TextAnchor.BASELINE_LEFT;
CategoryTick t1 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f);
CategoryTick t2 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f);
assertTrue(t1.equals(t2));
t1 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f);
assertFalse(t1.equals(t2));
t2 = new CategoryTick(c2, tb1, tba1, ta1, 1.0f);
assertTrue(t1.equals(t2));
t1 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f);
assertFalse(t1.equals(t2));
t2 = new CategoryTick(c2, tb2, tba1, ta1, 1.0f);
assertTrue(t1.equals(t2));
t1 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f);
assertFalse(t1.equals(t2));
t2 = new CategoryTick(c2, tb2, tba2, ta1, 1.0f);
assertTrue(t1.equals(t2));
t1 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f);
assertFalse(t1.equals(t2));
t2 = new CategoryTick(c2, tb2, tba2, ta2, 1.0f);
assertTrue(t1.equals(t2));
t1 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f);
assertFalse(t1.equals(t2));
t2 = new CategoryTick(c2, tb2, tba2, ta2, 2.0f);
assertTrue(t1.equals(t2));
}
示例7: testEquals
import org.jfree.text.TextLine; //导入依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
public void testEquals() {
final TextBox b1 = new TextBox("Hello");
final TextBox b2 = new TextBox("Hello");
assertTrue(b1.equals(b2));
assertTrue(b2.equals(b1));
// outlinePaint
b1.setOutlinePaint(Color.blue);
assertFalse(b1.equals(b2));
b2.setOutlinePaint(Color.blue);
assertTrue(b1.equals(b2));
// outlineStroke
b1.setOutlineStroke(new BasicStroke(1.1f));
assertFalse(b1.equals(b2));
b2.setOutlineStroke(new BasicStroke(1.1f));
assertTrue(b1.equals(b2));
// interiorGap
b1.setInteriorGap(new RectangleInsets(10, 10, 10, 10));
assertFalse(b1.equals(b2));
b2.setInteriorGap(new RectangleInsets(10, 10, 10, 10));
assertTrue(b1.equals(b2));
// backgroundPaint
b1.setBackgroundPaint(Color.blue);
assertFalse(b1.equals(b2));
b2.setBackgroundPaint(Color.blue);
assertTrue(b1.equals(b2));
// shadowPaint
b1.setShadowPaint(Color.blue);
assertFalse(b1.equals(b2));
b2.setShadowPaint(Color.blue);
assertTrue(b1.equals(b2));
// shadowXOffset
b1.setShadowXOffset(1.0);
assertFalse(b1.equals(b2));
b2.setShadowXOffset(1.0);
assertTrue(b1.equals(b2));
// shadowYOffset
b1.setShadowYOffset(1.0);
assertFalse(b1.equals(b2));
b2.setShadowYOffset(1.0);
assertTrue(b1.equals(b2));
// textBlock
final TextBlock tb1 = new TextBlock();
tb1.addLine(new TextLine("Testing"));
b1.setTextBlock(tb1);
assertFalse(b1.equals(b2));
final TextBlock tb2 = new TextBlock();
tb2.addLine(new TextLine("Testing"));
b2.setTextBlock(tb2);
assertTrue(b1.equals(b2));
}