public boolean equals(Object obj) {
        if (obj == this) {
            return true;   
        }
        if (!(obj instanceof XYTextAnnotation)) {
            return false;   
        }
        if (!super.equals(obj)) {
            return false;
        }
        XYTextAnnotation that = (XYTextAnnotation) obj;
        if (!this.text.equals(that.text)) {
            return false;   
        }
        if (this.x != that.x) {
            return false;
        }
        if (this.y != that.y) {
            return false;
        }
        if (!this.font.equals(that.font)) {
            return false;   
        }
        if (!PaintUtilities.equal(this.paint, that.paint)) {
            return false;   
        }
        if (!this.rotationAnchor.equals(that.rotationAnchor)) {
            return false;   
        }
        if (this.rotationAngle != that.rotationAngle) {
            return false;   
        }
        if (!this.textAnchor.equals(that.textAnchor)) {
            return false;   
        }
        return true;