@Test public void testEquals() { JFreeChart chart1 = new JFreeChart("Title", new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), true); JFreeChart chart2 = new JFreeChart("Title", new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), true); assertEquals(chart1, chart2); assertEquals(chart2, chart1); chart1.setRenderingHints(new RenderingHints( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON)); assertFalse(chart1.equals(chart2)); chart2.setRenderingHints(new RenderingHints( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON)); assertEquals(chart1, chart2); chart1.setBorderVisible(true); assertFalse(chart1.equals(chart2)); chart2.setBorderVisible(true); assertEquals(chart1, chart2); BasicStroke s = new BasicStroke(2.0f); chart1.setBorderStroke(s); assertFalse(chart1.equals(chart2)); chart2.setBorderStroke(s); assertEquals(chart1, chart2); chart1.setBorderPaint(Color.RED); assertFalse(chart1.equals(chart2)); chart2.setBorderPaint(Color.RED); assertEquals(chart1, chart2); chart1.setPadding(new RectangleInsets(1, 2, 3, 4)); assertFalse(chart1.equals(chart2)); chart2.setPadding(new RectangleInsets(1, 2, 3, 4)); assertEquals(chart1, chart2); chart1.setTitle("XYZ"); assertFalse(chart1.equals(chart2)); chart2.setTitle("XYZ"); assertEquals(chart1, chart2); chart1.addSubtitle(new TextTitle("Subtitle")); assertFalse(chart1.equals(chart2)); chart2.addSubtitle(new TextTitle("Subtitle")); assertEquals(chart1, chart2); chart1 = new JFreeChart("Title", new Font("SansSerif", Font.PLAIN, 12), new RingPlot(), false); chart2 = new JFreeChart("Title", new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), false); assertFalse(chart1.equals(chart2)); chart2 = new JFreeChart("Title", new Font("SansSerif", Font.PLAIN, 12), new RingPlot(), false); assertEquals(chart1, chart2); chart1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertFalse(chart1.equals(chart2)); chart2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertEquals(chart1, chart2); chart1.setBackgroundImage(getTestImage()); assertFalse(chart1.equals(chart2)); chart2.setBackgroundImage(getTestImage()); assertEquals(chart1, chart2); chart1.setBackgroundImageAlignment(Align.BOTTOM_LEFT); assertFalse(chart1.equals(chart2)); chart2.setBackgroundImageAlignment(Align.BOTTOM_LEFT); assertEquals(chart1, chart2); chart1.setBackgroundImageAlpha(0.1f); assertFalse(chart1.equals(chart2)); chart2.setBackgroundImageAlpha(0.1f); assertEquals(chart1, chart2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof JFreeChart)) { return false; } JFreeChart that = (JFreeChart) obj; if (!this.renderingHints.equals(that.renderingHints)) { return false; } if (this.borderVisible != that.borderVisible) { return false; } if (!ObjectUtilities.equal(this.borderStroke, that.borderStroke)) { return false; } if (!PaintUtilities.equal(this.borderPaint, that.borderPaint)) { return false; } if (!this.padding.equals(that.padding)) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!ObjectUtilities.equal(this.subtitles, that.subtitles)) { return false; } if (!ObjectUtilities.equal(this.plot, that.plot)) { return false; } if (!PaintUtilities.equal( this.backgroundPaint, that.backgroundPaint )) { return false; } if (!ObjectUtilities.equal(this.backgroundImage, that.backgroundImage)) { return false; } if (this.backgroundImageAlignment != that.backgroundImageAlignment) { return false; } if (this.backgroundImageAlpha != that.backgroundImageAlpha) { return false; } if (this.notify != that.notify) { return false; } return true; }
JFreeChart implements Drawable, TitleChangeListener,
        PlotChangeListener, Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof JFreeChart)) { return false; } JFreeChart that = (JFreeChart) obj; if (!this.renderingHints.equals(that.renderingHints)) { return false; } if (this.borderVisible != that.borderVisible) { return false; } if (!ObjectUtilities.equal(this.borderStroke, that.borderStroke)) { return false; } if (!PaintUtilities.equal(this.borderPaint, that.borderPaint)) { return false; } if (!this.padding.equals(that.padding)) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!ObjectUtilities.equal(this.subtitles, that.subtitles)) { return false; } if (!ObjectUtilities.equal(this.plot, that.plot)) { return false; } if (!PaintUtilities.equal( this.backgroundPaint, that.backgroundPaint )) { return false; } if (!ObjectUtilities.equal(this.backgroundImage, that.backgroundImage)) { return false; } if (this.backgroundImageAlignment != that.backgroundImageAlignment) { return false; } if (this.backgroundImageAlpha != that.backgroundImageAlpha) { return false; } if (this.notify != that.notify) { return false; } return true; } }
