@Test public void testEquals() { DialPlot p1 = new DialPlot(); DialPlot p2 = new DialPlot(); assertEquals(p1, p2); p1.setBackground(new DialBackground(Color.green)); assertFalse(p1.equals(p2)); p2.setBackground(new DialBackground(Color.green)); assertEquals(p1, p2); p1.setBackground(null); assertFalse(p1.equals(p2)); p2.setBackground(null); assertEquals(p1, p2); DialCap cap1 = new DialCap(); cap1.setFillPaint(Color.RED); p1.setCap(cap1); assertFalse(p1.equals(p2)); DialCap cap2 = new DialCap(); cap2.setFillPaint(Color.RED); p2.setCap(cap2); assertEquals(p1, p2); p1.setCap(null); assertFalse(p1.equals(p2)); p2.setCap(null); assertEquals(p1, p2); StandardDialFrame f1 = new StandardDialFrame(); f1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.WHITE)); p1.setDialFrame(f1); assertFalse(p1.equals(p2)); StandardDialFrame f2 = new StandardDialFrame(); f2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.WHITE)); p2.setDialFrame(f2); assertEquals(p1, p2); p1.setView(0.2, 0.0, 0.8, 1.0); assertFalse(p1.equals(p2)); p2.setView(0.2, 0.0, 0.8, 1.0); assertEquals(p1, p2); p1.addLayer(new StandardDialScale()); assertFalse(p1.equals(p2)); p2.addLayer(new StandardDialScale()); assertEquals(p1, p2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DialPlot)) { return false; } DialPlot that = (DialPlot) obj; if (!ObjectUtilities.equal(this.background, that.background)) { return false; } if (!ObjectUtilities.equal(this.cap, that.cap)) { return false; } if (!this.dialFrame.equals(that.dialFrame)) { return false; } if (this.viewX != that.viewX) { return false; } if (this.viewY != that.viewY) { return false; } if (this.viewW != that.viewW) { return false; } if (this.viewH != that.viewH) { return false; } if (!this.layers.equals(that.layers)) { return false; } if (!this.pointers.equals(that.pointers)) { return false; } return super.equals(obj); }
DialPlot extends Plot implements DialLayerChangeListener { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DialPlot)) { return false; } DialPlot that = (DialPlot) obj; if (!ObjectUtilities.equal(this.background, that.background)) { return false; } if (!ObjectUtilities.equal(this.cap, that.cap)) { return false; } if (!this.dialFrame.equals(that.dialFrame)) { return false; } if (this.viewX != that.viewX) { return false; } if (this.viewY != that.viewY) { return false; } if (this.viewW != that.viewW) { return false; } if (this.viewH != that.viewH) { return false; } if (!this.layers.equals(that.layers)) { return false; } if (!this.pointers.equals(that.pointers)) { return false; } return super.equals(obj); } }
DialPlot extends Plot implements DialLayerChangeListener { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DialPlot)) { return false; } DialPlot that = (DialPlot) obj; if (!ObjectUtilities.equal(this.background, that.background)) { return false; } if (!ObjectUtilities.equal(this.cap, that.cap)) { return false; } if (!this.dialFrame.equals(that.dialFrame)) { return false; } if (this.viewX != that.viewX) { return false; } if (this.viewY != that.viewY) { return false; } if (this.viewW != that.viewW) { return false; } if (this.viewH != that.viewH) { return false; } if (!this.layers.equals(that.layers)) { return false; } if (!this.pointers.equals(that.pointers)) { return false; } return super.equals(obj); } DialPlot();  DialPlot(ValueDataset dataset); }
DialPlot extends Plot implements DialLayerChangeListener { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DialPlot)) { return false; } DialPlot that = (DialPlot) obj; if (!ObjectUtilities.equal(this.background, that.background)) { return false; } if (!ObjectUtilities.equal(this.cap, that.cap)) { return false; } if (!this.dialFrame.equals(that.dialFrame)) { return false; } if (this.viewX != that.viewX) { return false; } if (this.viewY != that.viewY) { return false; } if (this.viewW != that.viewW) { return false; } if (this.viewH != that.viewH) { return false; } if (!this.layers.equals(that.layers)) { return false; } if (!this.pointers.equals(that.pointers)) { return false; } return super.equals(obj); } DialPlot();  DialPlot(ValueDataset dataset); DialLayer getBackground(); void setBackground(DialLayer background); DialLayer getCap(); void setCap(DialLayer cap); DialFrame getDialFrame(); void setDialFrame(DialFrame frame); double getViewX(); double getViewY(); double getViewWidth(); double getViewHeight(); void setView(double x, double y, double w, double h); void addLayer(DialLayer layer); int getLayerIndex(DialLayer layer); void removeLayer(int index); void removeLayer(DialLayer layer); void addPointer(DialPointer pointer); int getPointerIndex(DialPointer pointer); void removePointer(int index); void removePointer(DialPointer pointer); DialPointer getPointerForDataset(int datasetIndex); ValueDataset getDataset(); ValueDataset getDataset(int index); void setDataset(ValueDataset dataset); void setDataset(int index, ValueDataset dataset); int getDatasetCount(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); double getValue(int datasetIndex); void addScale(int index, DialScale scale); DialScale getScale(int index); void mapDatasetToScale(int index, int scaleIndex); DialScale getScaleForDataset(int datasetIndex); static Rectangle2D rectangleByRadius(Rectangle2D rect,
            double radiusW, double radiusH); @Override void dialLayerChanged(DialLayerChangeEvent event); @Override boolean equals(Object obj); @Override int hashCode(); @Override String getPlotType(); }
DialPlot extends Plot implements DialLayerChangeListener { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DialPlot)) { return false; } DialPlot that = (DialPlot) obj; if (!ObjectUtilities.equal(this.background, that.background)) { return false; } if (!ObjectUtilities.equal(this.cap, that.cap)) { return false; } if (!this.dialFrame.equals(that.dialFrame)) { return false; } if (this.viewX != that.viewX) { return false; } if (this.viewY != that.viewY) { return false; } if (this.viewW != that.viewW) { return false; } if (this.viewH != that.viewH) { return false; } if (!this.layers.equals(that.layers)) { return false; } if (!this.pointers.equals(that.pointers)) { return false; } return super.equals(obj); } DialPlot();  DialPlot(ValueDataset dataset); DialLayer getBackground(); void setBackground(DialLayer background); DialLayer getCap(); void setCap(DialLayer cap); DialFrame getDialFrame(); void setDialFrame(DialFrame frame); double getViewX(); double getViewY(); double getViewWidth(); double getViewHeight(); void setView(double x, double y, double w, double h); void addLayer(DialLayer layer); int getLayerIndex(DialLayer layer); void removeLayer(int index); void removeLayer(DialLayer layer); void addPointer(DialPointer pointer); int getPointerIndex(DialPointer pointer); void removePointer(int index); void removePointer(DialPointer pointer); DialPointer getPointerForDataset(int datasetIndex); ValueDataset getDataset(); ValueDataset getDataset(int index); void setDataset(ValueDataset dataset); void setDataset(int index, ValueDataset dataset); int getDatasetCount(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); double getValue(int datasetIndex); void addScale(int index, DialScale scale); DialScale getScale(int index); void mapDatasetToScale(int index, int scaleIndex); DialScale getScaleForDataset(int datasetIndex); static Rectangle2D rectangleByRadius(Rectangle2D rect,
            double radiusW, double radiusH); @Override void dialLayerChanged(DialLayerChangeEvent event); @Override boolean equals(Object obj); @Override int hashCode(); @Override String getPlotType();  }