Search in sources :

Example 11 with StandardGradientPaintTransformer

use of org.jfree.ui.StandardGradientPaintTransformer in project SIMVA-SoS by SESoS.

the class XYSplineRendererTest method testEquals.

/**
 * Test that the equals() method distinguishes all fields.
 */
@Test
public void testEquals() {
    XYSplineRenderer r1 = new XYSplineRenderer();
    XYSplineRenderer r2 = new XYSplineRenderer();
    assertEquals(r1, r2);
    assertEquals(r2, r1);
    r1.setPrecision(9);
    assertFalse(r1.equals(r2));
    r2.setPrecision(9);
    assertTrue(r1.equals(r2));
    r1.setFillType(XYSplineRenderer.FillType.TO_ZERO);
    assertFalse(r1.equals(r2));
    r2.setFillType(XYSplineRenderer.FillType.TO_ZERO);
    assertTrue(r1.equals(r2));
    r1.setGradientPaintTransformer(null);
    assertFalse(r1.equals(r2));
    r2.setGradientPaintTransformer(null);
    assertTrue(r1.equals(r2));
    r1.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL));
    assertFalse(r1.equals(r2));
    r2.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL));
    assertTrue(r1.equals(r2));
}
Also used : StandardGradientPaintTransformer(org.jfree.ui.StandardGradientPaintTransformer) Test(org.junit.Test)

Example 12 with StandardGradientPaintTransformer

use of org.jfree.ui.StandardGradientPaintTransformer in project SIMVA-SoS by SESoS.

the class XYBarRendererTest method testEquals.

/**
 * Test that the equals() method distinguishes all fields.
 */
@Test
public void testEquals() {
    // default instances
    XYBarRenderer r1 = new XYBarRenderer();
    XYBarRenderer r2 = new XYBarRenderer();
    assertTrue(r1.equals(r2));
    assertTrue(r2.equals(r1));
    // setBase()
    r1.setBase(1.0);
    assertFalse(r1.equals(r2));
    r2.setBase(1.0);
    assertTrue(r1.equals(r2));
    // setUseYInterval
    r1.setUseYInterval(!r1.getUseYInterval());
    assertFalse(r1.equals(r2));
    r2.setUseYInterval(!r2.getUseYInterval());
    assertTrue(r1.equals(r2));
    // setMargin()
    r1.setMargin(0.10);
    assertFalse(r1.equals(r2));
    r2.setMargin(0.10);
    assertTrue(r1.equals(r2));
    // setDrawBarOutline()
    r1.setDrawBarOutline(!r1.isDrawBarOutline());
    assertFalse(r1.equals(r2));
    r2.setDrawBarOutline(!r2.isDrawBarOutline());
    assertTrue(r1.equals(r2));
    // setGradientPaintTransformer()
    r1.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL));
    assertFalse(r1.equals(r2));
    r2.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL));
    assertTrue(r1.equals(r2));
    // legendBar
    r1.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(r1.equals(r2));
    r2.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertTrue(r1.equals(r2));
    // positiveItemLabelFallbackPosition
    r1.setPositiveItemLabelPositionFallback(new ItemLabelPosition());
    assertFalse(r1.equals(r2));
    r2.setPositiveItemLabelPositionFallback(new ItemLabelPosition());
    assertTrue(r1.equals(r2));
    // negativeItemLabelFallbackPosition
    r1.setNegativeItemLabelPositionFallback(new ItemLabelPosition());
    assertFalse(r1.equals(r2));
    r2.setNegativeItemLabelPositionFallback(new ItemLabelPosition());
    assertTrue(r1.equals(r2));
    // barPainter
    r1.setBarPainter(new GradientXYBarPainter(0.11, 0.22, 0.33));
    assertFalse(r1.equals(r2));
    r2.setBarPainter(new GradientXYBarPainter(0.11, 0.22, 0.33));
    assertTrue(r1.equals(r2));
    // shadowsVisible
    r1.setShadowVisible(false);
    assertFalse(r1.equals(r2));
    r2.setShadowVisible(false);
    assertTrue(r1.equals(r2));
    // shadowXOffset
    r1.setShadowXOffset(3.3);
    assertFalse(r1.equals(r2));
    r2.setShadowXOffset(3.3);
    assertTrue(r1.equals(r2));
    // shadowYOffset
    r1.setShadowYOffset(3.3);
    assertFalse(r1.equals(r2));
    r2.setShadowYOffset(3.3);
    assertTrue(r1.equals(r2));
}
Also used : StandardGradientPaintTransformer(org.jfree.ui.StandardGradientPaintTransformer) Rectangle2D(java.awt.geom.Rectangle2D) ItemLabelPosition(org.jfree.chart.labels.ItemLabelPosition) Test(org.junit.Test)

Aggregations

StandardGradientPaintTransformer (org.jfree.ui.StandardGradientPaintTransformer)12 Test (org.junit.Test)10 GradientPaint (java.awt.GradientPaint)4 Rectangle2D (java.awt.geom.Rectangle2D)4 BasicStroke (java.awt.BasicStroke)2 Font (java.awt.Font)2 Line2D (java.awt.geom.Line2D)2 ItemLabelPosition (org.jfree.chart.labels.ItemLabelPosition)2 Color (java.awt.Color)1 JFreeChart (org.jfree.chart.JFreeChart)1 DialBackground (org.jfree.chart.plot.dial.DialBackground)1 DialCap (org.jfree.chart.plot.dial.DialCap)1 DialPlot (org.jfree.chart.plot.dial.DialPlot)1 Pointer (org.jfree.chart.plot.dial.DialPointer.Pointer)1 DialTextAnnotation (org.jfree.chart.plot.dial.DialTextAnnotation)1 DialValueIndicator (org.jfree.chart.plot.dial.DialValueIndicator)1 StandardDialFrame (org.jfree.chart.plot.dial.StandardDialFrame)1 StandardDialRange (org.jfree.chart.plot.dial.StandardDialRange)1 StandardDialScale (org.jfree.chart.plot.dial.StandardDialScale)1 DefaultValueDataset (org.jfree.data.general.DefaultValueDataset)1