JFreeChart implements Drawable, TitleChangeListener,
        PlotChangeListener, Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof JFreeChart)) { return false; } JFreeChart that = (JFreeChart) obj; if (!this.renderingHints.equals(that.renderingHints)) { return false; } if (this.borderVisible != that.borderVisible) { return false; } if (!ObjectUtilities.equal(this.borderStroke, that.borderStroke)) { return false; } if (!PaintUtilities.equal(this.borderPaint, that.borderPaint)) { return false; } if (!this.padding.equals(that.padding)) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!ObjectUtilities.equal(this.subtitles, that.subtitles)) { return false; } if (!ObjectUtilities.equal(this.plot, that.plot)) { return false; } if (!PaintUtilities.equal( this.backgroundPaint, that.backgroundPaint )) { return false; } if (!ObjectUtilities.equal(this.backgroundImage, that.backgroundImage)) { return false; } if (this.backgroundImageAlignment != that.backgroundImageAlignment) { return false; } if (this.backgroundImageAlpha != that.backgroundImageAlpha) { return false; } if (this.notify != that.notify) { return false; } return true; } JFreeChart(Plot plot);  JFreeChart(String title, Plot plot);  JFreeChart(String title, Font titleFont, Plot plot,
                      boolean createLegend); }
JFreeChart implements Drawable, TitleChangeListener,
        PlotChangeListener, Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof JFreeChart)) { return false; } JFreeChart that = (JFreeChart) obj; if (!this.renderingHints.equals(that.renderingHints)) { return false; } if (this.borderVisible != that.borderVisible) { return false; } if (!ObjectUtilities.equal(this.borderStroke, that.borderStroke)) { return false; } if (!PaintUtilities.equal(this.borderPaint, that.borderPaint)) { return false; } if (!this.padding.equals(that.padding)) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!ObjectUtilities.equal(this.subtitles, that.subtitles)) { return false; } if (!ObjectUtilities.equal(this.plot, that.plot)) { return false; } if (!PaintUtilities.equal( this.backgroundPaint, that.backgroundPaint )) { return false; } if (!ObjectUtilities.equal(this.backgroundImage, that.backgroundImage)) { return false; } if (this.backgroundImageAlignment != that.backgroundImageAlignment) { return false; } if (this.backgroundImageAlpha != that.backgroundImageAlpha) { return false; } if (this.notify != that.notify) { return false; } return true; } JFreeChart(Plot plot);  JFreeChart(String title, Plot plot);  JFreeChart(String title, Font titleFont, Plot plot,
                      boolean createLegend); RenderingHints getRenderingHints(); void setRenderingHints(RenderingHints hints); boolean isBorderVisible(); void setBorderVisible(boolean visible); Stroke getBorderStroke(); void setBorderStroke(Stroke stroke); Paint getBorderPaint(); void setBorderPaint(Paint paint); RectangleInsets getPadding(); void setPadding(RectangleInsets padding); TextTitle getTitle(); void setTitle(TextTitle title); void setTitle(String text); void addLegend(LegendTitle legend); LegendTitle getLegend(); LegendTitle getLegend(int index); void removeLegend(); List<Title> getSubtitles(); void setSubtitles(List<? extends Title> subtitles); int getSubtitleCount(); Title getSubtitle(int index); void addSubtitle(Title subtitle); void addSubtitle(int index, Title subtitle); void clearSubtitles(); void removeSubtitle(Title title); Plot getPlot(); boolean getAntiAlias(); void setAntiAlias(boolean flag); Object getTextAntiAlias(); void setTextAntiAlias(boolean flag); void setTextAntiAlias(Object val); Paint getBackgroundPaint(); void setBackgroundPaint(Paint paint); Image getBackgroundImage(); void setBackgroundImage(Image image); int getBackgroundImageAlignment(); void setBackgroundImageAlignment(int alignment); float getBackgroundImageAlpha(); void setBackgroundImageAlpha(float alpha); boolean isNotify(); void setNotify(boolean notify); @Override void draw(Graphics2D g2, Rectangle2D area); void draw(Graphics2D g2, Rectangle2D area, ChartRenderingInfo info); void draw(Graphics2D g2, Rectangle2D chartArea, Point2D anchor,
                     ChartRenderingInfo info); BufferedImage createBufferedImage(int width, int height); BufferedImage createBufferedImage(int width, int height,
                                             ChartRenderingInfo info); BufferedImage createBufferedImage(int width, int height,
                                             int imageType,
                                             ChartRenderingInfo info); BufferedImage createBufferedImage(int imageWidth,
                                             int imageHeight,
                                             double drawWidth,
                                             double drawHeight,
                                             ChartRenderingInfo info); void handleClick(int x, int y, ChartRenderingInfo info); void addChangeListener(ChartChangeListener listener); void removeChangeListener(ChartChangeListener listener); void fireChartChanged(); void addProgressListener(ChartProgressListener listener); void removeProgressListener(ChartProgressListener listener); @Override void titleChanged(TitleChangeEvent event); @Override void plotChanged(PlotChangeEvent event); @Override boolean equals(Object obj); @Override Object clone(); }
