1.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/LinearGradient.java Thu May 23 09:47:20 2013 +0200
1.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/LinearGradient.java Fri May 24 12:29:58 2013 +0200
1.3 @@ -18,6 +18,7 @@
1.4 package net.java.html.canvas;
1.5
1.6 import java.util.HashMap;
1.7 +import java.util.Objects;
1.8
1.9 /**
1.10 *
1.11 @@ -82,5 +83,43 @@
1.12 public void setY1(double y1) {
1.13 this.y1 = y1;
1.14 }
1.15 +
1.16 + @Override
1.17 + public int hashCode() {
1.18 + int hash = 7;
1.19 + hash = 29 * hash + Objects.hashCode(this.stops);
1.20 + hash = 29 * hash + (int) (Double.doubleToLongBits(this.x0) ^ (Double.doubleToLongBits(this.x0) >>> 32));
1.21 + hash = 29 * hash + (int) (Double.doubleToLongBits(this.y0) ^ (Double.doubleToLongBits(this.y0) >>> 32));
1.22 + hash = 29 * hash + (int) (Double.doubleToLongBits(this.x1) ^ (Double.doubleToLongBits(this.x1) >>> 32));
1.23 + hash = 29 * hash + (int) (Double.doubleToLongBits(this.y1) ^ (Double.doubleToLongBits(this.y1) >>> 32));
1.24 + return hash;
1.25 + }
1.26 +
1.27 + @Override
1.28 + public boolean equals(Object obj) {
1.29 + if (obj == null) {
1.30 + return false;
1.31 + }
1.32 + if (getClass() != obj.getClass()) {
1.33 + return false;
1.34 + }
1.35 + final LinearGradient other = (LinearGradient) obj;
1.36 + if (!Objects.equals(this.stops, other.stops)) {
1.37 + return false;
1.38 + }
1.39 + if (Double.doubleToLongBits(this.x0) != Double.doubleToLongBits(other.x0)) {
1.40 + return false;
1.41 + }
1.42 + if (Double.doubleToLongBits(this.y0) != Double.doubleToLongBits(other.y0)) {
1.43 + return false;
1.44 + }
1.45 + if (Double.doubleToLongBits(this.x1) != Double.doubleToLongBits(other.x1)) {
1.46 + return false;
1.47 + }
1.48 + if (Double.doubleToLongBits(this.y1) != Double.doubleToLongBits(other.y1)) {
1.49 + return false;
1.50 + }
1.51 + return true;
1.52 + }
1.53
1.54 }