X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.eclipse.swt.win32.win32.x86_64%2Fsrc%2Forg%2Feclipse%2Fswt%2Fgraphics%2FLineAttributes.java;fp=bundles%2Forg.eclipse.swt.win32.win32.x86_64%2Fsrc%2Forg%2Feclipse%2Fswt%2Fgraphics%2FLineAttributes.java;h=43586cb8bc15a2f92135cbf08fa48c4b02a39ca5;hb=6b98970d0458754dd67f789afbd0a39e1e7ac6eb;hp=0000000000000000000000000000000000000000;hpb=56a61575ce0d27b340cb12438c8a7f303842095e;p=simantics%2Fplatform.git
diff --git a/bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/graphics/LineAttributes.java b/bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/graphics/LineAttributes.java
new file mode 100644
index 000000000..43586cb8b
--- /dev/null
+++ b/bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/graphics/LineAttributes.java
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.*;
+
+/**
+ * LineAttributes
defines a set of line attributes that
+ * can be modified in a GC.
+ *
+ * Application code does not need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no dispose()
method is provided.
+ *
true
if the object is the same as this object and false
otherwise
+ *
+ * @see #hashCode()
+ */
+@Override
+public boolean equals (Object object) {
+ if (object == this) return true;
+ if (!(object instanceof LineAttributes)) return false;
+ LineAttributes p = (LineAttributes)object;
+ if (p.width != width) return false;
+ if (p.cap != cap) return false;
+ if (p.join != join) return false;
+ if (p.style != style) return false;
+ if (p.dashOffset != dashOffset) return false;
+ if (p.miterLimit != miterLimit) return false;
+ if (p.dash != null && dash != null) {
+ if (p.dash.length != dash.length) return false;
+ for (int i = 0; i < dash.length; i++) {
+ if (p.dash[i] != dash[i]) return false;
+ }
+ } else {
+ if (p.dash != null || dash != null) return false;
+ }
+ return true;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return true
when passed to
+ * equals
must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+@Override
+public int hashCode () {
+ int hashCode = Float.floatToIntBits(width);
+ hashCode = 31 * hashCode + cap;
+ hashCode = 31 * hashCode + join;
+ hashCode = 31 * hashCode + style;
+ hashCode = 31 * hashCode + Float.floatToIntBits(dashOffset);
+ hashCode = 31 * hashCode + Float.floatToIntBits(miterLimit);
+ if (dash != null) {
+ for (int i = 0; i < dash.length; i++) {
+ hashCode = 31 * hashCode + Float.floatToIntBits(dash[i]);
+ }
+ }
+ return hashCode;
+}
+
+}