@Test public void testEquals() { PaintScaleLegend l1 = new PaintScaleLegend(new GrayPaintScale(), new NumberAxis("X")); PaintScaleLegend l2 = new PaintScaleLegend(new GrayPaintScale(), new NumberAxis("X")); assertEquals(l1, l2); assertEquals(l2, l1); l1.setScale(new LookupPaintScale()); assertFalse(l1.equals(l2)); l2.setScale(new LookupPaintScale()); assertEquals(l1, l2); l1.setAxis(new NumberAxis("Axis 2")); assertFalse(l1.equals(l2)); l2.setAxis(new NumberAxis("Axis 2")); assertEquals(l1, l2); l1.setAxisLocation(AxisLocation.BOTTOM_OR_RIGHT); assertFalse(l1.equals(l2)); l2.setAxisLocation(AxisLocation.BOTTOM_OR_RIGHT); assertEquals(l1, l2); l1.setAxisOffset(99.0); assertFalse(l1.equals(l2)); l2.setAxisOffset(99.0); assertEquals(l1, l2); l1.setStripWidth(99.0); assertFalse(l1.equals(l2)); l2.setStripWidth(99.0); assertEquals(l1, l2); l1.setStripOutlineVisible(!l1.isStripOutlineVisible()); assertFalse(l1.equals(l2)); l2.setStripOutlineVisible(l1.isStripOutlineVisible()); assertEquals(l1, l2); l1.setStripOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertFalse(l1.equals(l2)); l2.setStripOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertEquals(l1, l2); l1.setStripOutlineStroke(new BasicStroke(1.1f)); assertFalse(l1.equals(l2)); l2.setStripOutlineStroke(new BasicStroke(1.1f)); assertEquals(l1, l2); l1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertFalse(l1.equals(l2)); l2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertEquals(l1, l2); l1.setSubdivisionCount(99); assertFalse(l1.equals(l2)); l2.setSubdivisionCount(99); assertEquals(l1, l2); }
@Override public boolean equals(Object obj) { if (!(obj instanceof PaintScaleLegend)) { return false; } PaintScaleLegend that = (PaintScaleLegend) obj; if (!this.scale.equals(that.scale)) { return false; } if (!this.axis.equals(that.axis)) { return false; } if (!this.axisLocation.equals(that.axisLocation)) { return false; } if (this.axisOffset != that.axisOffset) { return false; } if (this.stripWidth != that.stripWidth) { return false; } if (this.stripOutlineVisible != that.stripOutlineVisible) { return false; } if (!PaintUtilities.equal(this.stripOutlinePaint, that.stripOutlinePaint)) { return false; } if (!this.stripOutlineStroke.equals(that.stripOutlineStroke)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.subdivisions != that.subdivisions) { return false; } return super.equals(obj); }
PaintScaleLegend extends Title implements AxisChangeListener,
        PublicCloneable { @Override public boolean equals(Object obj) { if (!(obj instanceof PaintScaleLegend)) { return false; } PaintScaleLegend that = (PaintScaleLegend) obj; if (!this.scale.equals(that.scale)) { return false; } if (!this.axis.equals(that.axis)) { return false; } if (!this.axisLocation.equals(that.axisLocation)) { return false; } if (this.axisOffset != that.axisOffset) { return false; } if (this.stripWidth != that.stripWidth) { return false; } if (this.stripOutlineVisible != that.stripOutlineVisible) { return false; } if (!PaintUtilities.equal(this.stripOutlinePaint, that.stripOutlinePaint)) { return false; } if (!this.stripOutlineStroke.equals(that.stripOutlineStroke)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.subdivisions != that.subdivisions) { return false; } return super.equals(obj); } }
PaintScaleLegend extends Title implements AxisChangeListener,
        PublicCloneable { @Override public boolean equals(Object obj) { if (!(obj instanceof PaintScaleLegend)) { return false; } PaintScaleLegend that = (PaintScaleLegend) obj; if (!this.scale.equals(that.scale)) { return false; } if (!this.axis.equals(that.axis)) { return false; } if (!this.axisLocation.equals(that.axisLocation)) { return false; } if (this.axisOffset != that.axisOffset) { return false; } if (this.stripWidth != that.stripWidth) { return false; } if (this.stripOutlineVisible != that.stripOutlineVisible) { return false; } if (!PaintUtilities.equal(this.stripOutlinePaint, that.stripOutlinePaint)) { return false; } if (!this.stripOutlineStroke.equals(that.stripOutlineStroke)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.subdivisions != that.subdivisions) { return false; } return super.equals(obj); } PaintScaleLegend(PaintScale scale, ValueAxis axis); }
