]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/TransformationAssignment.java
Support for dynamic transforms for both elements and terminals
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / nodes / TransformationAssignment.java
diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/TransformationAssignment.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/TransformationAssignment.java
new file mode 100644 (file)
index 0000000..ce39db5
--- /dev/null
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Semantum Oy - initial API and implementation
+ *******************************************************************************/
+package org.simantics.scenegraph.g2d.nodes;
+
+import java.awt.geom.AffineTransform;
+
+/**
+ * @author Antti Villberg
+ * @since 1.29.0
+ */
+public class TransformationAssignment {
+       public Object key;
+       public AffineTransform transform;
+       public TransformationAssignment(Object key, AffineTransform transform) {
+               this.key = key;
+               this.transform = transform;
+       }
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((key == null) ? 0 : key.hashCode());
+               result = prime * result + ((transform == null) ? 0 : transform.hashCode());
+               return result;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               TransformationAssignment other = (TransformationAssignment) obj;
+               if (key == null) {
+                       if (other.key != null)
+                               return false;
+               } else if (!key.equals(other.key))
+                       return false;
+               if (transform == null) {
+                       if (other.transform != null)
+                               return false;
+               } else if (!transform.equals(other.transform))
+                       return false;
+               return true;
+       }
+}
\ No newline at end of file