org.jfree.text.TextLine Java Examples

The following examples show how to use org.jfree.text.TextLine. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CategoryTickTest.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #2
Source File: CategoryTickTest.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #3
Source File: CategoryTickTest.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #4
Source File: CategoryTickTest.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #5
Source File: CategoryTickTest.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #6
Source File: CategoryTickTest.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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));

}
 
Example #7
Source File: CategoryTickTest.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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));

}
 
Example #8
Source File: CategoryTickTest.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
 * 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));

}
 
Example #9
Source File: CategoryTickTest.java    From ECG-Viewer with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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));

}
 
Example #10
Source File: CategoryTickTest.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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));

}