]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/IdentityAffineTransform.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / IdentityAffineTransform.java
diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/IdentityAffineTransform.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/IdentityAffineTransform.java
new file mode 100644 (file)
index 0000000..2eb989b
--- /dev/null
@@ -0,0 +1,164 @@
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.scenegraph.g2d;\r
+\r
+import java.awt.geom.AffineTransform;\r
+import java.awt.geom.NoninvertibleTransformException;\r
+\r
+/**\r
+ * An optimization for memory consumption to keep down the allocation of\r
+ * unnecessary identity-type affine transforms. This will be used as the default\r
+ * affine transform in {@link G2DNode} and {@link G2DParentNode}.\r
+ * \r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class IdentityAffineTransform extends AffineTransform {\r
+\r
+    public static final IdentityAffineTransform INSTANCE = new IdentityAffineTransform();\r
+\r
+    private static final long serialVersionUID = 7843049586639496587L;\r
+\r
+    private IdentityAffineTransform() {\r
+        // No self-construction.\r
+    }\r
+\r
+    @Override\r
+    public boolean isIdentity() {\r
+        return true;\r
+    }\r
+\r
+    @Override\r
+    public void translate(double tx, double ty) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void rotate(double theta) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void rotate(double theta, double anchorx, double anchory) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void rotate(double vecx, double vecy) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void rotate(double vecx, double vecy, double anchorx, double anchory) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void quadrantRotate(int numquadrants) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void quadrantRotate(int numquadrants, double anchorx, double anchory) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void scale(double sx, double sy) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void shear(double shx, double shy) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToIdentity() {\r
+        // NOP\r
+    }\r
+\r
+    @Override\r
+    public void setToTranslation(double tx, double ty) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToRotation(double theta) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToRotation(double theta, double anchorx, double anchory) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToRotation(double vecx, double vecy) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToRotation(double vecx, double vecy, double anchorx, double anchory) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToQuadrantRotation(int numquadrants) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToQuadrantRotation(int numquadrants, double anchorx, double anchory) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToScale(double sx, double sy) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setToShear(double shx, double shy) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setTransform(AffineTransform Tx) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void concatenate(AffineTransform Tx) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void preConcatenate(AffineTransform Tx) {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public void invert() throws NoninvertibleTransformException {\r
+        throw new UnsupportedOperationException();\r
+    }\r
+\r
+    @Override\r
+    public Object clone() {\r
+        return new AffineTransform();\r
+    }\r
+\r
+}
\ No newline at end of file