@Test public void testEquals() { Axis a1 = new CategoryAxis("Test"); Axis a2 = new CategoryAxis("Test"); assertEquals(a1, a2); a1.setVisible(false); assertThat(a1, not(a2)); a2.setVisible(false); assertEquals(a1, a2); a1.setLabel("New Label"); assertThat(a1, not(a2)); a2.setLabel("New Label"); assertEquals(a1, a2); a1.setLabelFont(new Font("Dialog", Font.PLAIN, 8)); assertThat(a1, not(a2)); a2.setLabelFont(new Font("Dialog", Font.PLAIN, 8)); assertEquals(a1, a2); a1.setLabelPaint(new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.BLACK)); assertThat(a1, not(a2)); a2.setLabelPaint(new GradientPaint(1.0f, 2.0f, Color.WHITE, 3.0f, 4.0f, Color.BLACK)); assertEquals(a1, a2); a1.setLabel(new AttributedString("Hello World!")); assertThat(a1, not(a2)); a2.setLabel(new AttributedString("Hello World!")); assertEquals(a1, a2); AttributedString l1 = a1.getLabel(); l1.addAttribute(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUB, 1, 2); a1.setLabel(l1); assertThat(a1, not(a2)); AttributedString l2 = a2.getLabel(); l2.addAttribute(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUB, 1, 2); a2.setLabel(l2); assertEquals(a1, a2); a1.setLabelInsets(new RectangleInsets(10.0, 10.0, 10.0, 10.0)); assertThat(a1, not(a2)); a2.setLabelInsets(new RectangleInsets(10.0, 10.0, 10.0, 10.0)); assertEquals(a1, a2); a1.setLabelAngle(1.23); assertThat(a1, not(a2)); a2.setLabelAngle(1.23); assertEquals(a1, a2); a1.setLabelLocation(AxisLabelLocation.HIGH_END); assertThat(a1, not(a2)); a2.setLabelLocation(AxisLabelLocation.HIGH_END); assertEquals(a1, a2); a1.setAxisLineVisible(false); assertThat(a1, not(a2)); a2.setAxisLineVisible(false); assertEquals(a1, a2); BasicStroke s = new BasicStroke(1.1f); a1.setAxisLineStroke(s); assertThat(a1, not(a2)); a2.setAxisLineStroke(s); assertEquals(a1, a2); a1.setAxisLinePaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLACK)); assertThat(a1, not(a2)); a2.setAxisLinePaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLACK)); assertEquals(a1, a2); a1.setTickLabelsVisible(false); assertThat(a1, not(a2)); a2.setTickLabelsVisible(false); assertEquals(a1, a2); a1.setTickLabelFont(new Font("Dialog", Font.PLAIN, 12)); assertThat(a1, not(a2)); a2.setTickLabelFont(new Font("Dialog", Font.PLAIN, 12)); assertEquals(a1, a2); a1.setTickLabelPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.BLACK)); assertThat(a1, not(a2)); a2.setTickLabelPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.BLACK)); assertEquals(a1, a2); a1.setTickLabelInsets(new RectangleInsets(10.0, 10.0, 10.0, 10.0)); assertThat(a1, not(a2)); a2.setTickLabelInsets(new RectangleInsets(10.0, 10.0, 10.0, 10.0)); assertEquals(a1, a2); a1.setTickMarksVisible(false); assertThat(a1, not(a2)); a2.setTickMarksVisible(false); assertEquals(a1, a2); a1.setTickMarkInsideLength(1.23f); assertThat(a1, not(a2)); a2.setTickMarkInsideLength(1.23f); assertEquals(a1, a2); a1.setTickMarkOutsideLength(1.23f); assertThat(a1, not(a2)); a2.setTickMarkOutsideLength(1.23f); assertEquals(a1, a2); a1.setTickMarkStroke(new BasicStroke(2.0f)); assertThat(a1, not(a2)); a2.setTickMarkStroke(new BasicStroke(2.0f)); assertEquals(a1, a2); a1.setTickMarkPaint(new GradientPaint(1.0f, 2.0f, Color.cyan, 3.0f, 4.0f, Color.BLACK)); assertThat(a1, not(a2)); a2.setTickMarkPaint(new GradientPaint(1.0f, 2.0f, Color.cyan, 3.0f, 4.0f, Color.BLACK)); assertEquals(a1, a2); a1.setFixedDimension(3.21f); assertThat(a1, not(a2)); a2.setFixedDimension(3.21f); assertEquals(a1, a2); a1.setMinorTickMarksVisible(true); assertThat(a1, not(a2)); a2.setMinorTickMarksVisible(true); assertEquals(a1, a2); a1.setMinorTickMarkInsideLength(1.23f); assertThat(a1, not(a2)); a2.setMinorTickMarkInsideLength(1.23f); assertEquals(a1, a2); a1.setMinorTickMarkOutsideLength(3.21f); assertThat(a1, not(a2)); a2.setMinorTickMarkOutsideLength(3.21f); assertEquals(a1, a2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Axis)) { return false; } Axis that = (Axis) obj; if (this.visible != that.visible) { return false; } if (!AttributedStringUtilities.equal(this.label, that.label)) { return false; } if (!ObjectUtilities.equal(this.labelFont, that.labelFont)) { return false; } if (!PaintUtilities.equal(this.labelPaint, that.labelPaint)) { return false; } if (!ObjectUtilities.equal(this.labelInsets, that.labelInsets)) { return false; } if (this.labelAngle != that.labelAngle) { return false; } if (!this.labelLocation.equals(that.labelLocation)) { return false; } if (this.axisLineVisible != that.axisLineVisible) { return false; } if (!ObjectUtilities.equal(this.axisLineStroke, that.axisLineStroke)) { return false; } if (!PaintUtilities.equal(this.axisLinePaint, that.axisLinePaint)) { 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.tickLabelInsets, that.tickLabelInsets )) { return false; } if (this.tickMarksVisible != that.tickMarksVisible) { return false; } if (this.tickMarkInsideLength != that.tickMarkInsideLength) { return false; } if (this.tickMarkOutsideLength != that.tickMarkOutsideLength) { return false; } if (!PaintUtilities.equal(this.tickMarkPaint, that.tickMarkPaint)) { return false; } if (!ObjectUtilities.equal(this.tickMarkStroke, that.tickMarkStroke)) { return false; } if (this.minorTickMarksVisible != that.minorTickMarksVisible) { return false; } if (this.minorTickMarkInsideLength != that.minorTickMarkInsideLength) { return false; } if (this.minorTickMarkOutsideLength != that.minorTickMarkOutsideLength) { return false; } if (this.fixedDimension != that.fixedDimension) { return false; } return true; }
Axis implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Axis)) { return false; } Axis that = (Axis) obj; if (this.visible != that.visible) { return false; } if (!AttributedStringUtilities.equal(this.label, that.label)) { return false; } if (!ObjectUtilities.equal(this.labelFont, that.labelFont)) { return false; } if (!PaintUtilities.equal(this.labelPaint, that.labelPaint)) { return false; } if (!ObjectUtilities.equal(this.labelInsets, that.labelInsets)) { return false; } if (this.labelAngle != that.labelAngle) { return false; } if (!this.labelLocation.equals(that.labelLocation)) { return false; } if (this.axisLineVisible != that.axisLineVisible) { return false; } if (!ObjectUtilities.equal(this.axisLineStroke, that.axisLineStroke)) { return false; } if (!PaintUtilities.equal(this.axisLinePaint, that.axisLinePaint)) { 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.tickLabelInsets, that.tickLabelInsets )) { return false; } if (this.tickMarksVisible != that.tickMarksVisible) { return false; } if (this.tickMarkInsideLength != that.tickMarkInsideLength) { return false; } if (this.tickMarkOutsideLength != that.tickMarkOutsideLength) { return false; } if (!PaintUtilities.equal(this.tickMarkPaint, that.tickMarkPaint)) { return false; } if (!ObjectUtilities.equal(this.tickMarkStroke, that.tickMarkStroke)) { return false; } if (this.minorTickMarksVisible != that.minorTickMarksVisible) { return false; } if (this.minorTickMarkInsideLength != that.minorTickMarkInsideLength) { return false; } if (this.minorTickMarkOutsideLength != that.minorTickMarkOutsideLength) { return false; } if (this.fixedDimension != that.fixedDimension) { return false; } return true; } }
Axis implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Axis)) { return false; } Axis that = (Axis) obj; if (this.visible != that.visible) { return false; } if (!AttributedStringUtilities.equal(this.label, that.label)) { return false; } if (!ObjectUtilities.equal(this.labelFont, that.labelFont)) { return false; } if (!PaintUtilities.equal(this.labelPaint, that.labelPaint)) { return false; } if (!ObjectUtilities.equal(this.labelInsets, that.labelInsets)) { return false; } if (this.labelAngle != that.labelAngle) { return false; } if (!this.labelLocation.equals(that.labelLocation)) { return false; } if (this.axisLineVisible != that.axisLineVisible) { return false; } if (!ObjectUtilities.equal(this.axisLineStroke, that.axisLineStroke)) { return false; } if (!PaintUtilities.equal(this.axisLinePaint, that.axisLinePaint)) { 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.tickLabelInsets, that.tickLabelInsets )) { return false; } if (this.tickMarksVisible != that.tickMarksVisible) { return false; } if (this.tickMarkInsideLength != that.tickMarkInsideLength) { return false; } if (this.tickMarkOutsideLength != that.tickMarkOutsideLength) { return false; } if (!PaintUtilities.equal(this.tickMarkPaint, that.tickMarkPaint)) { return false; } if (!ObjectUtilities.equal(this.tickMarkStroke, that.tickMarkStroke)) { return false; } if (this.minorTickMarksVisible != that.minorTickMarksVisible) { return false; } if (this.minorTickMarkInsideLength != that.minorTickMarkInsideLength) { return false; } if (this.minorTickMarkOutsideLength != that.minorTickMarkOutsideLength) { return false; } if (this.fixedDimension != that.fixedDimension) { return false; } return true; } protected  Axis(String label); }
Axis implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Axis)) { return false; } Axis that = (Axis) obj; if (this.visible != that.visible) { return false; } if (!AttributedStringUtilities.equal(this.label, that.label)) { return false; } if (!ObjectUtilities.equal(this.labelFont, that.labelFont)) { return false; } if (!PaintUtilities.equal(this.labelPaint, that.labelPaint)) { return false; } if (!ObjectUtilities.equal(this.labelInsets, that.labelInsets)) { return false; } if (this.labelAngle != that.labelAngle) { return false; } if (!this.labelLocation.equals(that.labelLocation)) { return false; } if (this.axisLineVisible != that.axisLineVisible) { return false; } if (!ObjectUtilities.equal(this.axisLineStroke, that.axisLineStroke)) { return false; } if (!PaintUtilities.equal(this.axisLinePaint, that.axisLinePaint)) { 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.tickLabelInsets, that.tickLabelInsets )) { return false; } if (this.tickMarksVisible != that.tickMarksVisible) { return false; } if (this.tickMarkInsideLength != that.tickMarkInsideLength) { return false; } if (this.tickMarkOutsideLength != that.tickMarkOutsideLength) { return false; } if (!PaintUtilities.equal(this.tickMarkPaint, that.tickMarkPaint)) { return false; } if (!ObjectUtilities.equal(this.tickMarkStroke, that.tickMarkStroke)) { return false; } if (this.minorTickMarksVisible != that.minorTickMarksVisible) { return false; } if (this.minorTickMarkInsideLength != that.minorTickMarkInsideLength) { return false; } if (this.minorTickMarkOutsideLength != that.minorTickMarkOutsideLength) { return false; } if (this.fixedDimension != that.fixedDimension) { return false; } return true; } protected  Axis(String label); boolean isVisible(); void setVisible(boolean flag); AttributedString getLabel(); void setLabel(AttributedString label); void setLabel(String label); AttributedString createLabel(String label); Font getLabelFont(); void setLabelFont(Font font); Paint getLabelPaint(); void setLabelPaint(Paint paint); RectangleInsets getLabelInsets(); void setLabelInsets(RectangleInsets insets); void setLabelInsets(RectangleInsets insets, boolean notify); double getLabelAngle(); void setLabelAngle(double angle); AxisLabelLocation getLabelLocation(); void setLabelLocation(AxisLabelLocation location); boolean isAxisLineVisible(); void setAxisLineVisible(boolean visible); Paint getAxisLinePaint(); void setAxisLinePaint(Paint paint); Stroke getAxisLineStroke(); void setAxisLineStroke(Stroke stroke); boolean isTickLabelsVisible(); void setTickLabelsVisible(boolean flag); boolean isMinorTickMarksVisible(); void setMinorTickMarksVisible(boolean flag); Font getTickLabelFont(); void setTickLabelFont(Font font); Paint getTickLabelPaint(); void setTickLabelPaint(Paint paint); RectangleInsets getTickLabelInsets(); void setTickLabelInsets(RectangleInsets insets); boolean isTickMarksVisible(); void setTickMarksVisible(boolean flag); float getTickMarkInsideLength(); void setTickMarkInsideLength(float length); float getTickMarkOutsideLength(); void setTickMarkOutsideLength(float length); Stroke getTickMarkStroke(); void setTickMarkStroke(Stroke stroke); Paint getTickMarkPaint(); void setTickMarkPaint(Paint paint); float getMinorTickMarkInsideLength(); void setMinorTickMarkInsideLength(float length); float getMinorTickMarkOutsideLength(); void setMinorTickMarkOutsideLength(float length); Plot getPlot(); void setPlot(Plot plot); double getFixedDimension(); void setFixedDimension(double dimension); abstract void configure(); abstract AxisSpace reserveSpace(Graphics2D g2, Plot plot,
            Rectangle2D plotArea, RectangleEdge edge, AxisSpace space); abstract AxisState draw(Graphics2D g2, double cursor,
            Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge,
            PlotRenderingInfo plotState); abstract List<? extends Tick> refreshTicks(Graphics2D g2, 
            AxisState state, Rectangle2D dataArea, RectangleEdge edge); void addChangeListener(AxisChangeListener listener); void removeChangeListener(AxisChangeListener listener); boolean hasListener(EventListener listener); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode(); }
