@Test public void testEquals() { MeterPlot plot1 = new MeterPlot(); MeterPlot plot2 = new MeterPlot(); assertEquals(plot1, plot2); plot1.setUnits("mph"); assertFalse(plot1.equals(plot2)); plot2.setUnits("mph"); assertEquals(plot1, plot2); plot1.setRange(new Range(50.0, 70.0)); assertFalse(plot1.equals(plot2)); plot2.setRange(new Range(50.0, 70.0)); assertEquals(plot1, plot2); plot1.addInterval(new MeterInterval("Normal", new Range(55.0, 60.0))); assertFalse(plot1.equals(plot2)); plot2.addInterval(new MeterInterval("Normal", new Range(55.0, 60.0))); assertEquals(plot1, plot2); plot1.setDialOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertFalse(plot1.equals(plot2)); plot2.setDialOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertEquals(plot1, plot2); plot1.setDialShape(DialShape.CHORD); assertFalse(plot1.equals(plot2)); plot2.setDialShape(DialShape.CHORD); assertEquals(plot1, plot2); plot1.setDialBackgroundPaint(new GradientPaint(9.0f, 8.0f, Color.RED, 7.0f, 6.0f, Color.BLUE)); assertFalse(plot1.equals(plot2)); plot2.setDialBackgroundPaint(new GradientPaint(9.0f, 8.0f, Color.RED, 7.0f, 6.0f, Color.BLUE)); assertEquals(plot1, plot2); plot1.setDialOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.green, 3.0f, 4.0f, Color.RED)); assertFalse(plot1.equals(plot2)); plot2.setDialOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.green, 3.0f, 4.0f, Color.RED)); assertEquals(plot1, plot2); plot1.setNeedlePaint(new GradientPaint(9.0f, 8.0f, Color.RED, 7.0f, 6.0f, Color.BLUE)); assertFalse(plot1.equals(plot2)); plot2.setNeedlePaint(new GradientPaint(9.0f, 8.0f, Color.RED, 7.0f, 6.0f, Color.BLUE)); assertEquals(plot1, plot2); plot1.setValueFont(new Font("Serif", Font.PLAIN, 6)); assertFalse(plot1.equals(plot2)); plot2.setValueFont(new Font("Serif", Font.PLAIN, 6)); assertEquals(plot1, plot2); plot1.setValuePaint(new GradientPaint(1.0f, 2.0f, Color.BLACK, 3.0f, 4.0f, Color.WHITE)); assertFalse(plot1.equals(plot2)); plot2.setValuePaint(new GradientPaint(1.0f, 2.0f, Color.BLACK, 3.0f, 4.0f, Color.WHITE)); assertEquals(plot1, plot2); plot1.setTickLabelsVisible(false); assertFalse(plot1.equals(plot2)); plot2.setTickLabelsVisible(false); assertEquals(plot1, plot2); plot1.setTickLabelFont(new Font("Serif", Font.PLAIN, 6)); assertFalse(plot1.equals(plot2)); plot2.setTickLabelFont(new Font("Serif", Font.PLAIN, 6)); assertEquals(plot1, plot2); plot1.setTickLabelPaint(Color.RED); assertFalse(plot1.equals(plot2)); plot2.setTickLabelPaint(Color.RED); assertEquals(plot1, plot2); plot1.setTickLabelFormat(new DecimalFormat("0")); assertFalse(plot1.equals(plot2)); plot2.setTickLabelFormat(new DecimalFormat("0")); assertEquals(plot1, plot2); plot1.setTickPaint(Color.green); assertFalse(plot1.equals(plot2)); plot2.setTickPaint(Color.green); assertEquals(plot1, plot2); plot1.setTickSize(1.23); assertFalse(plot1.equals(plot2)); plot2.setTickSize(1.23); assertEquals(plot1, plot2); plot1.setDrawBorder(!plot1.getDrawBorder()); assertFalse(plot1.equals(plot2)); plot2.setDrawBorder(plot1.getDrawBorder()); assertEquals(plot1, plot2); plot1.setMeterAngle(22); assertFalse(plot1.equals(plot2)); plot2.setMeterAngle(22); assertEquals(plot1, plot2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MeterPlot)) { return false; } if (!super.equals(obj)) { return false; } MeterPlot that = (MeterPlot) obj; if (!ObjectUtilities.equal(this.units, that.units)) { return false; } if (!ObjectUtilities.equal(this.range, that.range)) { return false; } if (!ObjectUtilities.equal(this.intervals, that.intervals)) { return false; } if (!PaintUtilities.equal(this.dialOutlinePaint, that.dialOutlinePaint)) { return false; } if (this.shape != that.shape) { return false; } if (!PaintUtilities.equal(this.dialBackgroundPaint, that.dialBackgroundPaint)) { return false; } if (!PaintUtilities.equal(this.needlePaint, that.needlePaint)) { return false; } if (!ObjectUtilities.equal(this.valueFont, that.valueFont)) { return false; } if (!PaintUtilities.equal(this.valuePaint, that.valuePaint)) { return false; } if (!PaintUtilities.equal(this.tickPaint, that.tickPaint)) { return false; } if (this.tickSize != that.tickSize) { return false; } if (this.tickLabelsVisible != that.tickLabelsVisible) { return false; } if (!ObjectUtilities.equal(this.tickLabelFont, that.tickLabelFont)) { return false; } if (!PaintUtilities.equal(this.tickLabelPaint, that.tickLabelPaint)) { return false; } if (!ObjectUtilities.equal(this.tickLabelFormat, that.tickLabelFormat)) { return false; } if (this.drawBorder != that.drawBorder) { return false; } if (this.meterAngle != that.meterAngle) { return false; } return true; }
MeterPlot extends Plot implements Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MeterPlot)) { return false; } if (!super.equals(obj)) { return false; } MeterPlot that = (MeterPlot) obj; if (!ObjectUtilities.equal(this.units, that.units)) { return false; } if (!ObjectUtilities.equal(this.range, that.range)) { return false; } if (!ObjectUtilities.equal(this.intervals, that.intervals)) { return false; } if (!PaintUtilities.equal(this.dialOutlinePaint, that.dialOutlinePaint)) { return false; } if (this.shape != that.shape) { return false; } if (!PaintUtilities.equal(this.dialBackgroundPaint, that.dialBackgroundPaint)) { return false; } if (!PaintUtilities.equal(this.needlePaint, that.needlePaint)) { return false; } if (!ObjectUtilities.equal(this.valueFont, that.valueFont)) { return false; } if (!PaintUtilities.equal(this.valuePaint, that.valuePaint)) { return false; } if (!PaintUtilities.equal(this.tickPaint, that.tickPaint)) { return false; } if (this.tickSize != that.tickSize) { return false; } if (this.tickLabelsVisible != that.tickLabelsVisible) { return false; } if (!ObjectUtilities.equal(this.tickLabelFont, that.tickLabelFont)) { return false; } if (!PaintUtilities.equal(this.tickLabelPaint, that.tickLabelPaint)) { return false; } if (!ObjectUtilities.equal(this.tickLabelFormat, that.tickLabelFormat)) { return false; } if (this.drawBorder != that.drawBorder) { return false; } if (this.meterAngle != that.meterAngle) { return false; } return true; } }
MeterPlot extends Plot implements Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MeterPlot)) { return false; } if (!super.equals(obj)) { return false; } MeterPlot that = (MeterPlot) obj; if (!ObjectUtilities.equal(this.units, that.units)) { return false; } if (!ObjectUtilities.equal(this.range, that.range)) { return false; } if (!ObjectUtilities.equal(this.intervals, that.intervals)) { return false; } if (!PaintUtilities.equal(this.dialOutlinePaint, that.dialOutlinePaint)) { return false; } if (this.shape != that.shape) { return false; } if (!PaintUtilities.equal(this.dialBackgroundPaint, that.dialBackgroundPaint)) { return false; } if (!PaintUtilities.equal(this.needlePaint, that.needlePaint)) { return false; } if (!ObjectUtilities.equal(this.valueFont, that.valueFont)) { return false; } if (!PaintUtilities.equal(this.valuePaint, that.valuePaint)) { return false; } if (!PaintUtilities.equal(this.tickPaint, that.tickPaint)) { return false; } if (this.tickSize != that.tickSize) { return false; } if (this.tickLabelsVisible != that.tickLabelsVisible) { return false; } if (!ObjectUtilities.equal(this.tickLabelFont, that.tickLabelFont)) { return false; } if (!PaintUtilities.equal(this.tickLabelPaint, that.tickLabelPaint)) { return false; } if (!ObjectUtilities.equal(this.tickLabelFormat, that.tickLabelFormat)) { return false; } if (this.drawBorder != that.drawBorder) { return false; } if (this.meterAngle != that.meterAngle) { return false; } return true; } MeterPlot();  MeterPlot(ValueDataset dataset); }
MeterPlot extends Plot implements Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MeterPlot)) { return false; } if (!super.equals(obj)) { return false; } MeterPlot that = (MeterPlot) obj; if (!ObjectUtilities.equal(this.units, that.units)) { return false; } if (!ObjectUtilities.equal(this.range, that.range)) { return false; } if (!ObjectUtilities.equal(this.intervals, that.intervals)) { return false; } if (!PaintUtilities.equal(this.dialOutlinePaint, that.dialOutlinePaint)) { return false; } if (this.shape != that.shape) { return false; } if (!PaintUtilities.equal(this.dialBackgroundPaint, that.dialBackgroundPaint)) { return false; } if (!PaintUtilities.equal(this.needlePaint, that.needlePaint)) { return false; } if (!ObjectUtilities.equal(this.valueFont, that.valueFont)) { return false; } if (!PaintUtilities.equal(this.valuePaint, that.valuePaint)) { return false; } if (!PaintUtilities.equal(this.tickPaint, that.tickPaint)) { return false; } if (this.tickSize != that.tickSize) { return false; } if (this.tickLabelsVisible != that.tickLabelsVisible) { return false; } if (!ObjectUtilities.equal(this.tickLabelFont, that.tickLabelFont)) { return false; } if (!PaintUtilities.equal(this.tickLabelPaint, that.tickLabelPaint)) { return false; } if (!ObjectUtilities.equal(this.tickLabelFormat, that.tickLabelFormat)) { return false; } if (this.drawBorder != that.drawBorder) { return false; } if (this.meterAngle != that.meterAngle) { return false; } return true; } MeterPlot();  MeterPlot(ValueDataset dataset); DialShape getDialShape(); void setDialShape(DialShape shape); int getMeterAngle(); void setMeterAngle(int angle); Range getRange(); void setRange(Range range); double getTickSize(); void setTickSize(double size); Paint getTickPaint(); void setTickPaint(Paint paint); String getUnits(); void setUnits(String units); Paint getNeedlePaint(); void setNeedlePaint(Paint paint); boolean getTickLabelsVisible(); void setTickLabelsVisible(boolean visible); Font getTickLabelFont(); void setTickLabelFont(Font font); Paint getTickLabelPaint(); void setTickLabelPaint(Paint paint); NumberFormat getTickLabelFormat(); void setTickLabelFormat(NumberFormat format); Font getValueFont(); void setValueFont(Font font); Paint getValuePaint(); void setValuePaint(Paint paint); Paint getDialBackgroundPaint(); void setDialBackgroundPaint(Paint paint); boolean getDrawBorder(); void setDrawBorder(boolean draw); Paint getDialOutlinePaint(); void setDialOutlinePaint(Paint paint); ValueDataset getDataset(); void setDataset(ValueDataset dataset); List<MeterInterval> getIntervals(); void addInterval(MeterInterval interval); void clearIntervals(); @Override List<LegendItem> getLegendItems(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
                     PlotState parentState,
                     PlotRenderingInfo info); double valueToAngle(double value); @Override String getPlotType(); @Override void zoom(double percent); @Override boolean equals(Object obj); @Override Object clone(); }
