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


Java TextLine类代码示例

本文整理汇总了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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:CategoryTickTests.java

示例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);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:20,代码来源:CategoryTickTest.java

示例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));

}
 
开发者ID:nologic,项目名称:nabs,代码行数:14,代码来源:TextBlockTests.java

示例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));

}
 
开发者ID:nologic,项目名称:nabs,代码行数:12,代码来源:TextLineTests.java

示例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;
}
 
开发者ID:uq-eresearch,项目名称:aorra,代码行数:13,代码来源:AutoSubCategoryAxis.java

示例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));

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:47,代码来源:CategoryTickTest.java

示例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));
    
}
 
开发者ID:nologic,项目名称:nabs,代码行数:64,代码来源:TextBoxTests.java


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