PaintScaleLegend extends Title implements AxisChangeListener,
        PublicCloneable { @Override public boolean equals(Object obj) { if (!(obj instanceof PaintScaleLegend)) { return false; } PaintScaleLegend that = (PaintScaleLegend) obj; if (!this.scale.equals(that.scale)) { return false; } if (!this.axis.equals(that.axis)) { return false; } if (!this.axisLocation.equals(that.axisLocation)) { return false; } if (this.axisOffset != that.axisOffset) { return false; } if (this.stripWidth != that.stripWidth) { return false; } if (this.stripOutlineVisible != that.stripOutlineVisible) { return false; } if (!PaintUtilities.equal(this.stripOutlinePaint, that.stripOutlinePaint)) { return false; } if (!this.stripOutlineStroke.equals(that.stripOutlineStroke)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.subdivisions != that.subdivisions) { return false; } return super.equals(obj); } PaintScaleLegend(PaintScale scale, ValueAxis axis); PaintScale getScale(); void setScale(PaintScale scale); ValueAxis getAxis(); void setAxis(ValueAxis axis); AxisLocation getAxisLocation(); void setAxisLocation(AxisLocation location); double getAxisOffset(); void setAxisOffset(double offset); double getStripWidth(); void setStripWidth(double width); boolean isStripOutlineVisible(); void setStripOutlineVisible(boolean visible); Paint getStripOutlinePaint(); void setStripOutlinePaint(Paint paint); Stroke getStripOutlineStroke(); void setStripOutlineStroke(Stroke stroke); Paint getBackgroundPaint(); void setBackgroundPaint(Paint paint); int getSubdivisionCount(); void setSubdivisionCount(int count); @Override void axisChanged(AxisChangeEvent event); @Override Size2D arrange(Graphics2D g2, RectangleConstraint constraint); @Override void draw(Graphics2D g2, Rectangle2D area); @Override Object draw(Graphics2D g2, Rectangle2D area, Object params); @Override boolean equals(Object obj); }
PaintScaleLegend extends Title implements AxisChangeListener,
        PublicCloneable { @Override public boolean equals(Object obj) { if (!(obj instanceof PaintScaleLegend)) { return false; } PaintScaleLegend that = (PaintScaleLegend) obj; if (!this.scale.equals(that.scale)) { return false; } if (!this.axis.equals(that.axis)) { return false; } if (!this.axisLocation.equals(that.axisLocation)) { return false; } if (this.axisOffset != that.axisOffset) { return false; } if (this.stripWidth != that.stripWidth) { return false; } if (this.stripOutlineVisible != that.stripOutlineVisible) { return false; } if (!PaintUtilities.equal(this.stripOutlinePaint, that.stripOutlinePaint)) { return false; } if (!this.stripOutlineStroke.equals(that.stripOutlineStroke)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.subdivisions != that.subdivisions) { return false; } return super.equals(obj); } PaintScaleLegend(PaintScale scale, ValueAxis axis); PaintScale getScale(); void setScale(PaintScale scale); ValueAxis getAxis(); void setAxis(ValueAxis axis); AxisLocation getAxisLocation(); void setAxisLocation(AxisLocation location); double getAxisOffset(); void setAxisOffset(double offset); double getStripWidth(); void setStripWidth(double width); boolean isStripOutlineVisible(); void setStripOutlineVisible(boolean visible); Paint getStripOutlinePaint(); void setStripOutlinePaint(Paint paint); Stroke getStripOutlineStroke(); void setStripOutlineStroke(Stroke stroke); Paint getBackgroundPaint(); void setBackgroundPaint(Paint paint); int getSubdivisionCount(); void setSubdivisionCount(int count); @Override void axisChanged(AxisChangeEvent event); @Override Size2D arrange(Graphics2D g2, RectangleConstraint constraint); @Override void draw(Graphics2D g2, Rectangle2D area); @Override Object draw(Graphics2D g2, Rectangle2D area, Object params); @Override boolean equals(Object obj);  }