JFreeChart implements Drawable, TitleChangeListener,
        PlotChangeListener, Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof JFreeChart)) { return false; } JFreeChart that = (JFreeChart) obj; if (!this.renderingHints.equals(that.renderingHints)) { return false; } if (this.borderVisible != that.borderVisible) { return false; } if (!ObjectUtilities.equal(this.borderStroke, that.borderStroke)) { return false; } if (!PaintUtilities.equal(this.borderPaint, that.borderPaint)) { return false; } if (!this.padding.equals(that.padding)) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!ObjectUtilities.equal(this.subtitles, that.subtitles)) { return false; } if (!ObjectUtilities.equal(this.plot, that.plot)) { return false; } if (!PaintUtilities.equal( this.backgroundPaint, that.backgroundPaint )) { return false; } if (!ObjectUtilities.equal(this.backgroundImage, that.backgroundImage)) { return false; } if (this.backgroundImageAlignment != that.backgroundImageAlignment) { return false; } if (this.backgroundImageAlpha != that.backgroundImageAlpha) { return false; } if (this.notify != that.notify) { return false; } return true; } JFreeChart(Plot plot);  JFreeChart(String title, Plot plot);  JFreeChart(String title, Font titleFont, Plot plot,
                      boolean createLegend); RenderingHints getRenderingHints(); void setRenderingHints(RenderingHints hints); boolean isBorderVisible(); void setBorderVisible(boolean visible); Stroke getBorderStroke(); void setBorderStroke(Stroke stroke); Paint getBorderPaint(); void setBorderPaint(Paint paint); RectangleInsets getPadding(); void setPadding(RectangleInsets padding); TextTitle getTitle(); void setTitle(TextTitle title); void setTitle(String text); void addLegend(LegendTitle legend); LegendTitle getLegend(); LegendTitle getLegend(int index); void removeLegend(); List<Title> getSubtitles(); void setSubtitles(List<? extends Title> subtitles); int getSubtitleCount(); Title getSubtitle(int index); void addSubtitle(Title subtitle); void addSubtitle(int index, Title subtitle); void clearSubtitles(); void removeSubtitle(Title title); Plot getPlot(); boolean getAntiAlias(); void setAntiAlias(boolean flag); Object getTextAntiAlias(); void setTextAntiAlias(boolean flag); void setTextAntiAlias(Object val); Paint getBackgroundPaint(); void setBackgroundPaint(Paint paint); Image getBackgroundImage(); void setBackgroundImage(Image image); int getBackgroundImageAlignment(); void setBackgroundImageAlignment(int alignment); float getBackgroundImageAlpha(); void setBackgroundImageAlpha(float alpha); boolean isNotify(); void setNotify(boolean notify); @Override void draw(Graphics2D g2, Rectangle2D area); void draw(Graphics2D g2, Rectangle2D area, ChartRenderingInfo info); void draw(Graphics2D g2, Rectangle2D chartArea, Point2D anchor,
                     ChartRenderingInfo info); BufferedImage createBufferedImage(int width, int height); BufferedImage createBufferedImage(int width, int height,
                                             ChartRenderingInfo info); BufferedImage createBufferedImage(int width, int height,
                                             int imageType,
                                             ChartRenderingInfo info); BufferedImage createBufferedImage(int imageWidth,
                                             int imageHeight,
                                             double drawWidth,
                                             double drawHeight,
                                             ChartRenderingInfo info); void handleClick(int x, int y, ChartRenderingInfo info); void addChangeListener(ChartChangeListener listener); void removeChangeListener(ChartChangeListener listener); void fireChartChanged(); void addProgressListener(ChartProgressListener listener); void removeProgressListener(ChartProgressListener listener); @Override void titleChanged(TitleChangeEvent event); @Override void plotChanged(PlotChangeEvent event); @Override boolean equals(Object obj); @Override Object clone(); static final Font DEFAULT_TITLE_FONT; static final Paint DEFAULT_BACKGROUND_PAINT; static final Image DEFAULT_BACKGROUND_IMAGE; static final int DEFAULT_BACKGROUND_IMAGE_ALIGNMENT; static final float DEFAULT_BACKGROUND_IMAGE_ALPHA; static final RenderingHints.Key KEY_SUPPRESS_SHADOW_GENERATION; }