]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/IdentityAffineTransform.java
Sync git svn branch with SVN repository r33269.
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / IdentityAffineTransform.java
1 /*******************************************************************************\r
2  * Copyright (c) 2012 Association for Decentralized Information Management in\r
3  * Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.scenegraph.g2d;\r
13 \r
14 import java.awt.geom.AffineTransform;\r
15 import java.awt.geom.NoninvertibleTransformException;\r
16 \r
17 /**\r
18  * An optimization for memory consumption to keep down the allocation of\r
19  * unnecessary identity-type affine transforms. This will be used as the default\r
20  * affine transform in {@link G2DNode} and {@link G2DParentNode}.\r
21  * \r
22  * @author Tuukka Lehtonen\r
23  */\r
24 public class IdentityAffineTransform extends AffineTransform {\r
25 \r
26     public static final IdentityAffineTransform INSTANCE = new IdentityAffineTransform();\r
27 \r
28     private static final long serialVersionUID = 7843049586639496587L;\r
29 \r
30     private IdentityAffineTransform() {\r
31         // No self-construction.\r
32     }\r
33 \r
34     @Override\r
35     public boolean isIdentity() {\r
36         return true;\r
37     }\r
38 \r
39     @Override\r
40     public void translate(double tx, double ty) {\r
41         throw new UnsupportedOperationException();\r
42     }\r
43 \r
44     @Override\r
45     public void rotate(double theta) {\r
46         throw new UnsupportedOperationException();\r
47     }\r
48 \r
49     @Override\r
50     public void rotate(double theta, double anchorx, double anchory) {\r
51         throw new UnsupportedOperationException();\r
52     }\r
53 \r
54     @Override\r
55     public void rotate(double vecx, double vecy) {\r
56         throw new UnsupportedOperationException();\r
57     }\r
58 \r
59     @Override\r
60     public void rotate(double vecx, double vecy, double anchorx, double anchory) {\r
61         throw new UnsupportedOperationException();\r
62     }\r
63 \r
64     @Override\r
65     public void quadrantRotate(int numquadrants) {\r
66         throw new UnsupportedOperationException();\r
67     }\r
68 \r
69     @Override\r
70     public void quadrantRotate(int numquadrants, double anchorx, double anchory) {\r
71         throw new UnsupportedOperationException();\r
72     }\r
73 \r
74     @Override\r
75     public void scale(double sx, double sy) {\r
76         throw new UnsupportedOperationException();\r
77     }\r
78 \r
79     @Override\r
80     public void shear(double shx, double shy) {\r
81         throw new UnsupportedOperationException();\r
82     }\r
83 \r
84     @Override\r
85     public void setToIdentity() {\r
86         // NOP\r
87     }\r
88 \r
89     @Override\r
90     public void setToTranslation(double tx, double ty) {\r
91         throw new UnsupportedOperationException();\r
92     }\r
93 \r
94     @Override\r
95     public void setToRotation(double theta) {\r
96         throw new UnsupportedOperationException();\r
97     }\r
98 \r
99     @Override\r
100     public void setToRotation(double theta, double anchorx, double anchory) {\r
101         throw new UnsupportedOperationException();\r
102     }\r
103 \r
104     @Override\r
105     public void setToRotation(double vecx, double vecy) {\r
106         throw new UnsupportedOperationException();\r
107     }\r
108 \r
109     @Override\r
110     public void setToRotation(double vecx, double vecy, double anchorx, double anchory) {\r
111         throw new UnsupportedOperationException();\r
112     }\r
113 \r
114     @Override\r
115     public void setToQuadrantRotation(int numquadrants) {\r
116         throw new UnsupportedOperationException();\r
117     }\r
118 \r
119     @Override\r
120     public void setToQuadrantRotation(int numquadrants, double anchorx, double anchory) {\r
121         throw new UnsupportedOperationException();\r
122     }\r
123 \r
124     @Override\r
125     public void setToScale(double sx, double sy) {\r
126         throw new UnsupportedOperationException();\r
127     }\r
128 \r
129     @Override\r
130     public void setToShear(double shx, double shy) {\r
131         throw new UnsupportedOperationException();\r
132     }\r
133 \r
134     @Override\r
135     public void setTransform(AffineTransform Tx) {\r
136         throw new UnsupportedOperationException();\r
137     }\r
138 \r
139     @Override\r
140     public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12) {\r
141         throw new UnsupportedOperationException();\r
142     }\r
143 \r
144     @Override\r
145     public void concatenate(AffineTransform Tx) {\r
146         throw new UnsupportedOperationException();\r
147     }\r
148 \r
149     @Override\r
150     public void preConcatenate(AffineTransform Tx) {\r
151         throw new UnsupportedOperationException();\r
152     }\r
153 \r
154     @Override\r
155     public void invert() throws NoninvertibleTransformException {\r
156         throw new UnsupportedOperationException();\r
157     }\r
158 \r
159     @Override\r
160     public Object clone() {\r
161         return new AffineTransform();\r
162     }\r
163 \r
164 }