-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in 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
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 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:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
package org.simantics.scenegraph.g2d.nodes;
-\r
-import java.awt.Graphics2D;\r
-import java.awt.geom.AffineTransform;\r
-\r
-import org.simantics.scenegraph.g2d.G2DParentNode;\r
-import org.simantics.scenegraph.g2d.IdentityAffineTransform;\r
+
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+
+import org.simantics.scenegraph.g2d.G2DParentNode;
+import org.simantics.scenegraph.g2d.IdentityAffineTransform;
public class TransformNode extends G2DParentNode {
-\r
+
private static final long serialVersionUID = -3722167807691239528L;
@SyncField("transform")
- public void rotate(double theta) {\r
- if (transform == IdentityAffineTransform.INSTANCE)\r
- transform = AffineTransform.getRotateInstance(theta);\r
+ public void rotate(double theta) {
+ if (transform == IdentityAffineTransform.INSTANCE)
+ transform = AffineTransform.getRotateInstance(theta);
else
transform.rotate(theta);
}
@SyncField("transform")
public void translate(double x, double y) {
- if (transform == IdentityAffineTransform.INSTANCE)\r
- transform = AffineTransform.getTranslateInstance(x, y);\r
- else\r
+ if (transform == IdentityAffineTransform.INSTANCE)
+ transform = AffineTransform.getTranslateInstance(x, y);
+ else
transform.translate(x, y);
}
@SyncField("transform")
- public void scale(double x, double y) {\r
- if (transform == IdentityAffineTransform.INSTANCE)\r
- transform = AffineTransform.getScaleInstance(x, y);\r
- else\r
+ public void scale(double x, double y) {
+ if (transform == IdentityAffineTransform.INSTANCE)
+ transform = AffineTransform.getScaleInstance(x, y);
+ else
transform.scale(x, y);
}
@Override
public void render(Graphics2D g2d) {
- super.render(g2d);\r
+ super.render(g2d);
}
@Override
- public String toString() {\r
+ public String toString() {
return super.toString();
- }\r
+ }
}