@Test public void testEquals() { TextTitle t1 = new TextTitle(); TextTitle t2 = new TextTitle(); assertEquals(t1, t2); t1.setText("Test 1"); assertFalse(t1.equals(t2)); t2.setText("Test 1"); assertEquals(t1, t2); Font f = new Font("SansSerif", Font.PLAIN, 15); t1.setFont(f); assertFalse(t1.equals(t2)); t2.setFont(f); assertEquals(t1, t2); t1.setTextAlignment(HorizontalAlignment.RIGHT); assertFalse(t1.equals(t2)); t2.setTextAlignment(HorizontalAlignment.RIGHT); assertEquals(t1, t2); t1.setPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertFalse(t1.equals(t2)); t2.setPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.BLUE)); assertEquals(t1, t2); t1.setBackgroundPaint(new GradientPaint(4.0f, 3.0f, Color.RED, 2.0f, 1.0f, Color.BLUE)); assertFalse(t1.equals(t2)); t2.setBackgroundPaint(new GradientPaint(4.0f, 3.0f, Color.RED, 2.0f, 1.0f, Color.BLUE)); assertEquals(t1, t2); t1.setMaximumLinesToDisplay(3); assertFalse(t1.equals(t2)); t2.setMaximumLinesToDisplay(3); assertEquals(t1, t2); t1.setToolTipText("TTT"); assertFalse(t1.equals(t2)); t2.setToolTipText("TTT"); assertEquals(t1, t2); t1.setURLText(("URL")); assertFalse(t1.equals(t2)); t2.setURLText(("URL")); assertEquals(t1, t2); t1.setExpandToFitSpace(!t1.getExpandToFitSpace()); assertFalse(t1.equals(t2)); t2.setExpandToFitSpace(!t2.getExpandToFitSpace()); assertEquals(t1, t2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TextTitle)) { return false; } TextTitle that = (TextTitle) obj; if (!ObjectUtilities.equal(this.text, that.text)) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.textAlignment != that.textAlignment) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) { return false; } if (this.expandToFitSpace != that.expandToFitSpace) { return false; } if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtilities.equal(this.urlText, that.urlText)) { return false; } return super.equals(obj); }
TextTitle extends Title implements Serializable, Cloneable, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TextTitle)) { return false; } TextTitle that = (TextTitle) obj; if (!ObjectUtilities.equal(this.text, that.text)) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.textAlignment != that.textAlignment) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) { return false; } if (this.expandToFitSpace != that.expandToFitSpace) { return false; } if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtilities.equal(this.urlText, that.urlText)) { return false; } return super.equals(obj); } }
TextTitle extends Title implements Serializable, Cloneable, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TextTitle)) { return false; } TextTitle that = (TextTitle) obj; if (!ObjectUtilities.equal(this.text, that.text)) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.textAlignment != that.textAlignment) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) { return false; } if (this.expandToFitSpace != that.expandToFitSpace) { return false; } if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtilities.equal(this.urlText, that.urlText)) { return false; } return super.equals(obj); } TextTitle();  TextTitle(String text);  TextTitle(String text, Font font);  TextTitle(String text, Font font, Paint paint,
                     RectangleEdge position,
                     HorizontalAlignment horizontalAlignment,
                     VerticalAlignment verticalAlignment,
                     RectangleInsets padding); }
TextTitle extends Title implements Serializable, Cloneable, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TextTitle)) { return false; } TextTitle that = (TextTitle) obj; if (!ObjectUtilities.equal(this.text, that.text)) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.textAlignment != that.textAlignment) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) { return false; } if (this.expandToFitSpace != that.expandToFitSpace) { return false; } if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtilities.equal(this.urlText, that.urlText)) { return false; } return super.equals(obj); } TextTitle();  TextTitle(String text);  TextTitle(String text, Font font);  TextTitle(String text, Font font, Paint paint,
                     RectangleEdge position,
                     HorizontalAlignment horizontalAlignment,
                     VerticalAlignment verticalAlignment,
                     RectangleInsets padding); String getText(); void setText(String text); HorizontalAlignment getTextAlignment(); void setTextAlignment(HorizontalAlignment alignment); Font getFont(); void setFont(Font font); Paint getPaint(); void setPaint(Paint paint); Paint getBackgroundPaint(); void setBackgroundPaint(Paint paint); String getToolTipText(); void setToolTipText(String text); String getURLText(); void setURLText(String text); boolean getExpandToFitSpace(); void setExpandToFitSpace(boolean expand); int getMaximumLinesToDisplay(); void setMaximumLinesToDisplay(int max); @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); @Override int hashCode(); @Override Object clone(); }
TextTitle extends Title implements Serializable, Cloneable, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TextTitle)) { return false; } TextTitle that = (TextTitle) obj; if (!ObjectUtilities.equal(this.text, that.text)) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.textAlignment != that.textAlignment) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) { return false; } if (this.expandToFitSpace != that.expandToFitSpace) { return false; } if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtilities.equal(this.urlText, that.urlText)) { return false; } return super.equals(obj); } TextTitle();  TextTitle(String text);  TextTitle(String text, Font font);  TextTitle(String text, Font font, Paint paint,
                     RectangleEdge position,
                     HorizontalAlignment horizontalAlignment,
                     VerticalAlignment verticalAlignment,
                     RectangleInsets padding); String getText(); void setText(String text); HorizontalAlignment getTextAlignment(); void setTextAlignment(HorizontalAlignment alignment); Font getFont(); void setFont(Font font); Paint getPaint(); void setPaint(Paint paint); Paint getBackgroundPaint(); void setBackgroundPaint(Paint paint); String getToolTipText(); void setToolTipText(String text); String getURLText(); void setURLText(String text); boolean getExpandToFitSpace(); void setExpandToFitSpace(boolean expand); int getMaximumLinesToDisplay(); void setMaximumLinesToDisplay(int max); @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); @Override int hashCode(); @Override Object clone(); static final Font DEFAULT_FONT; static final Paint DEFAULT_TEXT_PAINT; }