org.jfree.chart.axis.CyclicNumberAxis Java Examples

The following examples show how to use org.jfree.chart.axis.CyclicNumberAxis. 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: CyclicNumberAxisTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashCode() {
    CyclicNumberAxis a1 = new CyclicNumberAxis(10, 0, "Test");
    CyclicNumberAxis a2 = new CyclicNumberAxis(10, 0, "Test");
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
Example #2
Source File: CyclicNumberAxisTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashCode() {
    CyclicNumberAxis a1 = new CyclicNumberAxis(10, 0, "Test");
    CyclicNumberAxis a2 = new CyclicNumberAxis(10, 0, "Test");
    assertTrue(a1.equals(a2));
    int h1 = a1.hashCode();
    int h2 = a2.hashCode();
    assertEquals(h1, h2);
}
 
Example #3
Source File: CyclicNumberAxisTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {

    CyclicNumberAxis a1 = new CyclicNumberAxis(10, 0, "Test");
    CyclicNumberAxis a2 = new CyclicNumberAxis(10, 0, "Test");
    assertTrue(a1.equals(a2));

    // period
    a1.setPeriod(5);
    assertFalse(a1.equals(a2));
    a2.setPeriod(5);
    assertTrue(a1.equals(a2));

    // offset
    a1.setOffset(2.0);
    assertFalse(a1.equals(a2));
    a2.setOffset(2.0);
    assertTrue(a1.equals(a2));

    // advance line Paint
    a1.setAdvanceLinePaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.black));
    assertFalse(a1.equals(a2));
    a2.setAdvanceLinePaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.black));
    assertTrue(a1.equals(a2));

    // advance line Stroke
    Stroke stroke = new BasicStroke(0.2f);
    a1.setAdvanceLineStroke(stroke);
    assertFalse(a1.equals(a2));
    a2.setAdvanceLineStroke(stroke);
    assertTrue(a1.equals(a2));

    // advance line Visible
    a1.setAdvanceLineVisible(!a1.isAdvanceLineVisible());
    assertFalse(a1.equals(a2));
    a2.setAdvanceLineVisible(a1.isAdvanceLineVisible());
    assertTrue(a1.equals(a2));

    // cycle bound mapping
    a1.setBoundMappedToLastCycle(!a1.isBoundMappedToLastCycle());
    assertFalse(a1.equals(a2));
    a2.setBoundMappedToLastCycle(a1.isBoundMappedToLastCycle());
    assertTrue(a1.equals(a2));

}
 
Example #4
Source File: CyclicNumberAxisTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
   
    CyclicNumberAxis a1 = new CyclicNumberAxis(10, 0, "Test");
    CyclicNumberAxis a2 = new CyclicNumberAxis(10, 0, "Test");
    assertTrue(a1.equals(a2));
    
    // period
    a1.setPeriod(5);
    assertFalse(a1.equals(a2));
    a2.setPeriod(5);
    assertTrue(a1.equals(a2));

    // offset
    a1.setOffset(2.0);
    assertFalse(a1.equals(a2));
    a2.setOffset(2.0);
    assertTrue(a1.equals(a2));

    // advance line Paint
    a1.setAdvanceLinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 
            3.0f, 4.0f, Color.black));
    assertFalse(a1.equals(a2));
    a2.setAdvanceLinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 
            3.0f, 4.0f, Color.black));
    assertTrue(a1.equals(a2));
    
    // advance line Stroke
    Stroke stroke = new BasicStroke(0.2f);
    a1.setAdvanceLineStroke(stroke);
    assertFalse(a1.equals(a2));
    a2.setAdvanceLineStroke(stroke);
    assertTrue(a1.equals(a2));

    // advance line Visible
    a1.setAdvanceLineVisible(!a1.isAdvanceLineVisible());
    assertFalse(a1.equals(a2));
    a2.setAdvanceLineVisible(a1.isAdvanceLineVisible());
    assertTrue(a1.equals(a2));

    // cycle bound mapping
    a1.setBoundMappedToLastCycle(!a1.isBoundMappedToLastCycle());
    assertFalse(a1.equals(a2));
    a2.setBoundMappedToLastCycle(a1.isBoundMappedToLastCycle());
    assertTrue(a1.equals(a2));
    
}