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