Axis implements Cloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Axis)) { return false; } Axis that = (Axis) obj; if (this.visible != that.visible) { return false; } if (!AttributedStringUtilities.equal(this.label, that.label)) { return false; } if (!ObjectUtilities.equal(this.labelFont, that.labelFont)) { return false; } if (!PaintUtilities.equal(this.labelPaint, that.labelPaint)) { return false; } if (!ObjectUtilities.equal(this.labelInsets, that.labelInsets)) { return false; } if (this.labelAngle != that.labelAngle) { return false; } if (!this.labelLocation.equals(that.labelLocation)) { return false; } if (this.axisLineVisible != that.axisLineVisible) { return false; } if (!ObjectUtilities.equal(this.axisLineStroke, that.axisLineStroke)) { return false; } if (!PaintUtilities.equal(this.axisLinePaint, that.axisLinePaint)) { 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.tickLabelInsets, that.tickLabelInsets )) { return false; } if (this.tickMarksVisible != that.tickMarksVisible) { return false; } if (this.tickMarkInsideLength != that.tickMarkInsideLength) { return false; } if (this.tickMarkOutsideLength != that.tickMarkOutsideLength) { return false; } if (!PaintUtilities.equal(this.tickMarkPaint, that.tickMarkPaint)) { return false; } if (!ObjectUtilities.equal(this.tickMarkStroke, that.tickMarkStroke)) { return false; } if (this.minorTickMarksVisible != that.minorTickMarksVisible) { return false; } if (this.minorTickMarkInsideLength != that.minorTickMarkInsideLength) { return false; } if (this.minorTickMarkOutsideLength != that.minorTickMarkOutsideLength) { return false; } if (this.fixedDimension != that.fixedDimension) { return false; } return true; } protected  Axis(String label); boolean isVisible(); void setVisible(boolean flag); AttributedString getLabel(); void setLabel(AttributedString label); void setLabel(String label); AttributedString createLabel(String label); Font getLabelFont(); void setLabelFont(Font font); Paint getLabelPaint(); void setLabelPaint(Paint paint); RectangleInsets getLabelInsets(); void setLabelInsets(RectangleInsets insets); void setLabelInsets(RectangleInsets insets, boolean notify); double getLabelAngle(); void setLabelAngle(double angle); AxisLabelLocation getLabelLocation(); void setLabelLocation(AxisLabelLocation location); boolean isAxisLineVisible(); void setAxisLineVisible(boolean visible); Paint getAxisLinePaint(); void setAxisLinePaint(Paint paint); Stroke getAxisLineStroke(); void setAxisLineStroke(Stroke stroke); boolean isTickLabelsVisible(); void setTickLabelsVisible(boolean flag); boolean isMinorTickMarksVisible(); void setMinorTickMarksVisible(boolean flag); Font getTickLabelFont(); void setTickLabelFont(Font font); Paint getTickLabelPaint(); void setTickLabelPaint(Paint paint); RectangleInsets getTickLabelInsets(); void setTickLabelInsets(RectangleInsets insets); boolean isTickMarksVisible(); void setTickMarksVisible(boolean flag); float getTickMarkInsideLength(); void setTickMarkInsideLength(float length); float getTickMarkOutsideLength(); void setTickMarkOutsideLength(float length); Stroke getTickMarkStroke(); void setTickMarkStroke(Stroke stroke); Paint getTickMarkPaint(); void setTickMarkPaint(Paint paint); float getMinorTickMarkInsideLength(); void setMinorTickMarkInsideLength(float length); float getMinorTickMarkOutsideLength(); void setMinorTickMarkOutsideLength(float length); Plot getPlot(); void setPlot(Plot plot); double getFixedDimension(); void setFixedDimension(double dimension); abstract void configure(); abstract AxisSpace reserveSpace(Graphics2D g2, Plot plot,
            Rectangle2D plotArea, RectangleEdge edge, AxisSpace space); abstract AxisState draw(Graphics2D g2, double cursor,
            Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge,
            PlotRenderingInfo plotState); abstract List<? extends Tick> refreshTicks(Graphics2D g2, 
            AxisState state, Rectangle2D dataArea, RectangleEdge edge); void addChangeListener(AxisChangeListener listener); void removeChangeListener(AxisChangeListener listener); boolean hasListener(EventListener listener); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode(); static final boolean DEFAULT_AXIS_VISIBLE; static final Font DEFAULT_AXIS_LABEL_FONT; static final Paint DEFAULT_AXIS_LABEL_PAINT; static final RectangleInsets DEFAULT_AXIS_LABEL_INSETS; static final Paint DEFAULT_AXIS_LINE_PAINT; static final Stroke DEFAULT_AXIS_LINE_STROKE; static final boolean DEFAULT_TICK_LABELS_VISIBLE; static final Font DEFAULT_TICK_LABEL_FONT; static final Paint DEFAULT_TICK_LABEL_PAINT; static final RectangleInsets DEFAULT_TICK_LABEL_INSETS; static final boolean DEFAULT_TICK_MARKS_VISIBLE; static final Stroke DEFAULT_TICK_MARK_STROKE; static final Paint DEFAULT_TICK_MARK_PAINT; static final float DEFAULT_TICK_MARK_INSIDE_LENGTH; static final float DEFAULT_TICK_MARK_OUTSIDE_LENGTH; }