@Test public void testEquals() { XYDifferenceRenderer r1 = new XYDifferenceRenderer( Color.RED, Color.BLUE, false); XYDifferenceRenderer r2 = new XYDifferenceRenderer( Color.RED, Color.BLUE, false); assertEquals(r1, r2); r1.setPositivePaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertFalse(r1.equals(r2)); r2.setPositivePaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertEquals(r1, r2); r1.setNegativePaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.BLUE)); assertFalse(r1.equals(r2)); r2.setNegativePaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.BLUE)); assertEquals(r1, r2); r1 = new XYDifferenceRenderer(Color.green, Color.yellow, true); assertFalse(r1.equals(r2)); r2 = new XYDifferenceRenderer(Color.green, Color.yellow, true); assertEquals(r1, r2); r1.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0)); assertFalse(r1.equals(r2)); r2.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0)); assertEquals(r1, r2); r1.setRoundXCoordinates(true); assertFalse(r1.equals(r2)); r2.setRoundXCoordinates(true); assertEquals(r1, r2); assertFalse(r1.equals(null)); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true; }
XYDifferenceRenderer extends AbstractXYItemRenderer implements XYItemRenderer, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true; } }
XYDifferenceRenderer extends AbstractXYItemRenderer implements XYItemRenderer, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true; } XYDifferenceRenderer();  XYDifferenceRenderer(Paint positivePaint, Paint negativePaint,
                                boolean shapes); }
XYDifferenceRenderer extends AbstractXYItemRenderer implements XYItemRenderer, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true; } XYDifferenceRenderer();  XYDifferenceRenderer(Paint positivePaint, Paint negativePaint,
                                boolean shapes); Paint getPositivePaint(); void setPositivePaint(Paint paint); Paint getNegativePaint(); void setNegativePaint(Paint paint); boolean getShapesVisible(); void setShapesVisible(boolean flag); Shape getLegendLine(); void setLegendLine(Shape line); boolean getRoundXCoordinates(); void setRoundXCoordinates(boolean round); @Override XYItemRendererState initialise(Graphics2D g2,
                                          Rectangle2D dataArea,
                                          XYPlot plot,
                                          XYDataset data,
                                          PlotRenderingInfo info); @Override int getPassCount(); @Override void drawItem(Graphics2D g2,
                         XYItemRendererState state,
                         Rectangle2D dataArea,
                         PlotRenderingInfo info,
                         XYPlot plot,
                         ValueAxis domainAxis,
                         ValueAxis rangeAxis,
                         XYDataset dataset,
                         int series,
                         int item,
                         CrosshairState crosshairState,
                         int pass); @Override LegendItem getLegendItem(int datasetIndex, int series); @Override boolean equals(Object obj); @Override Object clone(); }
XYDifferenceRenderer extends AbstractXYItemRenderer implements XYItemRenderer, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true; } XYDifferenceRenderer();  XYDifferenceRenderer(Paint positivePaint, Paint negativePaint,
                                boolean shapes); Paint getPositivePaint(); void setPositivePaint(Paint paint); Paint getNegativePaint(); void setNegativePaint(Paint paint); boolean getShapesVisible(); void setShapesVisible(boolean flag); Shape getLegendLine(); void setLegendLine(Shape line); boolean getRoundXCoordinates(); void setRoundXCoordinates(boolean round); @Override XYItemRendererState initialise(Graphics2D g2,
                                          Rectangle2D dataArea,
                                          XYPlot plot,
                                          XYDataset data,
                                          PlotRenderingInfo info); @Override int getPassCount(); @Override void drawItem(Graphics2D g2,
                         XYItemRendererState state,
                         Rectangle2D dataArea,
                         PlotRenderingInfo info,
                         XYPlot plot,
                         ValueAxis domainAxis,
                         ValueAxis rangeAxis,
                         XYDataset dataset,
                         int series,
                         int item,
                         CrosshairState crosshairState,
                         int pass); @Override LegendItem getLegendItem(int datasetIndex, int series); @Override boolean equals(Object obj); @Override Object clone();  }