MeterPlot extends Plot implements Serializable, Cloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MeterPlot)) { return false; } if (!super.equals(obj)) { return false; } MeterPlot that = (MeterPlot) obj; if (!ObjectUtilities.equal(this.units, that.units)) { return false; } if (!ObjectUtilities.equal(this.range, that.range)) { return false; } if (!ObjectUtilities.equal(this.intervals, that.intervals)) { return false; } if (!PaintUtilities.equal(this.dialOutlinePaint, that.dialOutlinePaint)) { return false; } if (this.shape != that.shape) { return false; } if (!PaintUtilities.equal(this.dialBackgroundPaint, that.dialBackgroundPaint)) { return false; } if (!PaintUtilities.equal(this.needlePaint, that.needlePaint)) { return false; } if (!ObjectUtilities.equal(this.valueFont, that.valueFont)) { return false; } if (!PaintUtilities.equal(this.valuePaint, that.valuePaint)) { return false; } if (!PaintUtilities.equal(this.tickPaint, that.tickPaint)) { return false; } if (this.tickSize != that.tickSize) { return false; } if (this.tickLabelsVisible != that.tickLabelsVisible) { return false; } if (!ObjectUtilities.equal(this.tickLabelFont, that.tickLabelFont)) { return false; } if (!PaintUtilities.equal(this.tickLabelPaint, that.tickLabelPaint)) { return false; } if (!ObjectUtilities.equal(this.tickLabelFormat, that.tickLabelFormat)) { return false; } if (this.drawBorder != that.drawBorder) { return false; } if (this.meterAngle != that.meterAngle) { return false; } return true; } MeterPlot();  MeterPlot(ValueDataset dataset); DialShape getDialShape(); void setDialShape(DialShape shape); int getMeterAngle(); void setMeterAngle(int angle); Range getRange(); void setRange(Range range); double getTickSize(); void setTickSize(double size); Paint getTickPaint(); void setTickPaint(Paint paint); String getUnits(); void setUnits(String units); Paint getNeedlePaint(); void setNeedlePaint(Paint paint); boolean getTickLabelsVisible(); void setTickLabelsVisible(boolean visible); Font getTickLabelFont(); void setTickLabelFont(Font font); Paint getTickLabelPaint(); void setTickLabelPaint(Paint paint); NumberFormat getTickLabelFormat(); void setTickLabelFormat(NumberFormat format); Font getValueFont(); void setValueFont(Font font); Paint getValuePaint(); void setValuePaint(Paint paint); Paint getDialBackgroundPaint(); void setDialBackgroundPaint(Paint paint); boolean getDrawBorder(); void setDrawBorder(boolean draw); Paint getDialOutlinePaint(); void setDialOutlinePaint(Paint paint); ValueDataset getDataset(); void setDataset(ValueDataset dataset); List<MeterInterval> getIntervals(); void addInterval(MeterInterval interval); void clearIntervals(); @Override List<LegendItem> getLegendItems(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
                     PlotState parentState,
                     PlotRenderingInfo info); double valueToAngle(double value); @Override String getPlotType(); @Override void zoom(double percent); @Override boolean equals(Object obj); @Override Object clone(); static final int DEFAULT_METER_ANGLE; static final float DEFAULT_BORDER_SIZE; static final float DEFAULT_CIRCLE_SIZE; static final Font DEFAULT_LABEL_FONT; }