@Test public void testEquals() { CandlestickRenderer r1 = new CandlestickRenderer(); CandlestickRenderer r2 = new CandlestickRenderer(); assertEquals(r1, r2); r1.setUpPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.WHITE)); assertFalse(r1.equals(r2)); r2.setUpPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.WHITE)); assertEquals(r1, r2); r1.setDownPaint(new GradientPaint(5.0f, 6.0f, Color.green, 7.0f, 8.0f, Color.yellow)); assertFalse(r1.equals(r2)); r2.setDownPaint(new GradientPaint(5.0f, 6.0f, Color.green, 7.0f, 8.0f, Color.yellow)); assertEquals(r1, r2); r1.setDrawVolume(false); assertFalse(r1.equals(r2)); r2.setDrawVolume(false); assertEquals(r1, r2); r1.setCandleWidth(3.3); assertFalse(r1.equals(r2)); r2.setCandleWidth(3.3); assertEquals(r1, r2); r1.setMaxCandleWidthInMilliseconds(123); assertFalse(r1.equals(r2)); r2.setMaxCandleWidthInMilliseconds(123); assertEquals(r1, r2); r1.setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST); assertFalse(r1.equals(r2)); r2.setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST); assertEquals(r1, r2); r1.setAutoWidthFactor(0.22); assertFalse(r1.equals(r2)); r2.setAutoWidthFactor(0.22); assertEquals(r1, r2); r1.setAutoWidthGap(1.1); assertFalse(r1.equals(r2)); r2.setAutoWidthGap(1.1); assertEquals(r1, r2); r1.setUseOutlinePaint(true); assertFalse(r1.equals(r2)); r2.setUseOutlinePaint(true); assertEquals(r1, r2); r1.setVolumePaint(Color.BLUE); assertFalse(r1.equals(r2)); r2.setVolumePaint(Color.BLUE); assertEquals(r1, r2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CandlestickRenderer)) { return false; } CandlestickRenderer that = (CandlestickRenderer) obj; if (this.candleWidth != that.candleWidth) { return false; } if (!PaintUtilities.equal(this.upPaint, that.upPaint)) { return false; } if (!PaintUtilities.equal(this.downPaint, that.downPaint)) { return false; } if (this.drawVolume != that.drawVolume) { return false; } if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds) { return false; } if (this.autoWidthMethod != that.autoWidthMethod) { return false; } if (this.autoWidthFactor != that.autoWidthFactor) { return false; } if (this.autoWidthGap != that.autoWidthGap) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) { return false; } return super.equals(obj); }
CandlestickRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CandlestickRenderer)) { return false; } CandlestickRenderer that = (CandlestickRenderer) obj; if (this.candleWidth != that.candleWidth) { return false; } if (!PaintUtilities.equal(this.upPaint, that.upPaint)) { return false; } if (!PaintUtilities.equal(this.downPaint, that.downPaint)) { return false; } if (this.drawVolume != that.drawVolume) { return false; } if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds) { return false; } if (this.autoWidthMethod != that.autoWidthMethod) { return false; } if (this.autoWidthFactor != that.autoWidthFactor) { return false; } if (this.autoWidthGap != that.autoWidthGap) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) { return false; } return super.equals(obj); } }
CandlestickRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CandlestickRenderer)) { return false; } CandlestickRenderer that = (CandlestickRenderer) obj; if (this.candleWidth != that.candleWidth) { return false; } if (!PaintUtilities.equal(this.upPaint, that.upPaint)) { return false; } if (!PaintUtilities.equal(this.downPaint, that.downPaint)) { return false; } if (this.drawVolume != that.drawVolume) { return false; } if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds) { return false; } if (this.autoWidthMethod != that.autoWidthMethod) { return false; } if (this.autoWidthFactor != that.autoWidthFactor) { return false; } if (this.autoWidthGap != that.autoWidthGap) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) { return false; } return super.equals(obj); } CandlestickRenderer();  CandlestickRenderer(double candleWidth);  CandlestickRenderer(double candleWidth, boolean drawVolume,
                               XYToolTipGenerator toolTipGenerator); }
CandlestickRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CandlestickRenderer)) { return false; } CandlestickRenderer that = (CandlestickRenderer) obj; if (this.candleWidth != that.candleWidth) { return false; } if (!PaintUtilities.equal(this.upPaint, that.upPaint)) { return false; } if (!PaintUtilities.equal(this.downPaint, that.downPaint)) { return false; } if (this.drawVolume != that.drawVolume) { return false; } if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds) { return false; } if (this.autoWidthMethod != that.autoWidthMethod) { return false; } if (this.autoWidthFactor != that.autoWidthFactor) { return false; } if (this.autoWidthGap != that.autoWidthGap) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) { return false; } return super.equals(obj); } CandlestickRenderer();  CandlestickRenderer(double candleWidth);  CandlestickRenderer(double candleWidth, boolean drawVolume,
                               XYToolTipGenerator toolTipGenerator); double getCandleWidth(); void setCandleWidth(double width); double getMaxCandleWidthInMilliseconds(); void setMaxCandleWidthInMilliseconds(double millis); int getAutoWidthMethod(); void setAutoWidthMethod(int autoWidthMethod); double getAutoWidthFactor(); void setAutoWidthFactor(double autoWidthFactor); double getAutoWidthGap(); void setAutoWidthGap(double autoWidthGap); Paint getUpPaint(); void setUpPaint(Paint paint); Paint getDownPaint(); void setDownPaint(Paint paint); boolean getDrawVolume(); void setDrawVolume(boolean flag); Paint getVolumePaint(); void setVolumePaint(Paint paint); boolean getUseOutlinePaint(); void setUseOutlinePaint(boolean use); @Override Range findRangeBounds(XYDataset dataset); @Override XYItemRendererState initialise(Graphics2D g2,
                                          Rectangle2D dataArea,
                                          XYPlot plot,
                                          XYDataset dataset,
                                          PlotRenderingInfo info); @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 boolean equals(Object obj); @Override Object clone(); }
CandlestickRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CandlestickRenderer)) { return false; } CandlestickRenderer that = (CandlestickRenderer) obj; if (this.candleWidth != that.candleWidth) { return false; } if (!PaintUtilities.equal(this.upPaint, that.upPaint)) { return false; } if (!PaintUtilities.equal(this.downPaint, that.downPaint)) { return false; } if (this.drawVolume != that.drawVolume) { return false; } if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds) { return false; } if (this.autoWidthMethod != that.autoWidthMethod) { return false; } if (this.autoWidthFactor != that.autoWidthFactor) { return false; } if (this.autoWidthGap != that.autoWidthGap) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) { return false; } return super.equals(obj); } CandlestickRenderer();  CandlestickRenderer(double candleWidth);  CandlestickRenderer(double candleWidth, boolean drawVolume,
                               XYToolTipGenerator toolTipGenerator); double getCandleWidth(); void setCandleWidth(double width); double getMaxCandleWidthInMilliseconds(); void setMaxCandleWidthInMilliseconds(double millis); int getAutoWidthMethod(); void setAutoWidthMethod(int autoWidthMethod); double getAutoWidthFactor(); void setAutoWidthFactor(double autoWidthFactor); double getAutoWidthGap(); void setAutoWidthGap(double autoWidthGap); Paint getUpPaint(); void setUpPaint(Paint paint); Paint getDownPaint(); void setDownPaint(Paint paint); boolean getDrawVolume(); void setDrawVolume(boolean flag); Paint getVolumePaint(); void setVolumePaint(Paint paint); boolean getUseOutlinePaint(); void setUseOutlinePaint(boolean use); @Override Range findRangeBounds(XYDataset dataset); @Override XYItemRendererState initialise(Graphics2D g2,
                                          Rectangle2D dataArea,
                                          XYPlot plot,
                                          XYDataset dataset,
                                          PlotRenderingInfo info); @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 boolean equals(Object obj); @Override Object clone(); static final int WIDTHMETHOD_AVERAGE; static final int WIDTHMETHOD_SMALLEST; static final int WIDTHMETHOD_INTERVALDATA; }